From: "Marshall, Simon" <simon.marshall@misys.com>
Cc: "'bug-cc-mode@gnu.org'" <bug-cc-mode@gnu.org>,
"'emacs-devel@gnu.org'" <emacs-devel@gnu.org>
Subject: RE: Font-lock misfontifies foo::bar in C++
Date: Wed, 6 Sep 2006 11:43:24 +0100 [thread overview]
Message-ID: <81CCA6588E60BB42BE68BD029ED482600A307639@wimex2.wim.midas-kapiti.com> (raw)
> "Marshall, Simon" <simon.marshall@misys.com> 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
frustrating.
>
> 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.
Simon.
next reply other threads:[~2006-09-06 10:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-06 10:43 Marshall, Simon [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-08-16 14:35 FW: Font-lock misfontifies foo::bar in C++ Marshall, Simon
2006-08-17 1:53 ` Miles Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81CCA6588E60BB42BE68BD029ED482600A307639@wimex2.wim.midas-kapiti.com \
--to=simon.marshall@misys.com \
--cc=bug-cc-mode@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).