]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/editor.scm: add char argument.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 8 Jun 2005 13:10:21 +0000 (13:10 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 8 Jun 2005 13:10:21 +0000 (13:10 +0000)
* scripts/lilypond-invoke-editor.scm (dissect-uri): add char.

ChangeLog
scm/editor.scm
scm/framework-gnome.scm
scm/lily.scm
scripts/lilypond-invoke-editor.scm

index 44107593669aa2d3c0355e10b4ddbff2c65fd5e3..f53ac857e4d8d55aaeb073b5c1d77a9181a776f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-06-08  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * 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,
index 5fdd7f4eb644fd0607417f8ad7caef488b0d98b0..82923aa7b46a0cd2ede715dc1fe006bb988afd35 100644 (file)
@@ -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
index d8a9699c36987071bba072f6ff4b6d093f15ae73..17f7e43525d0ae15129a66478f32c0b1df73e741 100644 (file)
 (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))))
index 66b64cbe53ca5ea4a96c04160083bae1808a2f92..339217d3f12a03626377bade1dc87dd6651688da 100644 (file)
@@ -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)))
index 18dff212e652a8616097d3e47408eba1226630a5..ec585919664d985040ec511fd52b99944b66dbef 100755 (executable)
@@ -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)))))