lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Provide an \un function for turning overrides and sets into reverts


From: David Kastrup
Subject: Re: Provide an \un function for turning overrides and sets into reverts and unsets (issue 6588067)
Date: Sat, 06 Oct 2012 11:15:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Janek Warchoł <address@hidden> writes:

> On Sat, Oct 6, 2012 at 10:50 AM, David Kastrup <address@hidden> wrote:
>>
>>> Are there any limitations?  For example,
>>> would \un\clef and \un\key result in
>>> - reverting to previous clef/key
>>> - something strange
>>> - syntax error
>>
>> Something strange is most likely.  \set does not really maintain a
>> stack, so \unset just kills the context-dependent value.
>
> Something strange happened, indeed. This:
> {
>   \key a \major \clef F
>   cis dis c e
>   \un\key a\major \un\clef F
>   cis fis c e
> }
> produced a treble clef glyph (but it didn't affect notnotese
> positions) and accidentals that were still in a major.
> Also, i couldn't just write \un\key nor \un\clef.

Huh?  \key is not a music expression on its own, neither is \clef.

> I think it would be good to polish this, so that this either works or
> always produces syntax error.

If we produce an error for music harvested for overrides that have more
effects than just the override, something like
\midi { \tempo 4 = 60 }
would have to be prohibited as well since it silently drops markup.

You'll have similar problems using \once on commands like that.
Figuring out heuristics when or when one should not issue a warning is
not all that easy to decide with a reasonable amount of consistency, and
this is not a problem particular to \undo.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]