Reviewers: janek,
Message:
On 2012/09/26 06:14:04, janek wrote:
Do i understand correctly that grob-property-path is just a list of
properties,
like '('thickness 'gap 'color)?
Apart from overquoting (when quoting a list, its members are already
quoted), yes.
If so, i find the name misleading.
That terminology is employed in a number of places in the grammar and
code, and this patch does not invent any property but just deals
better with existing definitions and usage.
Anyway, i don't feel competent to give an "LGTM" to a Scheme patch i
don't
understand - but i had certainly not noticed anything wrong.
http://codereview.appspot.com/6544060/diff/1/ly/music-functions-init.ly
File ly/music-functions-init.ly (right):
http://codereview.appspot.com/6544060/diff/1/ly/music-functions-init.ly#newcode1073
ly/music-functions-init.ly:1073: (ly:music-property m
'grob-property-path)))))
Scheme syntax pwned me again, but i suppose this just uses either
grob-property
or grob-property-path depending on need.
Not "on need". If the property grob-property is defined, it calls
"list" on it to create a one-element list (which this code as well as
similar code elsewhere is expecting), otherwise it takes the property
grob-property-path as the source for that list.
This is the same way that lily/property-iterator.cc does it. I
consider this a rather awkward compatibility crutch (grob-property is
not used by any manually written overwrites, just by legacy Scheme
code), but it was not the scope of this patch to change that.
Description:
Get along with use of grob-property instead of grob-property-path in
overrides
LilyPond uses a willy-nilly mixture of grob-property and
grob-property-path when generating overrides programmatically (the
parser only uses grob-property-path). Several override-reinterpreting
commands and functionalities were not prepared to deal with this.
Please review this at http://codereview.appspot.com/6544060/
Affected files:
M ly/music-functions-init.ly
M scm/lily-library.scm
Index: ly/music-functions-init.ly
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index
e1dcd992e00bf66c60fa7e09e012632732fc7db6..0fa79af3ddb63acd68e1861710c29cfa6903ccf6
100644
--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -1067,11 +1067,17 @@ a context modification duplicating their effect.")
(cons* 'push
(ly:music-property m 'symbol)
(ly:music-property m 'grob-value)
- (ly:music-property m 'grob-property-path)))
+ (cond
+ ((ly:music-property m 'grob-property #f) => list)
+ (else
+ (ly:music-property m 'grob-property-path)))))
((RevertProperty)
(cons* 'pop
(ly:music-property m 'symbol)
- (ly:music-property m 'grob-property-path)))))
+ (cond
+ ((ly:music-property m 'grob-property #f) => list)
+ (else
+ (ly:music-property m 'grob-property-path)))))))
(case (ly:music-property m 'name)
((ApplyContext)
(ly:add-context-mod mods
Index: scm/lily-library.scm
diff --git a/scm/lily-library.scm b/scm/lily-library.scm
index
ec1097a32b7ace1ae756e86f61fd5fa08f6cffd7..854980012cea5d3da40df5b955bfde86c4e87a97
100644
--- a/scm/lily-library.scm
+++ b/scm/lily-library.scm
@@ -275,11 +275,17 @@ bookoutput function"
(cons* 'push
symbol
(ly:music-property m 'grob-value)
- (ly:music-property m 'grob-property-path)))
- ((RevertProperty)
+ (cond
+ ((ly:music-property m 'grob-property #f) => list)
+ (else
+ (ly:music-property m 'grob-property-path)))))
+ ((RevertProperty)
(cons* 'pop
symbol
- (ly:music-property m 'grob-property-path))))))
+ (cond
+ ((ly:music-property m 'grob-property #f) => list)
+ (else
+ (ly:music-property m 'grob-property-path))))))))
(case (ly:music-property m 'name)
((ApplyContext)
(ly:add-context-mod mods
@@ -326,11 +332,17 @@ bookoutput function"
(cons* 'push
(ly:music-property m 'symbol)
(ly:music-property m 'grob-value)
- (ly:music-property m 'grob-property-path)))
+ (cond
+ ((ly:music-property m 'grob-property #f) => list)
+ (else
+ (ly:music-property m 'grob-property-path)))))
((RevertProperty)
(cons* 'pop
(ly:music-property m 'symbol)
- (ly:music-property m 'grob-property-path)))))
+ (cond
+ ((ly:music-property m 'grob-property #f) => list)
+ (else
+ (ly:music-property m 'grob-property-path)))))))
(case (ly:music-property m 'name)
((ApplyContext)
(ly:add-context-mod mods
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel