Urs Liska <u...@openlilylib.org> writes:

> Am 18.01.2016 um 11:31 schrieb Urs Liska:
>> I have created a new boolean context property by
>> - adding an entry in define-context-properties.scm
>> - setting the default in engraver-init.ly
>> - retrieving it in a class's (Beaming_option) from_context method
>>
>> However, I would like to add another context property (and modify the
>> added one) from boolean to accepting one out of a list of symbols.
>> Skimming the source code I couldn't really find how I achieve that.
>>
>> I assume that I have to define a custom predicate for my property that
>> throws an (which?) error the argument is not in the list of accepted
>> symbols.
>> Is that right? And if so, where should I define that?
>
> I have now managed to handle what I need by adding a Scheme predicate
> and a C++ enum.
>
> However, I am quite sure that they are not implemented at appropriate
> locations:
>
> The Scheme predicate at the top of define-context-properties.scm
> The C++ enum directly in the .hh file where it is used.
>
> Where should I put them?

Where the rest are.  I think generally they are to be found in c++.scm
and described in lily.scm.

One note: #f is always allowed as a value for properties.  It's just #t
that would require special permission from the predicate.

-- 
David Kastrup

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

Reply via email to