Thomas Morley <[email protected]> writes:

> Hi,
>
> currently I continue my work to create a Slash-grob for automatic slashed 
> Beams.
> The Slash-stencil needs to know Beam-properties (X-positions,
> positions) to be adjusted. If I call those beam-properties directly
> the Beam collopses, because this call is done before the Beam is
> ready.
> But if I wrap the Slash-stencil in another procedure like
> (define slash-stil (lambda (grob) (lambda (grob) ...)))
> all works.
>
> Questions:
> - Why does it work? (it seems the outer procedure is called
> before-line-breaking, the inner after-line-breaking)
> - Is this something I can rely on (I'm thinking of patch) or am I
> doing bug-using?

Depends on whether someone asks for your stencil prematurely.  We have a
lot of those implicit dependencies though.

> - Is there a better/different method?

An unpure/pure container has somewhat more defined semantics when its
respective callbacks are exercised.  But if it works without, go for it.
If it doesn't and the Beam uses unpure-pure-containers, you can also use
an unpure-pure-container and work with ly:pure-call and ly:unpure-call
in your respective callbacks: those work even when the definition of
Beam changes significantly.

-- 
David Kastrup

_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to