lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

* Allow for nested properties in list form when using \override.


From: joeneeman
Subject: * Allow for nested properties in list form when using \override.
Date: Sat, 22 Nov 2008 01:34:01 +0000

Reviewers: Neil Puttock,

Message:
LGTM

Description:
* Allow for nested properties in list form when using \override.
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"

Please review this at http://codereview.appspot.com/7765

Affected files:
  A input/regression/property-nested-override.ly
  M scm/ly-syntax-constructors.scm


Index: input/regression/property-nested-override.ly
diff --git a/input/regression/property-nested-override.ly b/input/regression/property-nested-override.ly
new file mode 100644
index 0000000000000000000000000000000000000000..16028b7a17391b4747a5538be8548602929d7626
--- /dev/null
+++ b/input/regression/property-nested-override.ly
@@ -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 = #1
+  c4 ~ c c\stopTextSpan
+
+  \once \override TextSpanner #'(bound-details left text) = #"foo"
+  c4\startTextSpan
+  \once \override Tie #'(details note-head-gap) = #1
+  c4 ~ c c\stopTextSpan
+}
Index: scm/ly-syntax-constructors.scm
diff --git a/scm/ly-syntax-constructors.scm b/scm/ly-syntax-constructors.scm
index 584dd6b3e17943623010c56e969c406ca94d3674..ee798233611a6a65361f1fae414962848a9f3cfa 100644
--- a/scm/ly-syntax-constructors.scm
+++ b/scm/ly-syntax-constructors.scm
@@ -143,7 +143,9 @@
                  ((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))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]