> On Oct 19, 2015, at 10:59 AM, David Kastrup <d...@gnu.org> wrote: > > Paul Morris <p...@paulwmorris.com> writes: >> >> That did the trick and now it works, thanks! >> >> \version “2.19.22” >> >> myfunc = >> #(define-music-function () () >> #{ >> \context Staff >> \applyContext >> #(lambda (context) >> ;; access context properties and pick a property setting based on >> them... >> (ly:context-pushpop-property context 'StaffSymbol 'color green)) >> \stopStaff >> \startStaff >> #}) > > Frankly, anything wrong with > > \temporary \override Staff.StaffSymbol.color = #green > > here?
That would work except I want to be able to access Staff context properties and then, based on their values, decide what to set the StaffSymbol property to. In this example, say color it either green or blue. I just left these details out of my tiny example (as I tried to indicate with the comment "access context properties and pick a property setting based on them…”, which may not have been very clear). > Assuming you want a temporary override (which is what > ly:context-pushpop-property does) in order to be able to revert to the > previous setting afterwards. I actually don’t think I’ll need to be able to revert. I was just using ly:context-pushpop-property because it was shown in the examples in the extending manual. Thanks again, -Paul _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user