From: Han-Wen Nienhuys Date: Tue, 10 May 2005 08:29:09 +0000 (+0000) Subject: (ly_pc_editor): robustness. X-Git-Tag: release/2.5.24~22 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b6cea347b3f98e33f7da5062bb94427b0471e12f;p=lilypond.git (ly_pc_editor): robustness. --- diff --git a/ChangeLog b/ChangeLog index abb2e764ec..3c44eb15c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-05-10 Han-Wen Nienhuys + + * scripts/lilypond-pdfpc-helper.py (ly_pc_editor): robustness. + 2005-05-10 Jan Nieuwenhuizen * scm/backend-library.scm (postscript->pdf): Invoke gs instead of diff --git a/scripts/lilypond-pdfpc-helper.py b/scripts/lilypond-pdfpc-helper.py index 25a7259107..cfd086fe2f 100644 --- a/scripts/lilypond-pdfpc-helper.py +++ b/scripts/lilypond-pdfpc-helper.py @@ -75,7 +75,12 @@ if not match: (file, line, column) = tuple (match.groups()) -editor = os.environ['EDITOR'] + +editor = '' +try: + editor = os.environ['EDITOR'] +except KeyError: + pass ly_pc_editor = None try: ly_pc_editor = os.environ['LYEDITOR'] @@ -91,6 +96,10 @@ if ly_pc_editor == None: elif re.search ('nedit', editor): ly_pc_editor = 'nc -noask +%(line)s %(file)s' +if not ly_pc_editor: + sys.stderr.write ("Need to set EDITOR or LYEDITOR") + sys.exit (1) + command = ly_pc_editor % vars() print 'invoked with %s\ncalling %s\n' % (string.join (sys.argv),command)