Harm, You used a function or macro called add-text. I can't seem to find it in any LilyPond or Guile manual. What is that?
John > -----Original Message----- > From: lilypond-user [mailto:lilypond-user- > bounces+jschlomann=wideopenwest....@gnu.org] On Behalf Of Thomas > Morley > Sent: Saturday, October 17, 2020 2:24 PM > To: David Kastrup > Cc: Jean Abou Samra; Matthew Fong; lilypond-user > Subject: Re: Scheme help request: How can else of an if-statement be made > to do nothing? > > Am Sa., 17. Okt. 2020 um 20:33 Uhr schrieb David Kastrup <d...@gnu.org>: > > > > Thomas Morley <thomasmorle...@gmail.com> writes: > > > > > Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra > <j...@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 > > Well, I'd say it depends how that empty-stencil is consumed. See: > > \markup > \box > { \stencil #point-stencil \stencil #empty-stencil \stencil #point-stencil } > > Here I did something silly (of course there are warnings emitted) and > the output _is_ affected. > > Thus, the detailed use-case is important... > > Cheers, > Harm