From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: bug#5350: 23.1.91; error in c++-mode highlighting/indentation Date: Wed, 20 Jan 2010 13:03:59 +0000 Message-ID: <20100120130359.GC2573@muc.de> References: <87tyuuujpo.fsf@newton.homeunix.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263992264 25701 80.91.229.12 (20 Jan 2010 12:57:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Jan 2010 12:57:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jose Antonio Ortega Ruiz , 5350@debbugs.gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 20 13:57:36 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NXa7r-0003HC-SD for ged-emacs-devel@m.gmane.org; Wed, 20 Jan 2010 13:57:36 +0100 Original-Received: from localhost ([127.0.0.1]:36866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXa7s-0004Dd-OJ for ged-emacs-devel@m.gmane.org; Wed, 20 Jan 2010 07:57:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXa7m-0004Bs-Tt for emacs-devel@gnu.org; Wed, 20 Jan 2010 07:57:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXa7i-00046S-8D for emacs-devel@gnu.org; Wed, 20 Jan 2010 07:57:30 -0500 Original-Received: from [199.232.76.173] (port=35461 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXa7h-00046I-VD for emacs-devel@gnu.org; Wed, 20 Jan 2010 07:57:26 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:4522 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NXa7h-00046O-CR for emacs-devel@gnu.org; Wed, 20 Jan 2010 07:57:25 -0500 Original-Received: (qmail 6755 invoked by uid 3782); 20 Jan 2010 12:57:23 -0000 Original-Received: from acm.muc.de (pD9E234F0.dip.t-dialin.net [217.226.52.240]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Wed, 20 Jan 2010 13:57:22 +0100 Original-Received: (qmail 16916 invoked by uid 1000); 20 Jan 2010 13:03:59 -0000 Content-Disposition: inline In-Reply-To: <87tyuuujpo.fsf@newton.homeunix.net> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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 Xref: news.gmane.org gmane.emacs.devel:120259 Archived-At: Hi, Jose, On Sun, Jan 10, 2010 at 03:18:27PM +0100, Jose Antonio Ortega Ruiz wrote: > Hi, this is a bugs somewhere in c-mode syntactic analyser (or so it > seems). It happens to me in several circumstances; below i describe a > simple instance for a C++ file (i've seen it happening also in pure C > files). > 1) Start emacs with -nw and -Q > 2) Create a new C++ file, say test.cpp > 3) Insert the following text: > /* Copyright (C) 2009, 2100 Foo Industries */ > > #include > 4) When pressing the closing '>' an error occurs with the following > backtrace: I've just committed a patch which I think fixes this. Either update your bzr version of Emacs, or apply the following patch (and then byte-compile cc-langs.el, cc-engine.el, and cc-mode.el): *** cc-defs.el~ 2010-01-19 13:24:48.000000000 +0000 --- cc-defs.el 2010-01-19 17:23:44.000000000 +0000 *************** *** 1217,1228 **** ;; This macro does a hidden buffer change. `(progn (c-put-char-property ,beg 'category 'c-cpp-delimiter) ! (c-put-char-property ,end 'category 'c-cpp-delimiter))) (defmacro c-clear-cpp-delimiters (beg end) ;; This macro does a hidden buffer change. `(progn (c-clear-char-property ,beg 'category) ! (c-clear-char-property ,end 'category))) (defsubst c-comment-out-cpps () ;; Render all preprocessor constructs syntactically commented out. --- 1217,1230 ---- ;; This macro does a hidden buffer change. `(progn (c-put-char-property ,beg 'category 'c-cpp-delimiter) ! (if (< ,end (point-max)) ! (c-put-char-property ,end 'category 'c-cpp-delimiter)))) (defmacro c-clear-cpp-delimiters (beg end) ;; This macro does a hidden buffer change. `(progn (c-clear-char-property ,beg 'category) ! (if (< ,end (point-max)) ! (c-clear-char-property ,end 'category)))) (defsubst c-comment-out-cpps () ;; Render all preprocessor constructs syntactically commented out. -- Alan Mackenzie (Nuremberg, Germany).