Am 12.07.2018 um 00:13 schrieb David Kastrup:
Urs Liska <li...@openlilylib.org> writes:

Am 11.07.2018 um 10:33 schrieb David Kastrup:
Urs Liska <li...@openlilylib.org> writes:

One more understanding question regarding contexts and engravers.

If I \consist an engraver in a bottom context like Voice I can travel
up the chain of parent contexts, retrieving their name and id
properties. But if I \consist it in Staff level contexts I don't see
if/how I can get to the bottom-level context a grob is possibly in.
To be in any meaningful way "in a bottom-level context", a grob needs to
be made by an engraver at bottom level.  In that case you can call
ly:translator-context on the third argument of the grob acknowledger
which is the _source_ engraver rather than the current engraver.

OK, I have tested how this works, and I see how I can retrieve the
lowest context of any given grob. But if I'm not mistaken this is only
possible in acknowledgers, isn't it?
Sure.

But I have to get to that context in process-acknowledged or
stop-translation-timestep.
So store it until then.

By now I would know how to link that information to the grob in
acknowledgers and read it later - but that would mean I have to look
up the source-engraver context for *all* grobs and not only for those
(the annotated grobs) where I actually need them.
So?  How many millions per time step do you expect?

per time step and context I only expect a few dozens. But I was reluctant to do that (store but mainly retrieve the context) for *every* grob in the score when I only have very few actual annotations.

But it appears to work that way, and I assume this is just the typical tendency of trying to optimize on the wrong end ;-)

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to