[Top][All Lists]

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

RE: Font-lock misfontifies foo::bar in C++

From: Marshall, Simon
Subject: RE: Font-lock misfontifies foo::bar in C++
Date: Wed, 6 Sep 2006 11:43:24 +0100

> "Marshall, Simon" <address@hidden> writes:
> > The only thing that could raise my hackles is that I feel I'm just 
> > repeating myself.  And this has been going on nearly 2 months.  I 
> > don't mind resolution taking that long---nobody is paid to do 
> > this---it's the lack of progress on such a simple issue that is
> Well, while I agree with you that fontifying Foo:: as a type 
> "makes more sense" from a pedantic point of view, than 
> fontifying as a constant, I think most people don't really 
> care much about such details of fontification as long as it 
> "looks OK" (mostly meaning important syntax bits are visually 
> distinctive but not annoying).
> With my face setup, the current fontification looks fine, 
> indeed I never noticed this little inconsistency.
> Now that I think about it, in fact, I rather _like_ that 
> Foo:: is not fontified as a type, because in a case like:
>    void
>    EnvmapLight::gen_samples (const Intersect &isec, 
> SampleRayVec &samples) const
> I get visually distinct faces for "void", "EnvmapLight", and 
> "gen_samples", which helps the readability of the code a bit I think.

I don't agree with this caveat.  If something is an X, fontify it as an X
even if it is near something else that is an X.  That way, whenever you see
something that is fontified as an X, you know it's an X without having to
thing about it.  It's not about being pedantic, it's about following the
purpose of fontification.

Fontification isn't simply to use faces to de/emphasise things - it's also
there to provide visual cues to aid identification of conceptual items.
That's why we have faces with specific names (eg, font-lock-constant-face),
that are for specific concepts (eg, constants), that are applicable across a
wide range of languages, and that have particular properties (eg, are
distinct from other font-lock faces).  The preamble to font-lock.el explains
these points.  Ok, I wrote it so maybe I can't use it to bolster this point,
but the preamble does detail the rationale and list a small set of
guidelines (some of which are broken by sometimes fontifying a type, and
always fontifiying a namespace, as a constant).

But thanks for the response - sadly your's is the only one I got.


reply via email to

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