Werner LEMBERG <[email protected]> writes:
>> So we need something like
>>
>> crossStaff =
>> #(define-music-function (parser location notes) (ly:music?)
>> (_i "Create cross-staff stems")
>> #{
>> \temporary\override Stem #'cross-staff = #cross-staff-connect
>> \temporary\override Flag #'style = #'no-flag
>> $notes
>> \revert Stem #'cross-staff
>> \revert Flag #'style
>> #})
>>
>> and, as a corrollary, \temporary\whatever and \undo\whatever will be a
>> proper push/pop pair.
>
> I like the name \temporary. Is this of practical use outside of music
> functions also?
The main point is to restore to a previous state after a temporary
override. This is of course also useful in music assigned to music
variables. In the context of a larger music piece, you can, of course,
just repeat any previous overrides that you want to see reestablished,
but this is not cut&paste friendly.
Maybe \push\override ... but this has the disadvantage that you never
actively see a \pop. Hm. Maybe we should rename \undo to \pop then?
>> Opinions? It might also be possible to do
>>
>> \temporary { \override Stem #'cross-staff = #cross-staff-connect
>> \override Flag #'style = #'no-flag }
>> $notes
>
> I like that too.
It is less versatile, though.
> What about
>
> \push { Stem.cross-staff = #cross-staff-connect
> Flag.style = #'no-flag }
> $notes
> \pop { Stem.cross-staff
> Flag.style }
>
> [I'm using the `.' operator creatively; no idea whether this works,
> and no need to discuss this in case it doesn't :-)]
It doesn't. And I don't even have an awfully twisted idea how to beat
LilyPond into supporting this in any meaningful manner.
--
David Kastrup
_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel