lilypond-user
[Top][All Lists]
Advanced

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

Re: conditional when-property function not working as intended


From: David Kastrup
Subject: Re: conditional when-property function not working as intended
Date: Thu, 15 Sep 2016 17:46:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Kieren MacMillan <address@hidden> writes:

> Hello all,
>
> In the snippet included below, I’m hoping the second line of the 
> scoreTitleMarkup will take no vertical space. If you comment out that line, 
> you’ll see that it *does* take no space, but when it’s included, so is the 
> 25mm spacing that is [I thought] conditional on the presence of a ‘testB’ 
> property in the property.
>
> Where is my code going wrong?
> More precisely, how can I make it work as intended?  =)
>
> Thanks,
> Kieren.
>
> %%%%  SNIPPET BEGINS
> \version "2.19.46"
>
> #(define-markup-command (when-property layout props symbol markp) (symbol? 
> markup?)
>   (if (chain-assoc-get layout props symbol markp)
>       (interpret-markup layout props markp)
>       empty-stencil))

 -- Function: ly:chain-assoc-get key achain default-value
          strict-checking
     Return value for KEY from a list of alists ACHAIN.  If no entry is
     found, return DEFAULT-VALUE or ‘#f’ if DEFAULT-VALUE is not
     specified.  [...]

DEFAULT-VALUE is specified as markp, and a markup is never #f.  So your
condition is always true when the specified KEY cannot be found.

-- 
David Kastrup



reply via email to

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