From: Han-Wen Nienhuys Date: Wed, 8 Jun 2005 13:10:21 +0000 (+0000) Subject: * scm/editor.scm: add char argument. X-Git-Tag: release/2.5.30~26 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=deba20843656c9de2a4f2b616131e27c2c47d508;p=lilypond.git * scm/editor.scm: add char argument. * scripts/lilypond-invoke-editor.scm (dissect-uri): add char. --- diff --git a/ChangeLog b/ChangeLog index 4410759366..f53ac857e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-06-08 Han-Wen Nienhuys + * scm/editor.scm: add char argument. + + * scripts/lilypond-invoke-editor.scm (dissect-uri): add char. + * ttftool/util.c (syserror): use errno for better error reporting. * lily/source-file.cc (get_counts): new function. Calc column, diff --git a/scm/editor.scm b/scm/editor.scm index 5fdd7f4eb6..82923aa7b4 100644 --- a/scm/editor.scm +++ b/scm/editor.scm @@ -60,7 +60,7 @@ 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 diff --git a/scm/framework-gnome.scm b/scm/framework-gnome.scm index d8a9699c36..17f7e43525 100644 --- a/scm/framework-gnome.scm +++ b/scm/framework-gnome.scm @@ -177,8 +177,9 @@ (define (spawn-editor location) (let* ((file-name (car location)) (line (cadr location)) - (column (caddr location)) - (command (get-editor-command file line column))) + (char (caddr location)) + (column (cadddr location)) + (command (get-editor-command file line char column))) (debugf "spawning: ~s\n" command) (if (= (primitive-fork) 0) (let ((command-list (string-split command #\ )));; (get-ifs)))) diff --git a/scm/lily.scm b/scm/lily.scm index 66b64cbe53..339217d3f1 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -361,7 +361,7 @@ The syntax is the same as `define*-public'." (begin ;; ugh (ly:stderr-redirect "foo" "r") - (system (get-editor-command log-name 0 0)) + (system (get-editor-command log-name 0 0 0)) (ly:error (_ "failed files: ~S") (string-join failed)) ;; not reached? (exit 1)) @@ -371,7 +371,7 @@ The syntax is the same as `define*-public'." (let* ((ly (string-append (ly:effective-prefix) "/ly/")) ;; FIXME: soft-code, localize (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) - (cmd (get-editor-command welcome-ly 0 0))) + (cmd (get-editor-command welcome-ly 0 0 0))) (ly:message (_ "Invoking `~a'...") cmd) (system cmd) (exit 1))) diff --git a/scripts/lilypond-invoke-editor.scm b/scripts/lilypond-invoke-editor.scm index 18dff212e6..ec58591966 100755 --- a/scripts/lilypond-invoke-editor.scm +++ b/scripts/lilypond-invoke-editor.scm @@ -42,7 +42,7 @@ (format port "~a (GNU LilyPond) ~a \n" PROGRAM-NAME TOPLEVEL-VERSION)) (define (show-help port) - (format port (_ "Usage: lilypond-invoke-editor [textedit://]FILE:LINE:COLUMN + (format port (_ "Usage: lilypond-invoke-editor [textedit://]FILE:LINE:CHAR:COLUMN Visit a file and position the cursor. @@ -79,19 +79,20 @@ Options: (define (dissect-uri uri) (let* ((ri "textedit://") - (file-name:line:column (re-sub ri "" uri)) - (match (string-match "(.*):([^:]+):(.*)$" file-name:line:column))) + (file-name:line:char:column (re-sub ri "" uri)) + (match (string-match "(.*):([^:]+):([^:]+):(.*)$" file-name:line:char:column))) (if match (list (unquote-uri (match:substring match 1)) (match:substring match 2) - (match:substring match 3)) + (match:substring match 3) + (match:substring match 4)) (begin ;; FIXME: why be so strict wrt :LINE:COLUMN, ;; esp. considering omitting textedit:// is explicitly ;; allowed. (format (current-error-port) (_ "invalid URI: ~a") uri) (newline (current-error-port)) - (format (current-error-port) (_ "expect: ~aFILE:LINE:COLUMN") ri) + (format (current-error-port) (_ "expect: ~aFILE:LINE:CHAR:COLUMN") ri) (newline (current-error-port)) (exit 1)))))