]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/editor.scm
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scm / editor.scm
index ff1894a268aed6b07cb46b9e3d4c6d5ed9f8e8b5..8a34e79028e35a142b7ff967860e3115fc950c37 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2005--2011 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Copyright (C) 2005--2015 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
@@ -36,9 +36,9 @@
       ;; FIXME: how are default/preferred editors specified on
       ;; different platforms?
       (case PLATFORM
-       ((windows) "lilypad")
-       (else
-        "emacs"))))
+        ((windows) "lilypad")
+        (else
+         "emacs"))))
 
 (define editor-command-template-alist
   '(("emacs" .  "emacsclient --no-wait +%(line)s:%(column)s %(file)s || (emacs +%(line)s:%(column)s %(file)s&)")
 (define (get-command-template alist editor)
   (define (get-command-template-helper)
     (if (null? alist)
-       (if (string-match "%\\(file\\)s" editor)
-           editor
-           (string-append editor " %(file)s"))
-       (if (string-match (caar alist) editor)
-           (cdar alist)
-           (get-command-template (cdr alist) editor))))
+        (if (string-match "%\\(file\\)s" editor)
+            editor
+            (string-append editor " %(file)s"))
+        (if (string-match (caar alist) editor)
+            (cdar alist)
+            (get-command-template (cdr alist) editor))))
   (if (string-match "%\\(file\\)s" editor)
       editor
       (get-command-template-helper)))
   (regexp-substitute/global #f re string 'pre sub 'post))
 
 (define (slashify x)
- (if (string-index x #\/)
-     x
-     (re-sub "\\\\" "/" x)))
 (if (string-index x #\/)
+      x
+      (re-sub "\\\\" "/" x)))
 
 (define-public (get-editor-command file-name line char column)
   (let* ((editor (get-editor))
-        (template (get-command-template editor-command-template-alist editor))
-        (command
-         (re-sub "%\\(file\\)s" (format #f "~S" file-name)
-                 (re-sub "%\\(line\\)s" (format #f "~a" line)
-                         (re-sub "%\\(char\\)s" (format #f "~a" char)
-                                 (re-sub
-                                  "%\\(column\\)s" (format #f "~a" column)
-                                  (slashify template)))))))
+         (template (get-command-template editor-command-template-alist editor))
+         (command
+          (re-sub "%\\(file\\)s" (format #f "~S" file-name)
+                  (re-sub "%\\(line\\)s" (format #f "~a" line)
+                          (re-sub "%\\(char\\)s" (format #f "~a" char)
+                                  (re-sub
+                                   "%\\(column\\)s" (format #f "~a" column)
+                                   (slashify template)))))))
     command))