From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#5422: syntax highlighting bug Date: Thu, 6 Oct 2011 15:38:14 +0000 Message-ID: <20111006153814.GB3284@acm.acm> References: <201001191321.30279.blew@astro.uni.torun.pl> <9AFE9713-A3D7-49B9-BF21-920F91C067EF@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1317915788 9310 80.91.229.12 (6 Oct 2011 15:43:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Oct 2011 15:43:08 +0000 (UTC) Cc: "blew@astro.uni.torun.pl" , "5422@debbugs.gnu.org" <5422@debbugs.gnu.org> To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 06 17:43:03 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RBq6A-0006Eh-A2 for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2011 17:43:02 +0200 Original-Received: from localhost ([::1]:43251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBq69-0006nx-O4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2011 11:43:01 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBq66-0006nV-5q for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 11:42:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBq64-0005oj-Rj for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 11:42:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBq61-0005nr-AI; Thu, 06 Oct 2011 11:42:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RBq6A-0004Nc-CS; Thu, 06 Oct 2011 11:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 06 Oct 2011 15:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5422 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 5422-submit@debbugs.gnu.org id=B5422.131791577116819 (code B ref 5422); Thu, 06 Oct 2011 15:43:02 +0000 Original-Received: (at 5422) by debbugs.gnu.org; 6 Oct 2011 15:42:51 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBq5y-0004NE-Fb for submit@debbugs.gnu.org; Thu, 06 Oct 2011 11:42:50 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBq5v-0004N4-2j for 5422@debbugs.gnu.org; Thu, 06 Oct 2011 11:42:48 -0400 Original-Received: (qmail 94506 invoked by uid 3782); 6 Oct 2011 15:42:37 -0000 Original-Received: from acm.muc.de (pD9556B61.dip.t-dialin.net [217.85.107.97]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 06 Oct 2011 17:42:35 +0200 Original-Received: (qmail 5402 invoked by uid 1000); 6 Oct 2011 15:38:14 -0000 Content-Disposition: inline In-Reply-To: <9AFE9713-A3D7-49B9-BF21-920F91C067EF@swipnet.se> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 06 Oct 2011 11:43:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52294 Archived-At: On Tue, Oct 04, 2011 at 07:32:57AM +0200, Jan Djärv wrote: > Hello. > 3 okt 2011 kl. 22:59 skrev Glenn Morris : > > Bartosz Lew wrote: > >> This is just to report on some minor C++ syntax highlighting problem > >> in emacs. > >> when I write: > >> if (a < b->c()) { do this; } else { do that; } > >> two two things go wrong: > >> 1) parentheses matching doesn't work correctly > >> emacs matches the closing bracket of the if condition with the > >> "<" - "smaller > than" sign in the if condition. > >> 2) the automatic positioning of any code written below gets confused due to > >> this parentheses matching problem. > >> I use: > >> GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6) > >> of 2009-09-29 on x86-7.fedora.phx.redhat.com > > I am unable to reproduce this in any version of Emacs, including 23.1. > > If you still see the problem in the latest release, please send a > > complete example starting from emacs -Q. > > (There seem to have been some fixes in this area, eg > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4847 ) > This is one of the elusive cc-mode bugs that isn't easy to reproduce. > AFAIK it depends on some cache in cc-mode getting out of sync. So you > are more likely to see it on a large file you have edited in several > places. It might even depend on what kind of editing you have done. I > think this is a symptom of some underlying bug. > I see this in 23.3 and the trunk at least 2-3 times per day when > editing code with a lot of templates. The < and > are mistaken for > start/end brace or parentesis. The < and > are marked (with syntax-table text properties) as parens when they "look like" template brackets, as they sort of do in the OP's code. Many moons ago, < and > got marked as parens individually. Now they are only marked in pairs. This has quite likely fixed the OP's bug. > Save the file, kill the buffer, and reopen the file usually fixes it. Yes. But that "shouldn't" be necessary any more. > Jan D. -- Alan Mackenzie (Nuremberg, Germany).