From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Marshall, Simon" Newsgroups: gmane.emacs.devel Subject: RE: Font-lock misfontifies foo::bar in C++ Date: Wed, 6 Sep 2006 11:43:24 +0100 Message-ID: <81CCA6588E60BB42BE68BD029ED482600A307639@wimex2.wim.midas-kapiti.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1157539429 30959 80.91.229.2 (6 Sep 2006 10:43:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Sep 2006 10:43:49 +0000 (UTC) Cc: "'bug-cc-mode@gnu.org'" , "'emacs-devel@gnu.org'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 06 12:43:46 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GKusF-0007XW-RJ for ged-emacs-devel@m.gmane.org; Wed, 06 Sep 2006 12:43:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKusF-0004SC-Dh for ged-emacs-devel@m.gmane.org; Wed, 06 Sep 2006 06:43:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GKus1-0004Rz-9c for emacs-devel@gnu.org; Wed, 06 Sep 2006 06:43:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GKurx-0004QK-Lm for emacs-devel@gnu.org; Wed, 06 Sep 2006 06:43:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKurx-0004QH-GL for emacs-devel@gnu.org; Wed, 06 Sep 2006 06:42:57 -0400 Original-Received: from [80.69.8.190] (helo=cluster-a.mailcontrol.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GKus2-0002MP-I0; Wed, 06 Sep 2006 06:43:02 -0400 Original-Received: from wimex2.wim.midas-kapiti.com ([217.196.233.101]) by rly18a.srv.mailcontrol.com (MailControl) with ESMTP id k86AgjNV016615; Wed, 6 Sep 2006 11:42:46 +0100 Original-Received: by wimex2.wim.midas-kapiti.com with Internet Mail Service (5.5.2657.72) id ; Wed, 6 Sep 2006 11:43:25 +0100 Original-To: "'Miles Bader'" X-Mailer: Internet Mail Service (5.5.2657.72) X-Scanned-By: MailControl A-07-04-01 (www.mailcontrol.com) on 10.65.0.128 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59435 Archived-At: > "Marshall, Simon" 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.