lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defining new contexts


From: Jim Long
Subject: Re: Defining new contexts
Date: Tue, 24 Feb 2015 15:31:02 -0800
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Feb 24, 2015 at 10:14:22AM -0700, Paul Morris wrote:
> Jim Long wrote
> > Is there a way I can define a context based on ChordNames and
> > have it automatically inherit all of the properties of a
> > ChordNames context, except the ones that I specifically change in
> > my custom definition?  
> 
> Yes, in fact you're already doing this, explained below...
> 
> 
> Jim Long wrote
> > In other words, a way to eliminate the
> > need for the second \context {} block in your example?
> 
> The short answer is no.  Whether (for example) a PianoStaff context can
> contain ("accepts") a ChordNames context or not is not a property of
> ChordNames but a property of PianoStaff.  So you have to tell PianoStaff
> (and friends) to accept your new and unknown context.

Yes, I have sighed and accepted this.  But it would be nice, if
it is practical, for "Higher" contexts to decide to accept "Lower" 
contexts based on context name (\ChordNames) as well as on alias
(\alias ChordNames).  On the prinicple that "any friend of
ChordNames is a friend of mine!"

> You can just do it once and put it in an include file so you don't have to
> do it again.  That's what I do.
>
> (I suppose it would be possible to change how LilyPond handles this so that
> unknown/custom contexts were accepted by default by other contexts (rather
> than rejected by default).

I don't ask for "accepted by default," but I was hoping rather
that A would accept C because A accepts B, and C is explicitly
declared as an alias of B.  Therefore, A would accept B and all
aliases of B.

> Or, probably better, introduce some kind of
> "passes as" property where you could tell other contexts to "treat this
> context like X context for purposes of accepting/rejecting it".)

??? I was hoping that "\alias ChordNames" would buy that for me.

> Hope that helps,
> -Paul

You have taken some of the sting out of it, but I will still be
grateful to anyone who has the time and a patch to make this more
automatic.

Thanks, Paul.

Jim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]