Johan Vromans <jvrom...@squirrel.nl> writes:

> David Kastrup <d...@gnu.org> writes:
>
>> For such fixed override/revert pairings you should write
>> \temporary\override in the music function instead of just \override:
>> otherwise any previous \override NoteHead.color = #blue will get
>> overwritten and not get restored afterwards.
>
> You mean this will not work:
>
>   \override NoteHead.color = #blue
>   ...blue music...
>   \override NoteHead.color = #red
>   ...red music...
>   \revert NoteHead.color
>   ...blue music...
>   \revert NoteHead.color
>   ...boring music...

Correct.  In stack terms, \revert is a "pop" while "\override" is "pop,
push" (each context has its own stack).  In contrast,
"\temporary\override" is just "push".  So a sequence of

\temporary\override
\override
\override
\override
\revert

on the same property leaves it in the original state.

-- 
David Kastrup


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to