Re: ly:book-scores includes other elements

David Kastrup <[email protected]> Sun, 26 Jul 2026 00:14:19 +0200
Newsgroups gmane.comp.gnu.lilypond.bugs
Organization Organization?!?
Message-ID <[email protected]>
Singon <[email protected]> writes:

> Dear LilyPond developers,
>
> I am not sure if this is a bug or not, but judging by the
> documentation, the Scheme function `ly:book-scores` should only return
> scores. Instead, it includes other top-level elements like markup. In
> the attached example, I would have expected it to print only
> `#<Score>`, but I see the `(This is not a score!)` as well. Is this a
> desired behaviour?

The "scores_" part of a book/bookpart clearly can also contain markups.
The ly:make-book and ly:make-bookpart functions do not check at all what
they are adding to scores_ (ugh), but the code in lily/book.cc makes
clear that it can be a score, a markup list, or a page marker.

A paperbook has slightly different stuff in its "scores_".

So this is part a documentation problem (never changed the docs and
structure names when adding functionality?).  And the complete lack of
checks is not exactly endearing either.

ly:book-scores (the Scheme interface) does not appear to get used
anywhere in the LilyPond code base.

-- 
David Kastrup