"Trevor Daniels" <t.dani...@treda.co.uk> writes: > David Kastrup wrote Saturday, October 13, 2012 1:01 AM >> >> In ly/music-functions-init.ly I see code like the following: >> >> crossStaff = >> #(define-music-function (parser location notes) (ly:music?) >> (_i "Create cross-staff stems") >> #{ >> \override Stem #'cross-staff = #cross-staff-connect >> \override Flag #'style = #'no-flag >> $notes >> \revert Stem #'cross-staff >> \revert Flag #'style >> #}) >> >> There is a problem with that: in terms of stack operations, \override >> and \revert are not opposing pairs: \override is pop+push (so that >> multiple overrides in a row don't accrue cruft), \revert is pop. So the >> net effect of this sequence is "pop", while it should be neutral. > > What would be the effect of this? The implication is that something > goes wrong, but bugs in this area have never been reported, AFAIK. > > I understand stacks, pop and push, but I'm clearly missing something > here. Perhaps it's due to my unfamiliarity with the structure of the > stack(s).
Each context has its own stack, so popping too much only makes a difference if the stack actually was non-empty to start with. Check out \new Staff \with { autoBeaming = ##f } { \override Flag #'style = #'mensural c8 c \crossStaff c c c c c c } After the crossStaff, the flag style has reverted to normal again rather than mensural. -- David Kastrup _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel