On 1/24/11 4:55 PM, "Neil Puttock" <n.putt...@gmail.com> wrote:
> On 24 January 2011 17:30, James Lowe <james.l...@datacore.com> wrote:
>
>> So I wondered if it is possible to save some lines of code/simplify
>> overrides for the same context/Grob such that I can write 'something like'
>>
>> \override context.GrobName ( ( #'property1 = #value1) (#'property2 =
>> #value2) (#'property3 = #value3) )
>
> Here's an idea:
>
> overrideGrobProps =
> #(define-music-function (parser location grob-name prop-list) (symbol?
> cheap-list?)
> (make-sequential-music
> (map (lambda (entry)
> (make-grob-property-override grob-name (car entry) (cadr entry)))
> prop-list)))
>
> \relative c' {
> c4 cis d des
> % apply \override to list of properties + values (not \once)
> \overrideGrobProps #'Accidental #`((color ,red) (font-size 4)
> (extra-offset (1.5 . 3)))
If you use pairs, instead of lists, for the property overrides then the
override list is a standard alist:
\overrideGrobProps #'Accidental #`((color . ,red) (font-size . 4)
(extra-offset . (1.5 . 3)))
Seems like this might be able to be implemented in core LilyPond, but it's a
GLISS topic, I think.
Great idea!
Carl
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel