From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: font-lock-comment-delimiter-face Date: Thu, 12 May 2005 23:45:01 -0400 Message-ID: <878y2jztbi.fsf-monnier+emacs@gnu.org> References: <87acn15z2i.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115956443 19730 80.91.229.2 (13 May 2005 03:54:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 May 2005 03:54:03 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 13 05:54:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DWRF4-0002ub-IP for ged-emacs-devel@m.gmane.org; Fri, 13 May 2005 05:53:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DWRO8-0006xA-RC for ged-emacs-devel@m.gmane.org; Fri, 13 May 2005 00:03:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DWRNG-0006gQ-Bq for emacs-devel@gnu.org; Fri, 13 May 2005 00:02:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DWRN9-0006dR-W1 for emacs-devel@gnu.org; Fri, 13 May 2005 00:02:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DWRN7-0006WL-1s for emacs-devel@gnu.org; Fri, 13 May 2005 00:01:57 -0400 Original-Received: from [209.226.175.184] (helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DWRDY-0002XG-Q6; Thu, 12 May 2005 23:52:04 -0400 Original-Received: from alfajor ([67.68.217.114]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050513034503.OEDA21470.tomts22-srv.bellnexxia.net@alfajor>; Thu, 12 May 2005 23:45:03 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 49718D7301; Thu, 12 May 2005 23:45:01 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Thu, 12 May 2005 21:34:11 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:37059 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37059 > For C++ mode, it doesn't quite work: > foo // comment1 > bar /* comment2 */ > The // and /* are put in font-lock-comment-delimiter-face (which I find to > be useless clutter and makes the text less legible without helping > understand the structure), but the */ is left with just > font-lock-comment-face. > That is because comment-end is empty in C++ mode. > I see there is a variable comment-end-skip, whose doc string suggests > it ought to be useful for this (but the doc string is not entirely > clear tome). But it doesn't seem to be set up in C++ mode. Should it > be? Major modes should set comment-end-skip, like they set comment-start-skip, but since this variable was new in Emacs-21.1 I had to handle the backward compatible case where a major mode does not set comment-end-skip, so comment-end-skip is set to an "educated guess" value (based on comment-end and "\\s>") if not set already. This defaulting is done by comment-normalize-vars which is called at the beginning of all major comment function. > I don't understand the above. In what way does the current code > change what font-lock-comment-face looks like? > When I added font-lock-comment-delimiter-face, I copied the > definition of font-lock-comment-face into it, then changed > the definition o font-lock-comment-face. > It would be cleaner to leave font-lock-comment-face unchanged and > define font-lock-comment-text-face with the modified value. > However, I couldn't make that work. Adapting the code in > font-lock-fontify-syntactically-region in a straightforward > way resulted in incorrect results, and I don't know why. Without seeing the "straightforward way" code, it's hard to tell. Stefan