From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier 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: Sun, 13 Mar 2005 20:07:40 -0500 Message-ID: <87br9n9gxu.fsf-monnier+emacs@gnu.org> References: <5bk6of409s.fsf@lister.roxen.com> <5bu0nfplh2.fsf@lister.roxen.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1110762491 21565 80.91.229.2 (14 Mar 2005 01:08:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2005 01:08:11 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org, Richard Stallman Original-X-From: cc-mode-help-admin@lists.sourceforge.net Mon Mar 14 02:08:11 2005 Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DAe3g-00052b-In for sf-cc-mode-help@m.gmane.org; Mon, 14 Mar 2005 02:07:49 +0100 Original-Received: from projects.sourceforge.net (sc8-sf-list1-b.sourceforge.net [10.3.1.7]) by sc8-sf-spam1.sourceforge.net (Postfix) with ESMTP id 05BC088D72; Sun, 13 Mar 2005 17:08:15 -0800 (PST) Original-Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.12] helo=sc8-sf-mx2.sourceforge.net) by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30) id 1DAe3j-0007QK-SD for cc-mode-help@lists.sourceforge.net; Sun, 13 Mar 2005 17:07:51 -0800 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by sc8-sf-mx2.sourceforge.net with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1DAe3i-0007jx-4g for cc-mode-help@lists.sourceforge.net; Sun, 13 Mar 2005 17:07:51 -0800 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1DAe3g-0001hF-0c for bug-cc-mode@gnu.org; Sun, 13 Mar 2005 20:07:48 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1DAe3Z-0007pW-VU for bug-cc-mode@gnu.org; Sun, 13 Mar 2005 20:07:42 -0500 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DAe3Z-0007pL-GR; Sun, 13 Mar 2005 20:07:41 -0500 Original-Received: from alfajor ([67.71.27.21]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050314010740.ZMJI1694.tomts36-srv.bellnexxia.net@alfajor>; Sun, 13 Mar 2005 20:07:40 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 711F1D74A3; Sun, 13 Mar 2005 20:07:40 -0500 (EST) Original-To: bug-cc-mode@gnu.org In-Reply-To: <5bu0nfplh2.fsf@lister.roxen.com> (Martin Stjernholm's message of "Sun, 13 Mar 2005 17:19:21 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-Spam-Status: No, hits=-2.0 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,RCVD_IN_ORBS,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_GNUS_UA version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-Spam-Score: 0.8 (/) 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 0.0 SF_CHICKENPOX_PERIOD BODY: Text interparsed with . 0.0 SF_CHICKENPOX_SLASH BODY: Text interparsed with / 0.0 SF_CHICKENPOX_MINUS BODY: Text interparsed with - 0.0 SF_CHICKENPOX_BRACKET_OPEN BODY: Text interparsed with [ 0.0 SF_CHICKENPOX_AT BODY: Text interparsed with @ 0.0 SF_CHICKENPOX_APOSTROPHE BODY: Text interparsed with ' 0.8 AWL AWL: From: address is in the auto white-list 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: Sun, 13 Mar 2005 20:07:40 -0500 X-MailScanner-From: cc-mode-help-admin@lists.sourceforge.net X-MailScanner-To: sf-cc-mode-help@m.gmane.org Xref: news.gmane.org gmane.emacs.cc-mode.general:2298 gmane.emacs.devel:34555 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34555 >> The problem is: how to get font-lock to refontify >> >> s[foo]{ >> bar >> }x > /.../ >> Now, when I'm in the middle of font-locking, I've done the work of figuring >> out that I'm in an s/foo/bar/ expression and I can easily add >> a text-property on the whole thing. > That doesn't work very well while the thing is entered, does it? First > you see "s[foo]{" while it's being entered, then you see the next line > " bar", and lastly "}x". Your patterns will never see the whole > construct at once. (They will however see the buffer end, or even > worse some completely unrelated code that happen to be on the > following lines and which might confuse them.) I use font-lock-syntactic-face-function, so I don't need to "see the whole pattern" (I basically keep track of the intermediate state in the parse-partial-sexp state). It works just fine (well, admittedly, I just tried it and there's a bug in the code that in this case ends up placing a string-fence char on the `s' instead of the `['). > Another problem is that the "bar" part can get arbitrarily large if > it's code, in which case it becomes a performance problem to put a > property on it to refontify the whole thing. That's why I used jit-lock-defer-multiline: I only refontify the whole thing in the "deferred" refontification, not the on-the-fly one. Stefan ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click