Re: conditional when-property function not working as intended

2016-09-16 Thread Kieren MacMillan
Hi David, > But we are not talking about music functions (where the quite different > "parser location" arguments are now usually passed implicitly) but > markup commands here. Ah! That would be the source of my confusion. Thank you, Kieren. Kieren MacMillan, co

Re: conditional when-property function not working as intended

2016-09-16 Thread Kieren MacMillan
Hi David, > By not specifying a default value? I have absolutely no idea why you > put `markp' as the default-value of your call to ly:chain-assoc-get. Because this is somebody else’s code that I’m using, without (obviously) fully understanding what it does. With your hint, I believe I can now

Re: conditional when-property function not working as intended

2016-09-16 Thread David Kastrup
Kieren MacMillan writes: > Hi David, > >> It's necessary for functions taking "layout props" arguments? Where >> would that cause reason for doubt? > > I thought I recalled a recent update (say, in the past 2 years) in > which those arguments were rendered unnecessary when writing certain > musi

Re: conditional when-property function not working as intended

2016-09-16 Thread David Kastrup
Kieren MacMillan writes: > Hi David, > > Thank you for the helpful reply and documentation/explanation. > >> -- 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-

Re: conditional when-property function not working as intended

2016-09-16 Thread Kieren MacMillan
Hi David, Thank you for the helpful reply and documentation/explanation. > -- 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

Re: conditional when-property function not working as intended

2016-09-16 Thread Kieren MacMillan
Hi David, > It's necessary for functions taking "layout props" arguments? Where > would that cause reason for doubt? I thought I recalled a recent update (say, in the past 2 years) in which those arguments were rendered unnecessary when writing certain music functions — but apparently, I’m mis

Re: conditional when-property function not working as intended

2016-09-15 Thread David Kastrup
Kieren MacMillan writes: > Hi all, > > Solved my own problem (I think?): the modified version (below) appears to > work as expected. > > On a related topic: I [clearly] don’t understand when “layout props” > is necessary, and when it’s not. It's necessary for functions taking "layout props" arg

Re: conditional when-property function not working as intended

2016-09-15 Thread David Kastrup
Kieren MacMillan 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 though

Re: conditional when-property function not working as intended

2016-09-15 Thread Kieren MacMillan
Hi all, Solved my own problem (I think?): the modified version (below) appears to work as expected. On a related topic: I [clearly] don’t understand when “layout props” is necessary, and when it’s not. Is this explained in the docs somewhere? Thanks, Kieren. SNIPPET BEGINS \version "2.1

conditional when-property function not working as intended

2016-09-15 Thread Kieren MacMillan
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 ‘t

Re: conditional \when-property

2013-07-31 Thread Kieren MacMillan
Hi David, > the ly:make-stencil in your function is unneccesary. All you need to do is > the following: > > #(define-markup-command (when-property layout props symbol markp) (symbol? > markup?) > (if (chain-assoc-get symbol props) > (interpret-markup layout props markp) > empty-

Re: conditional \when-property

2013-07-31 Thread David Nalesnik
Hi Kieren, On Wed, Jul 31, 2013 at 5:59 PM, Kieren MacMillan < kieren_macmil...@sympatico.ca> wrote: > Hi David, > > > Using empty-stencil rather than your own call of ly:make-stencil should > > work for more versions. > > This sounds useful… but I don't quite know what you are suggesting I do.

Re: conditional \when-property

2013-07-31 Thread Kieren MacMillan
Hi David, > Using empty-stencil rather than your own call of ly:make-stencil should > work for more versions. This sounds useful… but I don't quite know what you are suggesting I do. Do you mean this (which appears to work, but still uses ly:make-stencil): #(define-markup-command (when-property

Re: conditional \when-property

2013-07-30 Thread David Kastrup
Kieren MacMillan writes: > Hi all, > > Found the correct solution (I think): > > #(define-markup-command (when-property layout props symbol markp) (symbol? > markup?) > (if (chain-assoc-get symbol props) > (interpret-markup layout props markp) > (ly:make-stencil '() empty-interval emp

Re: conditional \when-property

2013-07-30 Thread Kieren MacMillan
Hi all, Found the correct solution (I think): #(define-markup-command (when-property layout props symbol markp) (symbol? markup?) (if (chain-assoc-get symbol props) (interpret-markup layout props markp) (ly:make-stencil '() empty-interval empty-interval))) At least that *seems* to do

conditional \when-property

2013-07-30 Thread Kieren MacMillan
Hello all, This \when-property function (whence I found it, I can't remember) clearly doesn't work as expected: \version "2.17" #(define-markup-command (when-property layout props symbol markp) (symbol? markup?) (if (chain-assoc-get symbol props) (interpret-markup layout props markp)