From: Peter Toye <lilyp...@ptoye.com>
Reply-To: Peter Toye <lilyp...@ptoye.com>
Date: Friday, November 29, 2019 at 5:58 AM
To: <lilypond-user@gnu.org>
Subject: A question about override in markuplist

Peter,

Thank you for asking this question.  It is good for us to have relatively new 
users let us know what things are confusing, so we can try to improve them.

I'm a bit confused by he documentation concerning  \override. In most of the LR 
and NR it is described as a LilyPond command which changes the value of a 
property.

This is correct. \override changes the value of Grob properties and \markup 
properties (but not Context properties, which are changed with \set, as 
described in the Learning Manual).


However, it also seems to appear as a special function within a \markup which 
adds, as opposed to changes, a property.value pair to the property list (which 
one isn't explicitly stated, but it can presumably be inferred from the 
context). Presumably the property value is removed from the list after the 
markup argument has been evaluated, so there is no need for a \revert command.

The property list is an argument to the \markup function (which applies to only 
a specific markup), rather than a property of a Grob, so it doesn’t affect 
anything other than the specific markup.

When Context properties are \set, they affect every item in the Context.

When Grob properties are \override(n), all Grobs of that type at the current 
moment (and forward, unless there is a \once) are affected.

When \markup properties are \override(n), only that specific markup is affected.

The Notation Reference appendices A.10 and A.11 list the properties used by 
each \markup command.  Any properties not used by a \markup command will be 
ignored if they are added to the property list by the use of \override.  Any 
required properties not found in the property list will be given default values 
as described in the Notation Reference appendices.

To sum up, am I right in thinking that within a \markup, the function 
supersedes the command?

I hope my explanation above answers this question.

I have to say, this does not feel like good program design. One does not 
usually have two built-in operators with the same name and different scopes. :)


I think it’s good program design.  It’s not unlike overloading the “+” operator 
such that it can both add integers and concatenate strings.

I think our documentation of the use of \markup properties could be made 
clearer.   One has to jump between multiple books to see how this works.

Thanks,

Carl

Reply via email to