From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: [sigra@home.se: C++-mode: Syntax highlighting: wrong color for function identifier depending on the kind of whitespace that follows] Date: Tue, 14 Mar 2006 19:23:22 +0000 (GMT) Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1142363984 26713 80.91.229.2 (14 Mar 2006 19:19:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Mar 2006 19:19:44 +0000 (UTC) Cc: Ralf Angeli , martin rudalics , StefanMonnier , emacs-devel@gnu.org, bug-cc-mode@gnu.org Original-X-From: cc-mode-help-admin@lists.sourceforge.net Tue Mar 14 20:19:40 2006 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FJF2z-0006by-B3 for sf-cc-mode-help@m.gmane.org; Tue, 14 Mar 2006 20:19:10 +0100 Original-Received: from sc8-sf-list1-b.sourceforge.net (sc8-sf-list1-b.sourceforge.net [10.3.1.7]) by sc8-sf-spam1.sourceforge.net (Postfix) with ESMTP id 984618960F; Tue, 14 Mar 2006 11:19:07 -0800 (PST) Original-Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30) id 1FJF2X-0005Sc-6T for cc-mode-help@lists.sourceforge.net; Tue, 14 Mar 2006 11:18:41 -0800 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by mail.sourceforge.net with esmtps (TLSv1:RC4-SHA:128) (Exim 4.44) id 1FJF2W-0002yt-HD for cc-mode-help@lists.sourceforge.net; Tue, 14 Mar 2006 11:18:41 -0800 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1FJF2P-0008Li-SI for bug-cc-mode@gnu.org; Tue, 14 Mar 2006 14:18:34 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.52) id 1FJF6W-0006cI-6a for bug-cc-mode@gnu.org; Tue, 14 Mar 2006 14:22:51 -0500 Original-Received: from [193.149.49.134] (helo=acm.acm) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FJF6V-0006b9-2R; Tue, 14 Mar 2006 14:22:48 -0500 Original-Received: from localhost (root@localhost) by acm.acm (8.8.8/8.8.8) with SMTP id TAA00917; Tue, 14 Mar 2006 19:23:24 GMT X-Sender: root@acm.acm Original-To: "Richard M. Stallman" In-Reply-To: X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.0 FORGED_RCVD_HELO Received: contains a forged HELO Original-Sender: cc-mode-help-admin@lists.sourceforge.net Errors-To: cc-mode-help-admin@lists.sourceforge.net X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.0.9-sf.net Precedence: bulk List-Unsubscribe: , List-Id: Bug reports, feature requests, and general talk about CC Mode. List-Post: List-Help: List-Subscribe: , List-Archive: X-Original-Date: Tue, 14 Mar 2006 19:23:22 +0000 (GMT) Xref: news.gmane.org gmane.emacs.cc-mode.general:3194 gmane.emacs.devel:51626 Archived-At: Hi, Richard! On Sun, 12 Feb 2006, Richard M. Stallman wrote: >Here's the change I was talking about. Would someone please adapt >this _now_ to the current sources, and install it? Then please rename >before-font-lock-after-change-function to >font-lock-extend-region-function, and rename >font-lock-run-before-after-change-hook to font-lock-extend-region? >Then please ack this message. DONE. In the process, I moved the processing of font-lock-lines-before from font-lock-default-fontify-region into font-lock-after-change-function and jit-lock-after-change, so as to be able to stop them interfering with eachother. More controversially, I've explicitly documented that the region returned by the f-l-extend-region may start or end in the middle of a line. I'm not sure whether that will work properly at the moment (I suspect it won't), but I think it can be and should be fixed. I'm thinking about a piece of badly formatted C code something like: 1. int foo (int 2. bar) {printf "Hello world"} ; int baz 3. (int omg) { The "baz" on L3 hasn't a snowball's chance in Hades of getting fontified with f-l-function-name-face unless the font lock region is allowed to start at the "int" on L2. There are surely much better formatted buffers which also need the region to start in the middle of a line. I've also created a new @subsection in modes.texi, "Region to Fontify", which documents font-lock-extend-region-function, and I've moved font-lock-lines-before into it. -- Alan. ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642