[EMAIL PROTECTED] (David ) writes:
> > Yes.
> >
> > > And is there any difference between your own
> > > contexts and the built-in (and automatic) ones?
> >
> > Technically, there is no distinction between automatic and user
> > defined contexts; the automatic ones are loaded from
> > ly/engraver.ly. For practical purposes it is better not to rely on
> > your own contexts, since they might not work if some implementations
> > are changed.
> >
> > However, I think that giving users a possibility to define their own
> > contexts might be useful in some cases.
>
> Absolutely. What I haven't figured out is the relationthips between
>
> 1. Contexts as a global data structure, containing engravers etc.
> 2. \FooContext identifiers used in \translator blocks
> 3. \name, which Mats mentioned. I didn't know about this.
> 4. The context "instances" used while engraving.
> 5. The \context Identifiers used in the scores.
>
> My understanding is that when lilypond created context instances (4)
> while processing a score it uses the \context information (5) to find
> an appropriate context definition (1). But how it does this, I don't
> know.
Context instances are created during interpreting. They are created
either by default or when
\context CNAME
is encountered. CNAME is used to find the context definition that has
a matching \name, i.e. that looks like
\translator {
...
\name CNAME;
}
The implementation of a context instance, is a collection of C++
objects known as Engravers, held together by a
Engraver_group_engraver object.
\FooContext is unrelated to the above: it is just a way of referring
to a previous definition of a context.
--
Han-Wen Nienhuys, [EMAIL PROTECTED] ** GNU LilyPond - The Music Typesetter
http://www.cs.uu.nl/people/hanwen/lilypond/index.html