Trevor Bača <trevorb...@gmail.com> writes: > %%% BEGIN %%% > > \version "2.25.6" > \paper { indent = 0 tagline = ##f } > > \markuplist \column-lines { > "TextSpanner.bound-details.text.left = \"red\" when spanner color is > red;" > "TextSpanner.bound-details.text.left = \"other\" when spanner color is > not red:" > " " > } > > { > \override TextSpanner.bound-details = > #(grob-transformer > 'bound-details > (lambda (grob orig) > (assoc-set! (alist-copy orig) > 'left > (assoc-set! (alist-copy (assoc-ref orig 'left)) > 'text > (if (equal? red (ly:grob-property grob > 'color)) > "red" "other"))))) > c'1 > - \tweak color #red > \startTextSpan > d'1 > e'1 > \stopTextSpan > f'1 > - \tweak color #blue > \startTextSpan > g'1 > a'1 > \stopTextSpan > } > > %%% END %%% > > But because successive calls to grob-transformer effectively overwrite > earlier calls to grob-transformer, we can't use this pattern to (say) > override bound-details.left.text and bound-details.left-broken.text at the > same time:
Your analysis is wrong. Successive calls to grob-transformer work just fine. Your problem is that successive \override incantations revert previous incantations in the same context _unless_ you use \temporary \override . If you do your second grob-transformer invocation (or both) with a \temporary \override, it will leave the first call in place. Of course you'll need a double \revert then if you want to get rid of both calls. -- David Kastrup