lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme help request: How can else of an if-statement be made to do n


From: David Kastrup
Subject: Re: Scheme help request: How can else of an if-statement be made to do nothing?
Date: Sat, 17 Oct 2020 20:33:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Thomas Morley <thomasmorley65@gmail.com> writes:

> Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra 
> <jean@abou-samra.fr>:
>>
>> The point of interpret-markup is to turn a markup into a stencil, so I'd
>> use empty-stencil:
>>
>> \version "2.20.0"
>>
>> #(define-markup-command (print-if-defined layout props sym text)
>>                          (symbol? markup?)
>>    (if (defined? sym)
>>        (interpret-markup layout props
>>          #{ \markup \with-color #'(0.8 0.2 0.2) #text #})
>>        empty-stencil))
>>
>> symA = "Something"
>>
>> \markup {
>>    \print-if-defined #'symA "Text"
>>    \print-if-defined #'symB "More text"
>> }
>>
>
> An empty stencil will still be spaced (unless removed by other
> markup-commands).

empty-stencil will typically not trigger additional spacing.  That's
typically what distinguishes it from point-stencil .

-- 
David Kastrup



reply via email to

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