From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Stjernholm Newsgroups: 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: Sat, 19 Mar 2005 23:23:59 +0100 Message-ID: <5b8y4jgtq8.fsf@lister.roxen.com> References: <5bk6of409s.fsf@lister.roxen.com> <5bu0nfplh2.fsf@lister.roxen.com> <87br9n9gxu.fsf-monnier+emacs@gnu.org> Reply-To: bug-cc-mode@gnu.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1111271870 28120 80.91.229.2 (19 Mar 2005 22:37:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2005 22:37:50 +0000 (UTC) Cc: bug-cc-mode@gnu.org, Alan Mackenzie , Richard Stallman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 19 23:37:49 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DCmZh-00086l-23 for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2005 23:37:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCmqS-0006dn-Iu for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2005 17:55:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DCmpD-0006Go-DA for emacs-devel@gnu.org; Sat, 19 Mar 2005 17:53:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DCmp7-0006DC-Cx for emacs-devel@gnu.org; Sat, 19 Mar 2005 17:53:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCmp2-00068X-Du for emacs-devel@gnu.org; Sat, 19 Mar 2005 17:53:32 -0500 Original-Received: from [212.247.28.43] (helo=mail.roxen.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DCmMY-0006XU-IR; Sat, 19 Mar 2005 17:24:06 -0500 Original-Received: by mail.roxen.com (Postfix, from userid 52) id 466859A0D; Sat, 19 Mar 2005 23:24:05 +0100 (MET) Original-Received: from localhost (localhost [127.0.0.1]) by mail.roxen.com (Postfix) with ESMTP id 159949A17; Sat, 19 Mar 2005 23:24:02 +0100 (MET) Original-Received: from lister.roxen.com (lister.roxen.com [212.247.28.136]) by mail.roxen.com (Postfix) with ESMTP id A9FF89A0D; Sat, 19 Mar 2005 23:24:00 +0100 (MET) Original-Received: from mast by lister.roxen.com with local (Exim 3.36 #1 (Debian)) id 1DCmMR-0004U6-00; Sat, 19 Mar 2005 23:23:59 +0100 Original-To: Stefan Monnier In-Reply-To: <87br9n9gxu.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 13 Mar 2005 20:07:40 -0500") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux) X-Virus-Scanned: by amavisd 0.1 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34791 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34791 Stefan Monnier wrote: >> 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, (I had to investigate what that really does, in case it worked out some fantastic magic. But afaics it doesn't. ;) > so I don't need to "see the whole pattern" (I basically keep track > of the intermediate state in the parse-partial-sexp state). If I understand this correctly, this means that your example falls under the special case when the construct can be recognized from the first line alone. Unfortunately things aren't always that easy.