lilypond-devel
[Top][All Lists]
Advanced

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

Re: Overrides and nesting: intentional?


From: Jan Warchoł
Subject: Re: Overrides and nesting: intentional?
Date: Sat, 6 Aug 2011 11:02:26 +0200

2011/8/5 David Kastrup <address@hidden>:
>
> On the hopefully correct assumption that this was intended to go to the
> list and just mistakenly sent in private

Yes, i occasionally misclick the button.  Thanks!

> I think that originally \override was a push, \revert was a pop, and
> \once\override was a push/pop pair (that's more or less what is in the
> user docs as well).
>
> Then somebody probably thought that \override\override\revert should be
> a nop since \override has to be used instead of \set anyway (which would
> not push), and turned \override into a pop-push pair (pop never goes
> beyond the current context, so "little harm done").  That explains why
> the first example pairs the pop from the \once\override with the push
> from \override.  In the first example, the \override should, when
> cancelling the push from \once\override, not leave the corresponding pop
> lying around to be executed later.
>
> Now take that incoherent mess, and add nested properties into it.
> Apparently the current code has no qualms to start an \override with a
> pop that will cancel an entirely unrelated operation.
>
> Now if we do something like (never mind the value and the syntax)
> \override a.b.c  \override a
> should the second \override be able to cancel the first one with its
> implied \revert at its front?  How about if we do
> \override a  \override a.b.c
> instead?  Should the second override be able to cancel the first one?
> Only partially?  What if we now do
> \override a \override a.b.c \override a
> How many \revert a should we need to have the stack empty again?  If we
> do
> \override a \override a.b.c \revert a.b.c
> what should the state of a.whatever be?  Changed against before or not?
> What should the state of a.b.c be?  Changed against before (to the value
> set by \override a) or not?

I'm not sure if i understand it (is "a" a property or a value?), but
it seems to me that \override should indeed not begin with a revert.
However, we may need additional command like
\revertTillDefaultIsReached or sth like that.

Going back to your colorful examples, here's what effects i'd expect:

\relative c' {
    c4
    \once\override Stem #'color = #red
    \override Stem #'color = #blue
    c4 c
    \revert Stem #'color
    c4
}

black blue blue black

\relative c' {
    c4
    \override Stem #'color = #blue
    \once\override Stem #'color = #red
    c4 c
    \revert Stem #'color
    c4
}

black red blue black

\relative c' {
    c4
    \override Stem #'color = #blue
    \once\override Stem #'color = #red
    \revert Stem #'color
    c4 c
    c4
}

black black black black.

cheers,
Janek



reply via email to

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