bug-lilypond
[Top][All Lists]
Advanced

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

Re: Feature request: let \layout accept several \layouts stored in varia


From: Urs Liska
Subject: Re: Feature request: let \layout accept several \layouts stored in variables
Date: Sun, 15 Jul 2018 17:41:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0



Am 15.07.2018 um 17:36 schrieb Simon Albrecht:
On 15.07.2018 16:48, David Kastrup wrote:
What?  Being able to specify two conflicting \layout definitions at once
and having LilyPond magically merge them by guessing correctly how the
user wants every conflict to be resolved?

Magic is always a great thing to wish for.  Until it does stuff you
actually did not intend it to do.

That’s not what the request was about. Lily already merges subsequent toplevel layout definitions, IIUC simply following the order at which they are encountered, and why shouldn’t the same be possible inside one layout block?

This works just as expected:

%%%%%%%%%%%%%%%%%%%%
\version "2.19.82"

\score {
  { c'8 }
  \layout {
    \context {
      \Voice
      \override NoteHead.color = #red
    }
    \context {
      \Voice
      \omit Flag
      \override NoteHead.color = #green
    }
  }
}
%%%%%%%%%%%%%%%%%%%%

and IIUC the request asks for this

%%%%%%%%%%%%%%%%%%%%
\version "2.19.82"

redhead = \layout {
  \context {
    \Voice
    \override NoteHead.color = #red
  }
}
greenhead = \layout {
  \context {
    \Voice
    \omit Flag
    \override NoteHead.color = #green
  }
}
\score {
  { c'8 }
  \layout {
    \redhead
    \greenhead
  }
}
%%%%%%%%%%%%%%%%

to be treated exactly the same instead of discarding \greenhead.

I think it's more about something like

%%%%%%%%%%%%%%%%%%%%
\version "2.19.82"

redhead = \layout {
  \context {
    \Voice
    \override NoteHead.color = #red
  }
}
greenbeam = \layout {
  \context {
    \Voice
    \override Beam.color = #green
  }
}
\score {
  { c'8 }
  \layout {
    \redhead
    \greenbeam
  }
}
%%%%%%%%%%%%%%%%

to produce red note heads and green beams.




reply via email to

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