From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ralf Angeli 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 Feb 2006 22:12:45 +0100 Organization: nil Message-ID: References: <87fymod0dt.fsf-monnier+emacs@gnu.org> <877j7xojcc.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 1139955306 2058 80.91.229.2 (14 Feb 2006 22:15:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2006 22:15:06 +0000 (UTC) Cc: rms@gnu.org, bug-cc-mode@gnu.org, emacs-devel@gnu.org Original-X-From: cc-mode-help-admin@lists.sourceforge.net Tue Feb 14 23:15:02 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 1F98Rp-0006U2-4m for sf-cc-mode-help@m.gmane.org; Tue, 14 Feb 2006 23:15:02 +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 5998A8947D; Tue, 14 Feb 2006 14:15:00 -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 1F98Qs-0003CC-8b for cc-mode-help@lists.sourceforge.net; Tue, 14 Feb 2006 14:14:02 -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 1F98Qq-0003z3-E3 for cc-mode-help@lists.sourceforge.net; Tue, 14 Feb 2006 14:14:02 -0800 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1F98Q3-0007iy-Oa for bug-cc-mode@gnu.org; Tue, 14 Feb 2006 17:13:11 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.52) id 1F98Um-000488-0o for bug-cc-mode@gnu.org; Tue, 14 Feb 2006 17:18:07 -0500 Original-Received: from [134.96.7.25] (helo=triton.rz.uni-saarland.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F98Ul-00047s-IT; Tue, 14 Feb 2006 17:18:03 -0500 Original-Received: from iwi-gate.iwi.uni-sb.de (iwi-gate.iwi.uni-saarland.de [134.96.72.13]) by triton.rz.uni-saarland.de (8.12.10/8.12.10) with ESMTP id k1EMD4bO10442851; Tue, 14 Feb 2006 23:13:04 +0100 (CET) Original-Received: from [134.96.72.191] (helo=iwi191.iwi.uni-sb.de) by iwi-gate.iwi.uni-sb.de with esmtp (Exim 4.53 (FreeBSD)) id 1F98Pd-000Kb4-NF; Tue, 14 Feb 2006 23:12:45 +0100 Original-Received: from angeli by iwi191.iwi.uni-sb.de with local (Exim 4.60) (envelope-from ) id 1F97TZ-0006L5-RK; Tue, 14 Feb 2006 22:12:45 +0100 Original-To: Stefan Monnier In-Reply-To: <877j7xojcc.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 14 Feb 2006 14:05:38 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-IWi-MailScanner-Information: Please contact the ISP for more information X-IWi-MailScanner: Found to be clean X-IWi-MailScanner-SpamCheck: not spam, SpamAssassin (score=0, required 5, autolearn=disabled) X-MailScanner-From: angeli@iwi.uni-sb.de X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.1 (triton.rz.uni-saarland.de [134.96.7.25]); Tue, 14 Feb 2006 23:13:04 +0100 (CET) X-AntiVirus: checked by AntiVir Milter (version: 1.1.1-9; AVE: 6.33.0.31; VDF: 6.33.0.237; host: AntiVir2) 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 Feb 2006 22:12:45 +0100 Xref: news.gmane.org gmane.emacs.cc-mode.general:2995 gmane.emacs.devel:50536 Archived-At: * Stefan Monnier (2006-02-14) writes: >> Hm, how would it be possible to detect closing tags in this case? >> Maybe with an initial search for these tags across the region to be >> fontified. Or on a case by case basis for every closing tag which is >> encountered during fontication of the region? This would be rather >> inefficient compared to using a hook to be called before >> `font-lock-after-change-function'. But maybe you are thinking about >> something completely different. > > Huh? I must be missing something: I don't see what's different between > font-lock-after-change-function and font-lock-default-fontify-region, other > than the fact that they're called at different moments. You are right, it is not /that/ different. However, the proposed hook, like the other functions in `after-change-functions', will get the begin and end of the changed region which will mostly be smaller than the region passed to `font-lock-default-fontify-region' and the end of the region will be nearer to the point I am interested in. So detecting an ending tag with something like (search-backward ">>" (1- beg) t) will be faster. I am not sure, however, if the solution with `font-lock-default-fontify-region' is more efficient overall because the function might not be called as often as a hook in `after-change-functions'. -- Ralf ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642