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.


_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to