2016-11-30 23:31 GMT+01:00 Noeck <noeck.marb...@gmx.de>: > 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 _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user