[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/16] Let \overrideProperty accept nested properties
From: |
David Kastrup |
Subject: |
[PATCH 16/16] Let \overrideProperty accept nested properties |
Date: |
Tue, 9 Oct 2012 21:00:01 +0200 |
---
ly/music-functions-init.ly | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index ef93fab..c32645a 100644
--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -712,10 +712,10 @@ of @var{base-moment}, @var{beat-structure}, and
@var{beam-exceptions}.")
(override-time-signature-setting time-signature setting)))
overrideProperty =
-#(define-music-function (parser location name property value)
- (symbol-list? symbol? scheme?)
+#(define-music-function (parser location name property-path value)
+ (symbol-list? symbol-list-or-symbol? scheme?)
- (_i "Set @var{property} to @var{value} in all grobs named @var{name}.
+ (_i "Set @var{property-path} to @var{value} in all grobs named @var{name}.
The @var{name} argument is a symbol list of the form @code{Context.GrobName}
or @code{GrobName}.")
(if (<= 1 (length name) 2)
@@ -727,11 +727,20 @@ or @code{GrobName}.")
(if (equal?
(cdr (assoc 'name (ly:grob-property grob 'meta)))
(last name))
- (set! (ly:grob-property grob property) value))))
+ (if (symbol? property-path)
+ (ly:grob-set-property! grob property-path value)
+ (case (length property-path)
+ ((0))
+ ((1)
+ (ly:grob-set-property!
+ grob (car property-path) value))
+ (else
+ (ly:grob-set-nested-property!
+ grob property-path value)))))))
(begin
(ly:parser-error parser (_ "bad grob name") location)
(make-music 'Music))))
-
+
--
1.7.9.5
- [PATCH 08/16] Allow property and grob paths to be constructed from strings, (continued)
- [PATCH 08/16] Allow property and grob paths to be constructed from strings, David Kastrup, 2012/10/09
- [PATCH 07/16] Add symbol-list? predicate, David Kastrup, 2012/10/09
- [PATCH 05/16] Let \accidentalStyle detect its optional context argument by looking at its letter case, David Kastrup, 2012/10/09
- [PATCH 11/16] Replace the rather fuzzy list-or-symbol? with symbol-list-or-symbol?, David Kastrup, 2012/10/09
- [PATCH 13/16] Change \accidentalStyle to get a symbol list as argument, David Kastrup, 2012/10/09
- [PATCH 03/16] parser.yy: make is_regular_identifier match the lexer definition, David Kastrup, 2012/10/09
- [PATCH 14/16] convert-ly rule for \alterbroken, \accidentalStyle, \overrideProperty, David Kastrup, 2012/10/09
- [PATCH 01/16] Assignments can't contain literal lyric music (wrong lexer mode), David Kastrup, 2012/10/09
- [PATCH 04/16] Factor SCM_IDENTIFIER out from embedded_scm_arg*, David Kastrup, 2012/10/09
- [PATCH 02/16] parser.yy: FRACTION does not require a closed expression before it, David Kastrup, 2012/10/09
- [PATCH 16/16] Let \overrideProperty accept nested properties,
David Kastrup <=
- [PATCH 12/16] Make \alterBroken, \hide, \omit, \overrideProperty, \shape take unquoted Context.Grob specs, David Kastrup, 2012/10/09
- [PATCH 09/16] Allow the string "xxx.yyy" to parse as a symbol list, David Kastrup, 2012/10/09
- [PATCH 06/16] Allow LilyPond strings to stand in for symbols when parsing, David Kastrup, 2012/10/09
- [PATCH 15/16] Run scripts/auxiliar/update-with-convert-ly.sh, David Kastrup, 2012/10/09
- [PATCH 10/16] Add symbol-list-or-music? predicate, David Kastrup, 2012/10/09
- Re: Context.Grob considered as symbol list, Colin Campbell, 2012/10/09