lilypond-devel
[Top][All Lists]
Advanced

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

Re: Issue 1650: Multiple header blocks shall be merged rather than repla


From: reinhold . kainhofer
Subject: Re: Issue 1650: Multiple header blocks shall be merged rather than replace a previous one (issue 6441058)
Date: Fri, 27 Jul 2012 11:02:16 +0000

Reviewers: dak,

Message:
On 2012/07/27 05:10:50, dak wrote:
> I think this is the wrong way to do things since you can't refer to
old header
> values when defining the new one.  Instead, you should start with
the
definition
> you are adding things to, like LAYOUT and similar do.  So that
likely means
that
> you need to change the definition of lilypond_header (or create
several
versions
> of it) to make it not start from an empty slate.

Actually, it looks like it just doing that: taking the old value and
adding to
it.


Apparently, it doesn't do it properly:

\book {
 \header { title = "Title" }
 \header { composer = "Composer"  }
 \score { \new Staff { c'4 } }
}

or

\version "2.15.42"
\score {
  \new Staff { c'4 }
  \header {  piece = "Piece"  opus = "Opus" }
  % This should NOT clear the piece from above:
  \header { opus = "New Opus" }
}

In both cases the assignments of the first header block are lost,
because when parsing the second header block, it starts from an empty
block and replaces the whole header block rather than adding to the
existing assignments...

The hierarchy works correctly (i.e. top-level header blocks are used as
base for book-level blocks, which are used as base for bookpart-level
blocks, which are used as base for score-level blocks), mainly because
in score.cc and book.cc the parent's header block is copied when
inserting a book or score into its parent.


Description:
Issue 1650: Multiple header blocks shall be merged rather than replace a
previous one

If there are two or more header blocks at top-, book-, bookpart- or
score-level,
the settings of all header blocks are merged. If a value appears in
multiple
blocks, the last assigment wins.

Please review this at http://codereview.appspot.com/6441058/

Affected files:
  A input/regression/header-book-multiple.ly
  A input/regression/header-book-multiplescores.ly
  A input/regression/header-bookpart-multiple.ly
  A input/regression/header-score-multiple.ly
  A input/regression/header-toplevel-multiple.ly
  M lily/parser.yy





reply via email to

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