lilypond-user
[Top][All Lists]
Advanced

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

Re: Header fields in custom footer


From: Thomas Morley
Subject: Re: Header fields in custom footer
Date: Thu, 1 Dec 2016 11:00:07 +0100

2016-11-30 23:31 GMT+01:00 Noeck <address@hidden>:
> Hi,
>
> I have one more question on this topic:
>
> How can I check whether a header field is present at all?
> (Or my main goal: how can I avoid that the code fails?)
>
> This works:
> \version "2.19.50"
> \header {
>   title = "ABC"
> }
> \paper {
>   oddFooterMarkup = #(module-ref $defaultheader 'title)
> }
> { a }
>
>
> This does not for obvious reasons:
> oddFooterMarkup = #(module-ref $defaultheader 'maintainer)
>
>
> Instead of putting all possible headers in a default header like
> maintainer = ##f
> I would like to check the presence, sth like this pseudocode:
>
> oddFooterMarkup = #(if (in? 'maintainer $defaultheader)
>        (module-ref $defaultheader 'maintainer)
>        "")
>
> Cheers,
> Joram
>
>

Hi Joram,

we have ly:modules-lookup with a possible optional argument. Resulting in:

(ly:modules-lookup (list $defaultheader) 'foo "xy")

If foo is found its value is returned otherwise "xy"

HTH,
  Harm



reply via email to

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