]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-invoke-editor.scm
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scripts / lilypond-invoke-editor.scm
index 2f4f3e84e54c9cfc5af90edc3675172093f634f4..6658f50166dfe4d98f56d2d2aad068d4e291f864 100644 (file)
@@ -1,10 +1,23 @@
 #!@GUILE@ -s
 !#
 ;;;; lilypond-invoke-editor.scm -- Invoke an editor in file:line:column mode
+
+;;;; Copyright (C) 2005--2015 Jan Nieuwenhuizen <janneke@gnu.org>
+
+;;;; This file is part of LilyPond, the GNU music typesetter.
+;;;;
+;;;; LilyPond is free software: you can redistribute it and/or modify
+;;;; it under the terms of the GNU General Public License as published by
+;;;; the Free Software Foundation, either version 3 of the License, or
+;;;; (at your option) any later version.
 ;;;;
-;;;; source file of the GNU LilyPond music typesetter
+;;;; LilyPond is distributed in the hope that it will be useful,
+;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;;; GNU General Public License for more details.
 ;;;;
-;;;; (c) 2005--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; You should have received a copy of the GNU General Public License
+;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 
 ;; gui debug helper
 ;; (define (exit x) (system "sleep 10"))
        (format #f "~a/share/lilypond/~a"
                prefix TOPLEVEL-VERSION))))
 
-
-
-;; gettext wrapper for guile < 1.7.2
-(if (defined? 'gettext)
-    (define-public _ gettext)
-    (define-public (_ x) x))
+(define-public _ gettext)
 
 (define (show-version port)
   (format port "~a (GNU LilyPond) ~a\n" PROGRAM-NAME TOPLEVEL-VERSION))
@@ -81,7 +89,7 @@ Options:
          uri))
 
 (define (is-textedit-uri? uri)
-  (string-match "^textedit://" uri))
+  (string-match "^textedit:" uri))
   
   
 (define (dissect-uri uri)
@@ -121,7 +129,7 @@ Options:
 (define (run-browser uri)
   (system
    (if (getenv "BROWSER")
-       (format "~a ~a" (getenv "BROWSER") uri)
+       (format #f "~a ~a" (getenv "BROWSER") uri)
        (format #f "firefox -remote 'OpenURL(~a,new-tab)'" uri))))
 
 
@@ -143,9 +151,12 @@ Options:
     (if (running-from-gui?)
        (redirect-port (current-error-port)
                       (open-file (string-append
-                                  (or (getenv "TMP")
-                                      (getenv "TEMP")
-                                      "/tmp")
+                                   (if (string-match "^(Windows|CYGWIN)"
+                                                     (utsname:sysname (uname)))
+                                       (or (getenv "TMP")
+                                           (getenv "TEMP"))
+                                       (or (getenv "TMPDIR")
+                                           "/tmp"))
                                   "/lilypond-invoke-editor.log") "a")))
     (if (not (= (length files) 1))
        (begin