]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 2953: Teach \displayLilyMusic the recommended override/revert syntax
authorDavid Kastrup <dak@gnu.org>
Wed, 7 Nov 2012 12:02:09 +0000 (13:02 +0100)
committerDavid Kastrup <dak@gnu.org>
Wed, 7 Nov 2012 18:59:36 +0000 (19:59 +0100)
This is a followup to the large issue 2934 change.

scm/define-music-display-methods.scm
scm/display-lily.scm

index 9631da734ddd6ad0d6e3389ec2fb5683b9b5a10f..e429c92b6fcf0e3b641e321d0319b4dd9b143305 100644 (file)
@@ -848,33 +848,25 @@ Otherwise, return #f."
         (value   (ly:music-property expr 'grob-value))
         (once    (ly:music-property expr 'once)))
 
-    (format #f "~a\\override ~a~a #'~a = ~a~a"
+    (format #f "~a\\override ~{~a~^.~} = ~a~a"
            (if (or (null? once)
                    (not once))
                ""
                "\\once ")
-           (if (eqv? (*current-context*) 'Bottom)
-               ""
-               (format #f "~a . " (*current-context*)))
-           symbol
-           (if (null? (cdr properties))
-               (car properties)
-               properties)
-           (property-value->lily-string value parser)
+            (if (eqv? (*current-context*) 'Bottom)
+                (cons symbol properties)
+                (cons* (*current-context*) symbol properties))
+            (property-value->lily-string value parser)
            (new-line->lily-string))))
 
 (define-display-method RevertProperty (expr parser)
   (let* ((symbol (ly:music-property expr 'symbol))
          (properties (ly:music-property expr 'grob-property-path
                                              (list (ly:music-property expr 'grob-property)))))
-    (format #f "\\revert ~a~a #'~a~a"
-           (if (eqv? (*current-context*) 'Bottom)
-               ""
-               (format #f "~a . " (*current-context*)))
-           symbol
-           (if (null? (cdr properties))
-               (car properties)
-               properties)
+    (format #f "\\revert ~{~a~^.~}~a"
+            (if (eqv? (*current-context*) 'Bottom)
+                (cons symbol properties)
+                (cons* (*current-context*) symbol properties))
            (new-line->lily-string))))
 
 (define-display-method TimeSignatureMusic (expr parser)
index 3348434da33ddb987314240737a01c6034bef57f..55c9f9f135f784428398efad1317ce36131da623 100644 (file)
@@ -87,7 +87,7 @@ display method will be called."
                         (if (pair? (car tweak))
                             (format #f "~a.~a"
                                     (caar tweak) (cdar tweak))
-                            (format #f "#'~a" (car tweak)))
+                            (format #f "~a" (car tweak)))
                          (scheme-expr->lily-string (cdr tweak))))
                (ly:music-property expr 'tweaks))))