]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-invoke-editor.scm
(editor-command-template-alist): Add syn
[lilypond.git] / scripts / lilypond-invoke-editor.scm
index e61d10f779ff5f4574c2210023da68a8219456d7..18dff212e652a8616097d3e47408eba1226630a5 100755 (executable)
 (define (show-help port)
   (format port (_ "Usage: lilypond-invoke-editor [textedit://]FILE:LINE:COLUMN
 
-Visit a file and position the cursor
+Visit a file and position the cursor.
 
 Options:
-  -h,--help          show this help
-  -v,--version       show version
+  -h, --help          show this help
+  -v, --version       show version
 ")))
 
 (define (parse-options args)
@@ -66,9 +66,6 @@ Options:
     (show-version (current-error-port))
     files))
 
-;;(define (re-sub re sub string)
-;;  (let ((sub-string (if (string? sub) sub (sub re))))
-;;    (regexp-substitute/global #f re string 'pre sub-string 'post)))
 (define (re-sub re sub string)
   (regexp-substitute/global #f re string 'pre sub 'post))
 
@@ -106,9 +103,7 @@ Options:
 (define (running-from-gui?)
   (let ((have-tty? (isatty? (current-input-port))))
     ;; If no TTY and not using safe, assume running from GUI.
-    ;; for mingw, the test must be inverted.
-    (if (eq? PLATFORM 'windows)
-       have-tty? (not have-tty?))))
+    (not have-tty?)))
 
 (define (main args)
   (let ((files (parse-options args)))
@@ -122,7 +117,7 @@ Options:
     (if (not (= (length files) 1))
        (begin
          (show-help (current-error-port))
-         (exit 1)))
+         (exit 2)))
     (set! %load-path (cons LILYPONDPREFIX %load-path))
     (primitive-eval '(use-modules (scm editor)))
     (let* ((uri (car files))