On 2012-10-14 01:07, Joseph Rushton Wakeling wrote:
On 10/13/2012 11:44 PM, David Kastrup wrote:
\once creates a one-time-step temporary change, \temporary an
unterminated temporary change which can be terminated element-wise with
\revert or, again using a converter, en bloc from the original overrides
with \undo.
Forgive me for coming into this without the background, but what's the
difference between \temporary and the existing \override?
\temporary\override would work the way you probably expect \override to
work now:
It sets the grob property to a new value and keeps the old value stored
so that after \revert the property takes the old value it had before the
\temporary\override.
The actual problem is that \override currently CLEARS (i.e. reverts) the
current value before setting the new one, so that the old value is not
stored anywhere any more, and a \revert thus reverts to the default value.
As an example, let's look at the following code. What color would you
expect the final "b" to have? red? (because the \revert clears the
previous override to blue, right?)
\version "2.16.0"
\relative c' {
c4
\override NoteHead #'color = #red
f
\override NoteHead #'color = #blue
g
\revert NoteHead #'color
b
}
In reality, the \revert does not revert the override, but completely
clear the value to the black default. Currently, there is no way to
temporarily change a property and then change it back to its previous
value (except for \once\override, which only works for one timestep).
In fact, \override and \revert are currently misnamed, they work more
like \set and \unset.
Cheers,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, reinh...@kainhofer.com, http://www.kainhofer.com
* Financial & Actuarial Math., Vienna Univ. of Technology, Austria
* http://www.fam.tuwien.ac.at/, DVR: 0005886
* Edition Kainhofer, Music Publisher, http://www.edition-kainhofer.com
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel