]> git.donarmstrong.com Git - lilypond.git/commitdiff
Allow for nested properties in list form when using \override.
authorNeil Puttock <n.puttock@gmail.com>
Sat, 22 Nov 2008 17:03:20 +0000 (17:03 +0000)
committerNeil Puttock <n.puttock@gmail.com>
Sat, 22 Nov 2008 17:03:20 +0000 (17:03 +0000)
This patch provides a convenient way of overriding nested properties,
matching the syntax available when using \revert, e.g.,

 \override DynamicTextSpanner #'(bound-details left text) = #"foo"

input/regression/property-nested-override.ly [new file with mode: 0644]
scm/ly-syntax-constructors.scm

diff --git a/input/regression/property-nested-override.ly b/input/regression/property-nested-override.ly
new file mode 100644 (file)
index 0000000..710822b
--- /dev/null
@@ -0,0 +1,20 @@
+\version "2.11.64"
+\header {
+  texidoc = "Nested properties may be overridden using Scheme list
+syntax.  This test performs two property overrides: the first
+measure uses standard @code{\\override} syntax; the second uses a
+list.
+"
+}
+
+\relative c' {
+  \once \override TextSpanner #'bound-details #'left #'text = #"foo"
+  c4\startTextSpan
+  \once \override Tie #'details #'note-head-gap = #3
+  c4 ~ c c\stopTextSpan
+  
+  \once \override TextSpanner #'(bound-details left text) = #"foo"
+  c4\startTextSpan
+  \once \override Tie #'(details note-head-gap) = #3
+  c4 ~ c c\stopTextSpan
+}
index 584dd6b3e17943623010c56e969c406ca94d3674..ee798233611a6a65361f1fae414962848a9f3cfa 100644 (file)
                  ((PropertySet) (list 'value (car args)))
                  ((PropertyUnset) '())
                  ((OverrideProperty) (list 'grob-value (car args)
-                                           'grob-property-path (cdr args)
+                                           'grob-property-path (if (list? (cadr args))
+                                                                   (cadr args)
+                                                                   (cdr args))
                                            'pop-first #t))
                  ((RevertProperty)
                   (if (list? (car args))