On Thursday 16 February 2006 13.14, Thies Albrecht wrote:
> Hi everybody!
>
> To prevent having to use extensive scheme code inside my score I prefer
> to define shortcuts for often used code snippets, e.g. when setting
> ottavation on and off.
>
> In the following code example Point'n'click is turned off also IMHO I
> have only defined the shortcut without using it. Now I wonder if my way
> of defining shortcuts is okay or if I've misunderstood the documentation
> on that.

Unfortunately, the threshold for understanding how Scheme works in lilypond is 
rather high (or, at least it was for me).

As soon as a #() expression is found in a ly file, it is evaluated (this 
happens _while_ the file is parsed). So in this case, what you really want to 
store in a variable, is a _function_ which sets the option accordingly:
noPnC = #(def-music-function (parser location) (ly:set-option ...))

When \noPnC is found in the score, that function will be called, and the 
option will be set.

-- 
Erik


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to