Folks,
the following is triggered mainly (but not solely) by my short exchange
with Dan
(https://gitlab.com/lilypond/lilypond/-/merge_requests/1617#note_1735195563):
We have some context properties that are persistent (e.g.
figuredBassPlusDirection), whereas others are effective once and then
get reset by some engraver. Examples include whichBar, but there are
more, like forceClef. A third group, like stanza, gets stored
persistently, but only leads to a graphical output when changed, thus
making for a user interface similar to an actual "use once and then forget".
This makes our user interface a little inconsistent regarding the
meaning of \set: From a user's perspective, it's hard to understand that
some \set'tings have a persistent effect while others act at a single
point in time.
(For stanza in particular I think while "printing a StanzaNumber at each
timestep" is probably nonsencial, the "store, and print only when
changed" strategy is actually valid, since this allows for things like
"print courtesy parenthesized StanzaNumber after line breaks" which
features prominently on my list of things to try.)
So: Wouldn't it be more consistent to turn those context properties that
(to the user) create "one-time only effects" into persistent ones (so
forceClef = ##t _would_ actually create a clef at each timestep forward)
and instead create dedicated user interfaces using music functions, like
forceClef = \once \set forceClef = ##t
etc.? In a similar vein, wouldn't
stanzaNumber = \set stanza = \etc (plus some extra features like
auto-adding dots when given an integer)
be more consistent than forcing the users to remember that (and
understand why) stanza numbers have to be created by \set'ting a context
property?
(Disclaimer: I'm merely asking for thoughts here; I'm not stating that
someone(tm) should do this, but would be interested to know whether work
in this direction would be welcomed.)
Lukas