On 10/25/06, Peter Hodge <[EMAIL PROTECTED]> wrote:

--- Nikolai Weibull <[EMAIL PROTECTED]> wrote:

> On 10/25/06, Peter Hodge <[EMAIL PROTECTED]> wrote:
>
> > --- Nikolai Weibull <[EMAIL PROTECTED]> wrote:
>
> > > I figured that it was easier to add items to a cluster using
> > > containedin= for a syntax definition I'm writing, but it seems that
> > > one can't do it that way.  Is there a reason for this, or is it an
> > > oversight?  Can we add this to the todo?  I've never needed it before,
> > > but for this particular grammar, it made a lot of sense.
>
> > Using 'syn keyword SomeKeyword foo [EMAIL PROTECTED]' does not add
> SomeKeyword to the cluster @SomeCluster, rather, it allows SomeKeyword be
> contained in all the items in @SomeCluster.
>
> Ah, of course. How silly of me.  Although, it would be nice if this
> could be done somehow.  A pair of @'s, perhaps, e.g., syn match
> Something containedin=@@Cluster '...'?

Probably better if it was '[EMAIL PROTECTED]' rather than complicating the
containedin option.  If you are in the habit of spanning syntax commands across
multiple lines, then it's pretty easy to make a new line to add the item to the
cluster.  I.e., if you have:

  syn match foo /foo/ contained
        \ [EMAIL PROTECTED]

then it could be

  syn match foo /foo/ contained
  syn cluster myCluster add=foo

It's not so painful.

Yes, it is, because many of the foo need to be added to two clusters,
and it clutters up an already rather (unavoidably) cluttered syntax
definition.  Addto would perhaps make more sense.

 nikolai

Reply via email to