X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Feditor.scm;h=01e924476197f5329a2f2d17feb0b00820483b49;hb=f2bb61843cdd3e049945c4b56b80089eefb3f7a4;hp=46494c2912943d5bfb832fdb83f79bc106a52240;hpb=e3c806d04a094d01eba6dae6a049475d943b34aa;p=lilypond.git diff --git a/scm/editor.scm b/scm/editor.scm index 46494c2912..01e9244761 100644 --- a/scm/editor.scm +++ b/scm/editor.scm @@ -2,15 +2,15 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 2005 Jan Nieuwenhuizen +;;;; (c) 2005--2009 Jan Nieuwenhuizen (define-module (scm editor)) ;; Also for standalone use, so cannot include any lily modules. (use-modules (ice-9 regex) - (srfi srfi-13) - (srfi srfi-14)) + (srfi srfi-13) + (srfi srfi-14)) (define PLATFORM (string->symbol @@ -30,13 +30,14 @@ "emacs")))) (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") - ("uedit32" . "uedit32 %(file)s -l%(line)s -c%(column)s") + '(("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") - ("lilypad" . "lilypad +%(line)s:%(column)s %(file)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) @@ -59,12 +60,14 @@ 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))