X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Flilypond-invoke-editor.scm;h=7ff21871fe4ac444e7a07c6f984fca5992344f66;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=275aa901d88304e05d08f1cd1cbaffddbdf1c8f9;hpb=e955d4dcc2e1aef9864c43be49dc2d18b8c074d3;p=lilypond.git diff --git a/scripts/lilypond-invoke-editor.scm b/scripts/lilypond-invoke-editor.scm old mode 100755 new mode 100644 index 275aa901d8..7ff21871fe --- a/scripts/lilypond-invoke-editor.scm +++ b/scripts/lilypond-invoke-editor.scm @@ -4,7 +4,7 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 2005--2006 Jan Nieuwenhuizen +;;;; (c) 2005--2008 Jan Nieuwenhuizen ;; gui debug helper ;; (define (exit x) (system "sleep 10")) @@ -24,9 +24,9 @@ ;; argv0 relocation -- do in wrapper? -(define LILYPONDPREFIX +(define LILYPOND_DATADIR (let* ((prefix - (or (getenv "LILYPONDPREFIX") + (or (getenv "LILYPOND_DATADIR") (dirname (dirname (car (command-line))))))) @@ -42,7 +42,7 @@ (define-public (_ x) x)) (define (show-version port) - (format port "~a (GNU LilyPond) ~a \n" PROGRAM-NAME TOPLEVEL-VERSION)) + (format port "~a (GNU LilyPond) ~a\n" PROGRAM-NAME TOPLEVEL-VERSION)) (define (show-help port) (format port (_ "Usage: lilypond-invoke-editor [textedit://]FILE:LINE:CHAR:COLUMN @@ -127,15 +127,16 @@ Options: (define (strip-framework-path var) (define pat "lilypond/usr") - (let* - ((val (getenv var)) - (paths (string-split val #\:)) - (without (remove (lambda (s) (string-contains s pat)) - paths))) - - (if (not (= (length without) - (length paths))) - (setenv var (string-join without ":"))))) + (if (getenv var) + (let* + ((val (getenv var)) + (paths (string-split val #\:)) + (without (remove (lambda (s) (string-contains s pat)) + paths))) + + (if (not (= (length without) + (length paths))) + (setenv var (string-join without ":")))))) (define (main args) (let ((files (parse-options args))) @@ -150,7 +151,7 @@ Options: (begin (show-help (current-error-port)) (exit 2))) - (set! %load-path (cons LILYPONDPREFIX %load-path)) + (set! %load-path (cons LILYPOND_DATADIR %load-path)) (primitive-eval '(use-modules (scm editor)))