Nate Whetsell <[email protected]> writes:

> Thank you for all your work on LilyPond!
>
> I’ve found that when defining a stream of music using \addQuote, if the music 
> contains a custom context, “cannot create context” warnings are thrown when 
> the music is passed to \addQuote.
>
> I suspect that these warnings are accurate—the custom context really can’t be 
> created—but I’m reporting it as a bug because, as far as I can tell, there’s 
> no way to cause \addQuote to create the custom context. (The warnings can be 
> silenced with ly:expect-warning, however.)
>
> I can reproduce this in LilyPond 2.24.4 and 2.25.27. Note that in 2.24.4, the 
> behavior is a little different; LilyPond 2.24.4 reports that converting to a 
> PDF failed with “fatal error: failed files: [filename]”, but the PDF is 
> actually written. LilyPond 2.25.27 reports “Success: compilation successfully 
> completed”.
>
> Here is a minimal example:
>
> \version "2.25.24"
>
> \layout {
>   \context {
>     \name MyContext
>     \type Engraver_group
>     \alias Voice
>   }
>   \inherit-acceptability MyContext Voice
> }
>
> music = \new MyContext { s1 }
>
> \score {
>   \new Staff { \music }
> }
>
> % #(ly:expect-warning (G_ "cannot create context: ~a") "MyContext")
> \addQuote "music" \music
>

Well, the way to get by without the warning (that indicates an actual
problem) would be

\version "2.25.24"

\layout {
  \context {
    \name MyContext
    \type Engraver_group
    \alias Voice
  }
  \inherit-acceptability MyContext Voice
}

partCombineListener =
\layout {
  \partCombineListener
  \context {
    \name MyContext
    \type Engraver_group
    \alias Voice
  }
  \inherit-acceptability MyContext Voice
}

music = \new MyContext { s1 }

\score {
  \new Staff { \music }
}

% #(ly:expect-warning (G_ "cannot create context: ~a") "MyContext")
\addQuote "music" \music
How partCombineListener is set up and used is really not a good
interface.  It should probably just consist of a "layout modification"
if such a thing existed, and/or be set up to just inherit from the
current layout context.

-- 
David Kastrup

Reply via email to