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: Simon Albrecht
Subject: Re: Feature request: let \layout accept several \layouts stored in variables
Date: Sun, 15 Jul 2018 17:36:24 +0200

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.
Of course, I don’t have sufficient understanding to judge whether Lily has trouble discerning the order if it’s stored in variables.

Best, Simon



reply via email to

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