]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 2997/2: Let \tweak deal with nested properties
authorDavid Kastrup <dak@gnu.org>
Sat, 24 Nov 2012 20:04:21 +0000 (21:04 +0100)
committerDavid Kastrup <dak@gnu.org>
Fri, 30 Nov 2012 12:37:33 +0000 (13:37 +0100)
ly/music-functions-init.ly

index a6a91174ff531e074763fe67a6aac44dd5c1369d..bf06d407222d3fd2952caaf6eeb6d46c992668b9 100644 (file)
@@ -1352,18 +1352,21 @@ are affected.
 As a special case, @var{item} may be a symbol list specifying a grob
 path, in which case @code{\\once\\override} is called on it instead of
 creating tweaked music.  This is mainly useful when using
-@code{\\tweak} as as a component for building other functions.")
+@code{\\tweak} as as a component for building other functions.
+
+@var{prop} can contain additional elements in which case a nested
+property (inside of an alist) is tweaked.")
    (if (ly:music? item)
        (let ((p (check-grob-path prop parser location
                                  #:start 1
                                  #:default #t
-                                 #:min 2
-                                 #:max 2)))
+                                 #:min 2)))
          (if p
              (set! (ly:music-property item 'tweaks)
-                   (acons (if (eq? (car p) #t)
-                              (cadr p)
-                              (cons (car p) (cadr p)))
+                   (acons (cond ((pair? (cddr p)) p)
+                                ((symbol? (car p))
+                                 (cons (car p) (cadr p)))
+                                (else (cadr p)))
                           value
                           (ly:music-property item 'tweaks))))
          item)