lilypond-user
[Top][All Lists]
Advanced

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

Re: Repeating predefined stanza labels


From: Neil Puttock
Subject: Re: Repeating predefined stanza labels
Date: Fri, 17 Jun 2011 23:26:04 +0100

On 16 June 2011 23:45, Matthew Collett <address@hidden> wrote:

> Why is the behaviour different in the two cases,

The Stanza_engraver generates a stanza number if the markup changes.
It keeps a cache of the old stanza markup as a Scheme smob (type SCM
in C/C++) and compares it to the new setting via pointers (this is
important, since comparing by value would result in duplicated stanza
numbers on each line).

In your first snippet, each invocation is a new scheme string object,
thus the pointers are different.  The second snippet reuses each
string, so the equality check succeeds and no graphical object is
created.

>  and what incantation  will make the predefined labels be shown each time?

Use \markup instead of bare strings:

one = \set stanza = \markup { 1. }
two = \set stanza = \markup { 2. }

These are guaranteed to be different each time they're invoked, since
the markup isn't evaluated when the identifiers are parsed.

Cheers,
Neil



reply via email to

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