From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: font-lock-comment-delimiter-face Date: Thu, 12 May 2005 21:34:11 -0400 Message-ID: References: <87acn15z2i.fsf-monnier+emacs@gnu.org> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1115948102 30794 80.91.229.2 (13 May 2005 01:35:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 May 2005 01:35:02 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 13 03:35:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DWP4g-0006so-CP for ged-emacs-devel@m.gmane.org; Fri, 13 May 2005 03:34:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DWPDi-0008G8-Mk for ged-emacs-devel@m.gmane.org; Thu, 12 May 2005 21:44:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DWPBN-0006xy-L5 for emacs-devel@gnu.org; Thu, 12 May 2005 21:41:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DWPBD-0006tr-Of for emacs-devel@gnu.org; Thu, 12 May 2005 21:41:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DWPBC-0006pW-BN for emacs-devel@gnu.org; Thu, 12 May 2005 21:41:30 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DWPC8-0001SW-Jm for emacs-devel@gnu.org; Thu, 12 May 2005 21:42:28 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DWP47-0001zt-4m; Thu, 12 May 2005 21:34:11 -0400 Original-To: Stefan Monnier In-reply-to: <87acn15z2i.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Wed, 11 May 2005 15:51:01 -0400) 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:37056 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37056 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? In SML mode I see another problem: (* comment 1 start (* nested comment *) comment 1 end *) The first (* is in f-l-c-d-f, the second isn't. That's correct. OTOH depending on how the text is refontified, not only the second *) but sometimes also the first *) gets the new f-l-c-d-f. I don't see how to handle nested comments easily. 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.