]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #306.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 21 Feb 2007 13:59:41 +0000 (14:59 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 21 Feb 2007 13:59:41 +0000 (14:59 +0100)
Inspect 'point-and-click in output-scm; don't redefine mark_URI.

scm/framework-ps.scm
scm/output-ps.scm

index f2eb8fa11345b103a2003fae48bda3a02704030a..a5fd02fb1c21136449ea8aaa480b7c00cf84c479 100644 (file)
   (display (procset "music-drawing-routines.ps") port)
   (display (procset "lilyponddefs.ps") port)
 
-  (if (not (ly:get-option 'point-and-click))
-      (display "/mark_URI { pop pop pop pop pop } bind def\n" port)) 
-
   (display "%%EndProlog\n" port)
   
   (display "%%BeginSetup\ninit-lilypond-parameters\n%%EndSetup\n\n" port))
index 46eb2ed892ce93d7f4761e1b02d0152572106947..11e2190286434c18c0436048e8635eb9998a7ef7 100644 (file)
 
 
 (define (grob-cause offset grob)
-  (let* ((cause (ly:grob-property grob 'cause))
-        (music-origin (if (ly:stream-event? cause)
-                          (ly:event-property cause 'origin))))
-    (if (not (ly:input-location? music-origin))
-       ""
-       (let* ((location (ly:input-file-line-char-column music-origin))
-              (raw-file (car location))
-              (file (if (is-absolute? raw-file)
-                        raw-file
-                        (string-append (ly-getcwd) "/" raw-file)))
-              (x-ext (ly:grob-extent grob grob X))
-              (y-ext (ly:grob-extent grob grob Y)))
-
-         (if (and (< 0 (interval-length x-ext))
-                  (< 0 (interval-length y-ext)))
-             (ly:format "~4f ~4f ~4f ~4f (textedit://~a:~a:~a:~a) mark_URI\n"
-                        (+ (car offset) (car x-ext))
-                        (+ (cdr offset) (car y-ext))
-                        (+ (car offset) (cdr x-ext))
-                        (+ (cdr offset) (cdr y-ext))
-
-                        ;; TODO
-                        ;;full escaping.
-
-                        ;; backslash is interpreted by GS.
-                        (ly:string-substitute "\\" "/" 
-                                              (ly:string-substitute " " "%20" file))
-                        (cadr location)
-                        (caddr location)
-                        (cadddr location))
-             "")))))
-
+  (if (ly:get-option 'point-and-click)
+      (let* ((cause (ly:grob-property grob 'cause))
+            (music-origin (if (ly:stream-event? cause)
+                              (ly:event-property cause 'origin))))
+       (if (ly:input-location? music-origin)
+           (let* ((location (ly:input-file-line-char-column music-origin))
+                  (raw-file (car location))
+                  (file (if (is-absolute? raw-file)
+                            raw-file
+                            (string-append (ly-getcwd) "/" raw-file)))
+                  (x-ext (ly:grob-extent grob grob X))
+                  (y-ext (ly:grob-extent grob grob Y)))
+
+             (if (and (< 0 (interval-length x-ext))
+                      (< 0 (interval-length y-ext)))
+                 (ly:format "~4f ~4f ~4f ~4f (textedit://~a:~a:~a:~a) mark_URI\n"
+                            (+ (car offset) (car x-ext))
+                            (+ (cdr offset) (car y-ext))
+                            (+ (car offset) (cdr x-ext))
+                            (+ (cdr offset) (cdr y-ext))
+
+                            ;; TODO
+                            ;;full escaping.
+
+                            ;; backslash is interpreted by GS.
+                            (ly:string-substitute "\\" "/" 
+                                                  (ly:string-substitute " " "%20" file))
+                            (cadr location)
+                            (caddr location)
+                            (cadddr location))
+                 ""))
+           ""))
+      ""))
 
 (define (named-glyph font glyph)
   (ly:format "~a /~a glyphshow " ;;Why is there a space at the end?