]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/editor.scm
Run `make grand-replace'.
[lilypond.git] / scm / editor.scm
index 2491e0c4cad452315eb186484d52f05a232b73ae..94bc0ae70882cde5e06f09d36416923dd6728a2d 100644 (file)
@@ -2,20 +2,20 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2005 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 2005--2008 Jan Nieuwenhuizen <janneke@gnu.org>
 
 (define-module (scm editor))
 
+;; Also for standalone use, so cannot include any lily modules.
 (use-modules
- (ice-9 regex))
+ (ice-9 regex)
+ (srfi srfi-13)
+ (srfi srfi-14))
 
-(define editor-command-template-alist
-  '(("emacs" .  "emacsclient --no-wait +%(line)s:%(column)s %(file)s")
-    ("gvim" . "gvim --remote +:%(line)s:norm%(column)s %(file)s")
-    ("nedit" . "nc -noask +%(line)s %(file)s")
-    ("gedit" . "gedit +%(line)s %(file)s")
-    ("jedit" . "jedit %(file)s +line:%(line)s")
-    ("lilypad" . "lilypad +%(line)s:%(column)s %(file)s")))
+(define PLATFORM
+  (string->symbol
+   (string-downcase
+    (car (string-tokenize (vector-ref (uname) 0) char-set:letter)))))
 
 (define (get-editor)
   (or (getenv "LYEDITOR")
        (else
         "emacs"))))
 
+(define editor-command-template-alist
+  '(("emacs" .  "emacsclient --no-wait +%(line)s:%(column)s %(file)s || (emacs +%(line)s:%(column)s %(file)s&)")
+    ("gvim" . "gvim --remote +:%(line)s:norm%(char)s %(file)s")
+    ("uedit32" . "uedit32 %(file)s -l%(line)s -c%(char)s")
+    ("nedit" . "nc -noask +%(line)s %(file)s")
+    ("gedit" . "gedit +%(line)s %(file)s")
+    ("jedit" . "jedit -reuseview %(file)s +line:%(line)s")
+    ("syn" . "syn -line %(line)s -col %(char)s %(file)s")
+    ("lilypad" . "lilypad +%(line)s:%(char)s %(file)s")))
+
 (define (get-command-template alist editor)
   (define (get-command-template-helper)
     (if (null? alist)
      x
      (re-sub "\\\\" "/" x)))
 
-(define-public (get-editor-command file-name line column)
+(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 "%\\(column\\)s" (format #f "~a" column)
-                                 (slashify template))))))
+                         (re-sub "%\\(char\\)s" (format #f "~a" char)
+                                 (re-sub
+                                  "%\\(column\\)s" (format #f "~a" column)
+                                  (slashify template)))))))
     command))