lilypond-user
[Top][All Lists]
Advanced

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

Re: Function operating on header


From: Noeck
Subject: Re: Function operating on header
Date: Sat, 14 Mar 2020 20:14:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Hi,

Am 13.03.20 um 20:36 schrieb Noeck:
>> Finally, \fromproperty is important as it defers the evaluation of the
>> property.  Using \title would give you the current value whereas
>> \fromproperty #'header:title can accommodate changes to the property.
> And that’s exactly why \fromproperty is the wrong tool for me here as I
> want to change the header fields based on what is there now not later.

I spoke too soon here. It would actually be nice to put the includes first.
Can I use fromproperty also in Scheme code? Or does the late evaluation
contradict with the usage in Scheme?

So I did another try and used the footer markup, but I can't use
fromproperty in Scheme code. This is what I tried:

\version "2.20.0"

\header { title = "Title" }
\paper {
  oddFooterMarkup = \markup \fill-line {
    \null
    #(if
      (string-null? (markup->string #{
        \markup \fromproperty 'header:license #}))
      #{ \markup \with-url
         #(string-append "http://url/"; (markup->string #{
           \markup \fromproperty 'header:license #}) "/4.0")
         \fromproperty 'header:license #} "")
    % the lines above should finally produce this if license is defined:
    % \with-url "http://url/cc by-sa/4.0" "cc by-sa"
    \null
  }
}

\header {
  license = "cc by-sa"
}

{ b }

Cheers,
Joram



reply via email to

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