lilypond-user
[Top][All Lists]
Advanced

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

Re: ly:add-option behaviour


From: David Kastrup
Subject: Re: ly:add-option behaviour
Date: Mon, 08 Aug 2016 16:30:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Am 08.08.2016 um 15:53 schrieb David Kastrup:
>> Urs Liska <address@hidden> writes:
>>
>>> I'm wondering about the behaviour of ly:add-option
>>>
>>> If I have the following file:
>>>
>>> \version "2.19.47"
>>>
>>> #(ly:add-option 'humdrum-file #f "Set to the file name of a Humdrum file")
>>>
>>> #(display (ly:get-option 'humdrum-file))
>>>
>>> and invoke LilyPond with the command line option -dmy-option=my-value
>>>
>>> The display is #f or whatever I set as default value in ly:add-option.
>>>
>>> If I comment out the ly:add-option line I get the correct value
>>> displayed but also a warning "no such internal option: my-option".
>>>
>>> I thought I could use that line to suppress the warning and preset the
>>> option with a default value that it will have when the option isn't
>>> passed on the command line. But I have the impression that ly:add-option
>>> *overwrites* any value passed through the command line.
>>>
>>> What am I missing?
>> ly:add-option takes effect too late to be of any use except in
>> LilyPond's initialization phase.
>>
>
> That means ly:add-option is of no use in user files?

I don't really think so.  If you process several user files on the
command line, earlier files can likely define options that later files
can then use.  But that does not seem overly useful.

And if you add an option with ly:add-option, you may set it later with
ly:set-option.  But why use the option interface at all then?

-- 
David Kastrup



reply via email to

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