From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Daniel Colascione Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Dec 2010 23:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7595 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 7595@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.12918493681996 (code B ref -1); Wed, 08 Dec 2010 23:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Dec 2010 23:02:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PQT27-0000W9-Qo for submit@debbugs.gnu.org; Wed, 08 Dec 2010 18:02:48 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PQT26-0000Vw-0Q for submit@debbugs.gnu.org; Wed, 08 Dec 2010 18:02:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQT7r-0007iZ-OL for submit@debbugs.gnu.org; Wed, 08 Dec 2010 18:08:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:36735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQT7r-0007iV-M8 for submit@debbugs.gnu.org; Wed, 08 Dec 2010 18:08:43 -0500 Received: from [140.186.70.92] (port=60938 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQT7q-000299-OK for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2010 18:08:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQT7p-0007i9-E1 for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2010 18:08:42 -0500 Received: from mail-pv0-f169.google.com ([74.125.83.169]:38996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQT7p-0007hx-8J for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2010 18:08:41 -0500 Received: by pvc30 with SMTP id 30so546153pvc.0 for ; Wed, 08 Dec 2010 15:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:x-enigmail-version:content-type; bh=2qqdN7SpEd4bp/yyvA//TTMqN4ithM+XEbAmLfmO4yI=; b=e3gR97l1T2mDqhavWwXU43nkhqa9VFUDXpGZ3c6nvEMMha3KavpYXER3dfmBtltqEL puqC67J8IYH1YbI8hvMlxgwlY074HGJuwUvvXZhkcDUvlKgeg8+Mp/eP+06WwR1KauCh V8SSy2X9CP/TDSbqKDNdSbbHjhs8EnVB+XOtA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type; b=PLP13Cnv08IrhdUHGbJn/drfBeSQFlaQ1B3tFk0DPNa4kY1eBvEKpsbCATcobgQEqY 67UzH6pgkeF9QTnq9FRY8mSzBSwEDQ90JXROA3NQyFuHsXBausEoJ1Ldbgc3FLHAfB7U Jv8xQI3WFk7i9Y0XuPlKa7P2dwpEcNQYpi1TI= Received: by 10.142.179.21 with SMTP id b21mr3288445wff.432.1291849719656; Wed, 08 Dec 2010 15:08:39 -0800 (PST) Received: from edith.local (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id w14sm1502378wfd.6.2010.12.08.15.08.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Dec 2010 15:08:38 -0800 (PST) Message-ID: <4D000FF1.10307@gmail.com> Date: Wed, 08 Dec 2010 15:08:33 -0800 From: Daniel Colascione User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigFC1669CA4B952DC18E1BD851" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.5 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFC1669CA4B952DC18E1BD851 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In a c-mode buf, press pound, then back, then M-e See eternal loop --------------enigFC1669CA4B952DC18E1BD851 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk0AD/QACgkQ17c2LVA10VvEggCgnmpIOdbIvP1Pi2IEJmiIh0Be MywAn3aleB/qoEbGl6znse6fvVJJjL56 =fvm5 -----END PGP SIGNATURE----- --------------enigFC1669CA4B952DC18E1BD851-- From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 16 Dec 2010 21:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Daniel Colascione Cc: 7595@debbugs.gnu.org Received: via spool by 7595-submit@debbugs.gnu.org id=B7595.129253431116751 (code B ref 7595); Thu, 16 Dec 2010 21:19:02 +0000 Received: (at 7595) by debbugs.gnu.org; 16 Dec 2010 21:18:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PTLDa-0004M8-R7 for submit@debbugs.gnu.org; Thu, 16 Dec 2010 16:18:31 -0500 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 1PTLDY-0004Lv-QG for 7595@debbugs.gnu.org; Thu, 16 Dec 2010 16:18:29 -0500 Received: (qmail 77691 invoked by uid 3782); 16 Dec 2010 21:24:47 -0000 Received: from acm.muc.de (pD9E52048.dip.t-dialin.net [217.229.32.72]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 16 Dec 2010 22:24:45 +0100 Received: (qmail 3539 invoked by uid 1000); 16 Dec 2010 21:39:16 -0000 Date: Thu, 16 Dec 2010 21:39:16 +0000 Message-ID: <20101216213915.GA3442@muc.de> References: <4D000FF1.10307@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D000FF1.10307@gmail.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) Hi again, Daniel! On Wed, Dec 08, 2010 at 03:08:33PM -0800, Daniel Colascione wrote: > In a c-mode buf, > press pound, then back, then M-e > See eternal loop > Would you try out the following patch, please, which I hope fixes the problem. (The line numbers will be a little different, but don't worry about that.) Let me know how well it works! Thanks. *** orig/cc-cmds.el 2010-12-12 21:08:40.000000000 +0000 --- cc-cmds.el 2010-12-16 20:55:30.778431600 +0000 *************** *** 2422,2434 **** (goto-char last) (throw 'done '(nil . nil))) ! ;; Stop if we encounter a preprocessor line. ! ((and (not macro-end) (eq (char-after) ?#) (= (point) (c-point 'boi))) ! (goto-char last) ! ;(throw 'done (cons (eq (point) here) 'macro-boundary))) ; Changed 2003/3/26 ! (throw 'done '(t . macro-boundary))) ;; Stop after a ';', '}', or "};" ((looking-at ";\\|};?") --- 2422,2435 ---- (goto-char last) (throw 'done '(nil . nil))) ! ;; Stop if we encounter a preprocessor line. Continue if we hit a naked # ! ((and c-opt-cpp-prefix ! (not macro-end) (eq (char-after) ?#) (= (point) (c-point 'boi))) ! (if (= (point) here) ; Not a macro, therefore naked #. ! (forward-char) ! (throw 'done '(t . macro-boundary)))) ;; Stop after a ';', '}', or "};" ((looking-at ";\\|};?") *************** *** 2627,2640 **** ;; Are we about to move forward into or out of a ;; preprocessor command? (when (eq (cdr res) 'macro-boundary) ! (save-excursion ! (end-of-line) ! (setq macro-fence ! (and (not (eobp)) ! (progn (c-skip-ws-forward) ! (c-beginning-of-macro)) ! (progn (c-end-of-macro) ! (point)))))) ;; Are we about to move forward into a literal? (when (memq (cdr res) '(macro-boundary literal)) (setq range (c-ascertain-following-literal))) --- 2628,2646 ---- ;; Are we about to move forward into or out of a ;; preprocessor command? (when (eq (cdr res) 'macro-boundary) ! (setq macro-fence ! (save-excursion ! (if macro-fence ! (progn ! (end-of-line) ! (and (not (eobp)) ! (progn (c-skip-ws-forward) ! (c-beginning-of-macro)) ! (progn (c-end-of-macro) ! (point)))) ! (and (not (eobp)) ! (c-beginning-of-macro) ! (progn (c-end-of-macro) (point))))))) ;; Are we about to move forward into a literal? (when (memq (cdr res) '(macro-boundary literal)) (setq range (c-ascertain-following-literal))) All the best! -- Alan Mackenzie (Nuremberg, Germany). From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Daniel Colascione Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 30 Jan 2011 23:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 7595@debbugs.gnu.org Received: via spool by 7595-submit@debbugs.gnu.org id=B7595.1296429412905 (code B ref 7595); Sun, 30 Jan 2011 23:17:01 +0000 Received: (at 7595) by debbugs.gnu.org; 30 Jan 2011 23:16:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjgVn-0000EX-6S for submit@debbugs.gnu.org; Sun, 30 Jan 2011 18:16:51 -0500 Received: from mail-pv0-f172.google.com ([74.125.83.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjgVl-0000EL-Os for 7595@debbugs.gnu.org; Sun, 30 Jan 2011 18:16:50 -0500 Received: by pvc21 with SMTP id 21so858683pvc.3 for <7595@debbugs.gnu.org>; Sun, 30 Jan 2011 15:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version :newsgroups:to:cc:subject:references:in-reply-to:x-enigmail-version :content-type:content-transfer-encoding; bh=QmKOlh0CvRe2ZaVJKtpECB9sUYRhDle3VHfCq4RLIx8=; b=tINdocQj3ZpCJLmdykaL9n0h2FkRFMCC0byWW4odoGPUaGohZW4RYwYpAcHSe4iWad vrA796E+CeQ6aKff1XHMBitbrO52ZA1kNH+YreHjMZtXxPYbRTttEP68q88p8QbN4gPT XdQhnSmqmx1agATyO6+dpmHPvGpMgJbgF0A7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:newsgroups:to:cc :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=DdAEd/89fBQIPJ2jJ109K7FxE6X6DwS0JCXntGPsUxcW9ByQSG+PBD5rDkHJizpG+9 SwrUb2NHDKkTcdE/hM6f//YYBEy510M2HZi4fnyPFs5zdMDZ3NlDoOaqX8qVjQCDH2Fj RuALTwy0wVLFOdKkfXOYfjIzTPr8KXFrFkzEE= Received: by 10.142.179.4 with SMTP id b4mr5436457wff.222.1296429907220; Sun, 30 Jan 2011 15:25:07 -0800 (PST) Received: from edith.local (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id y42sm27411237wfd.22.2011.01.30.15.25.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 30 Jan 2011 15:25:05 -0800 (PST) Message-ID: <4D45F34F.8030601@gmail.com> Date: Sun, 30 Jan 2011 15:25:03 -0800 From: Daniel Colascione User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 Newsgroups: gmane.emacs.bugs References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> In-Reply-To: <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Alan, On 12/16/10 1:39 PM, Alan Mackenzie wrote: > Would you try out the following patch, please, which I hope fixes the > problem. (The line numbers will be a little different, but don't worry > about that.) Let me know how well it works! Thanks. The patch seems to work well so far. I've replaced my workaround with it, and I'll let you know whether I see any problems. Thanks! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk1F800ACgkQ17c2LVA10Vvx1ACePFyNv1ooW1MYjWBBIOMsGHKK HtsAoJeHH5UH3YKBs7I89xkJh/lJ3RUZ =lsup -----END PGP SIGNATURE----- From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 31 Jan 2011 23:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Daniel Colascione Cc: 7595@debbugs.gnu.org, Alan Mackenzie Received: via spool by 7595-submit@debbugs.gnu.org id=B7595.129651479032042 (code B ref 7595); Mon, 31 Jan 2011 23:00:03 +0000 Received: (at 7595) by debbugs.gnu.org; 31 Jan 2011 22:59:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pk2ir-0008Kl-Fn for submit@debbugs.gnu.org; Mon, 31 Jan 2011 17:59:49 -0500 Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pk2ip-0008KY-RM for 7595@debbugs.gnu.org; Mon, 31 Jan 2011 17:59:48 -0500 Received: from furball (dhcp128036014143.central.yale.edu [128.36.14.143]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id p0VN88hI003436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 31 Jan 2011 18:08:08 -0500 Received: by furball (Postfix, from userid 1000) id CF295160681; Mon, 31 Jan 2011 18:08:05 -0500 (EST) From: Chong Yidong References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> Date: Mon, 31 Jan 2011 18:08:05 -0500 In-Reply-To: <4D45F34F.8030601@gmail.com> (Daniel Colascione's message of "Sun, 30 Jan 2011 15:25:03 -0800") Message-ID: <87tygo3c4q.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147 X-Spam-Score: -2.7 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Daniel Colascione writes: > Hi Alan, > > On 12/16/10 1:39 PM, Alan Mackenzie wrote: >> Would you try out the following patch, please, which I hope fixes the >> problem. (The line numbers will be a little different, but don't worry >> about that.) Let me know how well it works! Thanks. > > The patch seems to work well so far. I've replaced my workaround with > it, and I'll let you know whether I see any problems. I've committed Alan's patch to the branch, so that it will be in the forthcoming pretest. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 07 17:18:16 2011 Received: (at control) by debbugs.gnu.org; 7 Feb 2011 22:18:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PmZPT-0000Ab-St for submit@debbugs.gnu.org; Mon, 07 Feb 2011 17:18:16 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PmZPS-0000AQ-5z for control@debbugs.gnu.org; Mon, 07 Feb 2011 17:18:14 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1PmZXq-0003tf-4b for control@debbugs.gnu.org; Mon, 07 Feb 2011 17:26:54 -0500 Date: Mon, 07 Feb 2011 17:26:54 -0500 Message-Id: Subject: control message for bug 7595 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) close 7595 From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Daniel Colascione Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 06 Mar 2011 23:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: bug-gnu-emacs@gnu.org Cc: ""@dough.gmane.org Received: via spool by submit@debbugs.gnu.org id=B.129945454327872 (code B ref -1); Sun, 06 Mar 2011 23:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Mar 2011 23:35:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwNUF-0007FV-59 for submit@debbugs.gnu.org; Sun, 06 Mar 2011 18:35:43 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwNUC-0007F9-NH for submit@debbugs.gnu.org; Sun, 06 Mar 2011 18:35:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwNU6-0007Kb-7Q for submit@debbugs.gnu.org; Sun, 06 Mar 2011 18:35:35 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:41702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwNU5-0007KW-QI for submit@debbugs.gnu.org; Sun, 06 Mar 2011 18:35:34 -0500 Received: from [140.186.70.92] (port=45349 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwNU4-0006Xx-QO for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 18:35:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwNU3-0007K4-Jc for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 18:35:32 -0500 Received: from lo.gmane.org ([80.91.229.12]:43608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwNU3-0007Jo-9q for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 18:35:31 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PwNU1-0001TW-No for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:35:29 +0100 Received: from c-67-183-23-114.hsd1.wa.comcast.net ([67.183.23.114]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Mar 2011 00:35:29 +0100 Received: from dan.colascione by c-67-183-23-114.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Mar 2011 00:35:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ From: Daniel Colascione Date: Sun, 06 Mar 2011 15:35:17 -0800 Lines: 71 Message-ID: <4D741A35.9030501@gmail.com> References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-67-183-23-114.hsd1.wa.comcast.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.4 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) On 1/31/2011 3:08 PM, Chong Yidong wrote: > Daniel Colascione writes: > >> Hi Alan, >> >> On 12/16/10 1:39 PM, Alan Mackenzie wrote: >>> Would you try out the following patch, please, which I hope fixes the >>> problem. (The line numbers will be a little different, but don't worry >>> about that.) Let me know how well it works! Thanks. >> >> The patch seems to work well so far. I've replaced my workaround with >> it, and I'll let you know whether I see any problems. > > I've committed Alan's patch to the branch, so that it will be in the > forthcoming pretest. The following patch repairs a defect in the original that results in an infinite loop in c-beginning-of-statement under the following circumstance: 1 #define some_macro value 2 3 [P] 4 Where [P] denotes the point. === modified file 'lisp/progmodes/cc-cmds.el' --- lisp/progmodes/cc-cmds.el 2011-03-04 03:53:00 +0000 +++ lisp/progmodes/cc-cmds.el 2011-03-06 06:20:02 +0000 @@ -2518,6 +2518,8 @@ (c-save-buffer-state ((count (or count 1)) last ; start point for going back ONE chunk. Updated each chunk movement. + + ;; Beginning of current or previous macro (macro-fence (save-excursion (and (not (bobp)) (c-beginning-of-macro) (point)))) res ; result from sub-function call @@ -2580,19 +2582,15 @@ ;; Are we about to move backwards into or out of a ;; preprocessor command? If so, locate its beginning. (when (eq (cdr res) 'macro-boundary) - (setq macro-fence - (save-excursion - (if macro-fence - (progn - (end-of-line) - (and (not (eobp)) - (progn (c-skip-ws-forward) - (c-beginning-of-macro)) - (progn (c-end-of-macro) - (point)))) - (and (not (eobp)) - (c-beginning-of-macro) - (progn (c-end-of-macro) (point))))))) + ;; c-back-over-illiterals stopped at the + ;; first non-whitespace character after + ;; the macro end, so the previous nonblank + ;; line should be the macro. + (setq macro-fence + (save-excursion + (c-backward-comments) + (point)))) + ;; Are we about to move backwards into a literal? (when (memq (cdr res) '(macro-boundary literal)) (setq range (c-ascertain-preceding-literal))) From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Daniel Colascione Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 06 Mar 2011 23:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Chong Yidong Cc: 7595@debbugs.gnu.org, acm@muc.de Received: via spool by 7595-submit@debbugs.gnu.org id=B7595.129945454127860 (code B ref 7595); Sun, 06 Mar 2011 23:36:02 +0000 Received: (at 7595) by debbugs.gnu.org; 6 Mar 2011 23:35:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwNUC-0007FI-K0 for submit@debbugs.gnu.org; Sun, 06 Mar 2011 18:35:41 -0500 Received: from mail-pw0-f44.google.com ([209.85.160.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwNUA-0007F2-0h for 7595@debbugs.gnu.org; Sun, 06 Mar 2011 18:35:38 -0500 Received: by pwi5 with SMTP id 5so729463pwi.3 for <7595@debbugs.gnu.org>; Sun, 06 Mar 2011 15:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version :newsgroups:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=mHqmFGzfZ37F3toh5jjU4d63NU0tAZNhS8TpnFIz2Uo=; b=BmoZ+fr6bFSQR7p1n9RH2TWD/dTA16HqLAterwpgPnE7QEmM+3eXpj0/D1B3JdVaWU HJPG44BZdqXuUBz0J0WWdCnMJfYbVrTBTY13JPlCrAErlFjEPFQztTRHJaqKAumgGRR6 rFNq2wRkVH+3L8BHzuxB/vyUnC9Bx0WOWZHkU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:newsgroups:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; b=P4H6Zh7i/i6AastDaPrMfjObvUwYyLZC/GkyI7jUHh01dXpSnHzewsA+MKTEH+4VGq BUpBMeUikz7xFSVIQZIMI0qUk9nWIwS4323caGaAoutQqyEskEdwbnzZbWxIezqPUveG gyMC79h4I1dtWywqLhCxCwdhhjx+E5H/0gPac= Received: by 10.142.253.20 with SMTP id a20mr2796002wfi.190.1299454531968; Sun, 06 Mar 2011 15:35:31 -0800 (PST) Received: from [0.0.0.0] (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id n4sm3477961wfl.14.2011.03.06.15.35.29 (version=SSLv3 cipher=OTHER); Sun, 06 Mar 2011 15:35:30 -0800 (PST) Message-ID: <4D741A40.7090204@gmail.com> Date: Sun, 06 Mar 2011 15:35:28 -0800 From: Daniel Colascione User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 Newsgroups: gmane.emacs.bugs References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> In-Reply-To: <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) On 1/31/2011 3:08 PM, Chong Yidong wrote: > Daniel Colascione writes: > >> Hi Alan, >> >> On 12/16/10 1:39 PM, Alan Mackenzie wrote: >>> Would you try out the following patch, please, which I hope fixes the >>> problem. (The line numbers will be a little different, but don't worry >>> about that.) Let me know how well it works! Thanks. >> >> The patch seems to work well so far. I've replaced my workaround with >> it, and I'll let you know whether I see any problems. > > I've committed Alan's patch to the branch, so that it will be in the > forthcoming pretest. The following patch repairs a defect in the original that results in an infinite loop in c-beginning-of-statement under the following circumstance: 1 #define some_macro value 2 3 [P] 4 Where [P] denotes the point. === modified file 'lisp/progmodes/cc-cmds.el' --- lisp/progmodes/cc-cmds.el 2011-03-04 03:53:00 +0000 +++ lisp/progmodes/cc-cmds.el 2011-03-06 06:20:02 +0000 @@ -2518,6 +2518,8 @@ (c-save-buffer-state ((count (or count 1)) last ; start point for going back ONE chunk. Updated each chunk movement. + + ;; Beginning of current or previous macro (macro-fence (save-excursion (and (not (bobp)) (c-beginning-of-macro) (point)))) res ; result from sub-function call @@ -2580,19 +2582,15 @@ ;; Are we about to move backwards into or out of a ;; preprocessor command? If so, locate its beginning. (when (eq (cdr res) 'macro-boundary) - (setq macro-fence - (save-excursion - (if macro-fence - (progn - (end-of-line) - (and (not (eobp)) - (progn (c-skip-ws-forward) - (c-beginning-of-macro)) - (progn (c-end-of-macro) - (point)))) - (and (not (eobp)) - (c-beginning-of-macro) - (progn (c-end-of-macro) (point))))))) + ;; c-back-over-illiterals stopped at the + ;; first non-whitespace character after + ;; the macro end, so the previous nonblank + ;; line should be the macro. + (setq macro-fence + (save-excursion + (c-backward-comments) + (point)))) + ;; Are we about to move backwards into a literal? (when (memq (cdr res) '(macro-boundary literal)) (setq range (c-ascertain-preceding-literal))) From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 07 Mar 2011 04:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Daniel Colascione Cc: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129947319027872 (code B ref -1); Mon, 07 Mar 2011 04:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 04:46:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwSKz-0007FU-P2 for submit@debbugs.gnu.org; Sun, 06 Mar 2011 23:46:29 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwSKy-0007FH-D3 for submit@debbugs.gnu.org; Sun, 06 Mar 2011 23:46:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwSKs-0006jG-Kv for submit@debbugs.gnu.org; Sun, 06 Mar 2011 23:46:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:47505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwSKs-0006jC-Il for submit@debbugs.gnu.org; Sun, 06 Mar 2011 23:46:22 -0500 Received: from [140.186.70.92] (port=42521 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwSKp-0006kf-V7 for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 23:46:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwSKp-0006iZ-4Y for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 23:46:19 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:44285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwSKp-0006iV-2t for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 23:46:19 -0500 Received: from cyd by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1PwSKo-0000C7-LA; Sun, 06 Mar 2011 23:46:18 -0500 From: Chong Yidong References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> <4D741A35.9030501@gmail.com> Date: Sun, 06 Mar 2011 23:46:18 -0500 In-Reply-To: <4D741A35.9030501@gmail.com> (Daniel Colascione's message of "Sun, 06 Mar 2011 15:35:17 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) Daniel Colascione writes: > The following patch repairs a defect in the original that results in > an infinite loop in c-beginning-of-statement under the following > circumstance: > > 1 #define some_macro value > 2 > 3 [P] > 4 > > Where [P] denotes the point. Le sigh. We can't keep 23.3 on hold while refining this code, with the problems in each iteration taking one whole month to surface. FWIW, in my day to day usage of the 23.3 release candidate, I haven't encountered any looping problems. Did you come across this in a real world situation? If so, please describe it, and we will shall see if we just have to bite the bullet and continue pretesting. But if it does not trigger for realistic usage, I prefer to leave matters as they are for 23.3---i.e. swapping one rare infloop in 23.2 (Bug#7595) for a different one in 23.3 (the above). From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 07 Mar 2011 05:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Daniel Colascione Cc: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129947403629056 (code B ref -1); Mon, 07 Mar 2011 05:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 05:00:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwSYe-0007Yb-3Z for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:00:36 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwSYb-0007YP-PW for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:00:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwSYW-0000Cj-6X for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:00:29 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:57525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwSYW-0000Cf-42 for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:00:28 -0500 Received: from [140.186.70.92] (port=58719 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwSYU-0001jw-KB for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:00:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwSYS-0000Bm-Gd for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:00:26 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:60692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwSYS-0000Bi-8s for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:00:24 -0500 Received: from cyd by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1PwSYR-0000aS-LF; Mon, 07 Mar 2011 00:00:23 -0500 From: Chong Yidong References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> <4D741A35.9030501@gmail.com> Date: Mon, 07 Mar 2011 00:00:23 -0500 In-Reply-To: <4D741A35.9030501@gmail.com> (Daniel Colascione's message of "Sun, 06 Mar 2011 15:35:17 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) > we will shall see if we just have to bite the bullet and continue > pretesting. But if it does not trigger for realistic usage, I prefer > to leave matters as they are for 23.3---i.e. swapping one rare infloop > in 23.2 (Bug#7595) for a different one in 23.3 (the above). On reflection, it's probably better to revert the original fix for 7595, and go back to the (problematic) prior behavior. As for the patch you proposed, it doesn't look obvious and safe enough to include at this late stage. From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Daniel Colascione Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 07 Mar 2011 05:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Chong Yidong Cc: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129947491730281 (code B ref -1); Mon, 07 Mar 2011 05:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 05:15:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwSmr-0007sL-CN for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:15:17 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwSmo-0007s8-OE for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:15:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwSmi-0002gP-FT for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:15:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:41276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwSmi-0002gE-Cv for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:15:08 -0500 Received: from [140.186.70.92] (port=53407 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwSmg-0005xE-L6 for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:15:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwSmf-0002fi-O2 for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:15:06 -0500 Received: from mail-pw0-f41.google.com ([209.85.160.41]:61198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwSmf-0002fU-JO for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:15:05 -0500 Received: by pwi10 with SMTP id 10so1107174pwi.0 for ; Sun, 06 Mar 2011 21:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=/cm0HT/pP6R5MJv6kTblGRicmLk2/Plt+FCSBy5JIkM=; b=CJNjixTvpxnR9dEULGtZZnxf0Ecz/CYWQvBO5nyawqh3aQGN9lgiQWdd2h4zWpxA/d iSCKGtU2GEDS5hPKzCcnCOTpy5bRqDZPFzO6OAc4YK7ztPYZZVqzntFmbSEbrim4ijkA 0/3cQs6ysjo783dPu7vxjmQkT+z4452b6N6VA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=GhlSWrIXeUuZv6gyPV8NM3mRdrgDS8p+4TIHMKAv1sQ6dR6wb+6v0s16B/hHKgo7GL P2RHeiHgRcpZQO1jhBgXzpnJYIckJibvAJgop81jIbXuGsVsR1JH7LuhtivQ9DlIyksV Hg2lqwxIH4X/4TUj5fLC3AjAR3AF/htWw0h5E= Received: by 10.142.202.18 with SMTP id z18mr2883377wff.438.1299474904435; Sun, 06 Mar 2011 21:15:04 -0800 (PST) Received: from [0.0.0.0] (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id 25sm3863000wfb.10.2011.03.06.21.15.02 (version=SSLv3 cipher=OTHER); Sun, 06 Mar 2011 21:15:03 -0800 (PST) Message-ID: <4D7469D5.3000001@gmail.com> Date: Sun, 06 Mar 2011 21:15:01 -0800 From: Daniel Colascione User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> <4D741A35.9030501@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.5 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) On 3/6/2011 9:00 PM, Chong Yidong wrote: >> we will shall see if we just have to bite the bullet and continue >> pretesting. But if it does not trigger for realistic usage, I prefer >> to leave matters as they are for 23.3---i.e. swapping one rare infloop >> in 23.2 (Bug#7595) for a different one in 23.3 (the above). > On reflection, it's probably better to revert the original fix for 7595, > and go back to the (problematic) prior behavior. As for the patch you > proposed, it doesn't look obvious and safe enough to include at this > late stage. That's probably the safest course for now. The original patch adds a fair amount of logic, and I'm not entirely convinced myself it's the right thing. This simple workaround fixes the immediate issue raised in bug 7595: === modified file 'lisp/progmodes/cc-cmds.el' --- lisp/progmodes/cc-cmds.el 2010-10-31 11:54:02 +0000 +++ lisp/progmodes/cc-cmds.el 2010-12-09 00:18:26 +0000 @@ -2616,6 +2616,11 @@ (setq count 0) nil) + ((looking-at "^\\s-*#\\s-*$") + (setq count 0) + (end-of-line) + nil) + (range ; point is within a literal. (cond ;; sentence-flag is null => skip the entire literal. From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 07 Mar 2011 19:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Chong Yidong Cc: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org, Daniel Colascione , Stefan Monnier Received: via spool by submit@debbugs.gnu.org id=B.129952711416874 (code B ref -1); Mon, 07 Mar 2011 19:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 19:45:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwgMk-0004O7-9U for submit@debbugs.gnu.org; Mon, 07 Mar 2011 14:45:14 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwgMh-0004Nu-Ju for submit@debbugs.gnu.org; Mon, 07 Mar 2011 14:45:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwgMb-0001pg-Ml for submit@debbugs.gnu.org; Mon, 07 Mar 2011 14:45:06 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:36883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwgMb-0001pa-KJ for submit@debbugs.gnu.org; Mon, 07 Mar 2011 14:45:05 -0500 Received: from [140.186.70.92] (port=52742 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwgMW-0002zm-S6 for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 14:45:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwgMV-0001oN-Jt for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 14:45:00 -0500 Received: from colin.muc.de ([193.149.48.1]:2703 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwgMV-0001oF-8m for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 14:44:59 -0500 Received: (qmail 3416 invoked by uid 3782); 7 Mar 2011 19:38:15 -0000 Received: from acm.muc.de (pD9E513F9.dip.t-dialin.net [217.229.19.249]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 07 Mar 2011 20:38:13 +0100 Received: (qmail 3043 invoked by uid 1000); 7 Mar 2011 19:54:41 -0000 Date: Mon, 7 Mar 2011 19:54:41 +0000 Message-ID: <20110307195441.GA2488@muc.de> References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> <4D741A35.9030501@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Hi, Yidong, Daniel, Stefan! First thing about Daniel's bug: it doesn't occur in the stand-alone CC Mode running on Emacs 23.2; this version of CC Mode contains my original patch from a couple of months ago. Before applying a fix to the current bug (Daniel, are you sure the current bug is the "same" (whatever that means) as the original bug?), I'd like to work out what the difference is between stand-alone CC Mode and the one in Emacs-23.3/..../lisp/progmodes. On Mon, Mar 07, 2011 at 12:00:23AM -0500, Chong Yidong wrote: > > we will shall see if we just have to bite the bullet and continue > > pretesting. But if it does not trigger for realistic usage, I > > prefer to leave matters as they are for 23.3---i.e. swapping one > > rare infloop in 23.2 (Bug#7595) for a different one in 23.3 (the > > above). They're nasty little things which are going to happen occasionally (on perfectly normal buffer content) when people are frobbing random key sequences. Does that count as "realistic usage"? > On reflection, it's probably better to revert the original fix for > 7595, and go back to the (problematic) prior behavior. As for the > patch you proposed, it doesn't look obvious and safe enough to include > at this late stage. Aww! Are you convinced that the two bugs here really are two aspects of the same bug? If not, I'd propose leaving in the 7595 fix. If my patch for 7595 is taken out, does the most recent bug still happen? -- Alan Mackenzie (Nuremberg, Germany). From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 07 Mar 2011 20:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org, Daniel Colascione , Stefan Monnier Received: via spool by submit@debbugs.gnu.org id=B.129952857418966 (code B ref -1); Mon, 07 Mar 2011 20:10:03 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 20:09:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwgkI-0004vq-Hm for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:09:34 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwgkG-0004ve-Kd for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:09:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwgkA-00068P-Mw for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:09:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:40059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwgkA-00068G-Kq for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:09:26 -0500 Received: from [140.186.70.92] (port=38378 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pwgk9-000168-AY for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 15:09:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pwgk8-00067y-8E for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 15:09:25 -0500 Received: from vm-emlprdomr-04.its.yale.edu ([130.132.50.145]:36348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pwgk8-00067u-4Z; Mon, 07 Mar 2011 15:09:24 -0500 Received: from furball (dhcp128036014164.central.yale.edu [128.36.14.164]) (authenticated bits=0) by vm-emlprdomr-04.its.yale.edu (8.14.4/8.14.4) with ESMTP id p27K9KZC010455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 7 Mar 2011 15:09:21 -0500 Received: by furball (Postfix, from userid 1000) id 9CF991604BC; Mon, 7 Mar 2011 15:09:21 -0500 (EST) From: Chong Yidong References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> <4D741A35.9030501@gmail.com> <20110307195441.GA2488@muc.de> Date: Mon, 07 Mar 2011 15:09:21 -0500 In-Reply-To: <20110307195441.GA2488@muc.de> (Alan Mackenzie's message of "Mon, 7 Mar 2011 19:54:41 +0000") Message-ID: <87hbben15a.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.145 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -4.7 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) Alan Mackenzie writes: > First thing about Daniel's bug: it doesn't occur in the stand-alone CC > Mode running on Emacs 23.2; this version of CC Mode contains my original > patch from a couple of months ago. > > Before applying a fix to the current bug (Daniel, are you sure the > current bug is the "same" (whatever that means) as the original bug?), > I'd like to work out what the difference is between stand-alone CC Mode > and the one in Emacs-23.3/..../lisp/progmodes. OK, I see the problem. The patch you supplied in the email was not applied correctly to the brach. The second hunk ended up in c-beginning-of-statement. So, it looks like my fault, and I'm not sure how it happened (maybe due to the line number mismatch). Sorry. With this corrected in the branch, the new problem goes away. I will make a second release candidate with this fix. From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 07 Mar 2011 20:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Chong Yidong Cc: bug-gnu-emacs@gnu.org, Daniel Colascione , Stefan Monnier Received: via spool by submit@debbugs.gnu.org id=B.129953037621564 (code B ref -1); Mon, 07 Mar 2011 20:40:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 20:39:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwhDM-0005bl-28 for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:39:36 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwhDJ-0005bY-IB for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:39:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwhDB-00043I-JW for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:39:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:40058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwhDB-000437-Gt for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:39:25 -0500 Received: from [140.186.70.92] (port=58155 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwhDA-0005wd-39 for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 15:39:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwhD8-00042d-7v for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 15:39:23 -0500 Received: from colin.muc.de ([193.149.48.1]:4548 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwhD7-00042R-SU for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 15:39:22 -0500 Received: (qmail 8714 invoked by uid 3782); 7 Mar 2011 20:39:19 -0000 Received: from acm.muc.de (pD9E513F9.dip.t-dialin.net [217.229.19.249]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 07 Mar 2011 21:39:18 +0100 Received: (qmail 3845 invoked by uid 1000); 7 Mar 2011 20:55:46 -0000 Date: Mon, 7 Mar 2011 20:55:46 +0000 Message-ID: <20110307205546.GB2488@muc.de> References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> <4D741A35.9030501@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) Hi, all! On Mon, Mar 07, 2011 at 12:00:23AM -0500, Chong Yidong wrote: > > we will shall see if we just have to bite the bullet and continue > > pretesting. But if it does not trigger for realistic usage, I prefer > > to leave matters as they are for 23.3---i.e. swapping one rare infloop > > in 23.2 (Bug#7595) for a different one in 23.3 (the above). > On reflection, it's probably better to revert the original fix for 7595, > and go back to the (problematic) prior behavior. As for the patch you > proposed, it doesn't look obvious and safe enough to include at this > late stage. Daniel, you correctly identified the wrong bit of code in your proposed patch. What has happened is that the code in c-beginning-of-statement which handles macros has been replaced by the analogous code from c-END-of-statement. This is totally crazy and totally wrong. I've no record of doing this myself, there's nothing about it I can find in .../lisp/ChangeLog, so, as yet, I've no idea how it happened. I think the best solution is to reverse this mysterious change, making c-b-o-s again identical to the version in Emacs 23.2 (modulo a corrected typo in a comment). Here is a patch which does exactly that: === modified file 'lisp/progmodes/cc-cmds.el' *** lisp/progmodes/cc-cmds.el 2011-02-20 18:36:29 +0000 --- lisp/progmodes/cc-cmds.el 2011-03-07 20:39:34 +0000 *************** *** 2564,2582 **** ;; Are we about to move backwards into or out of a ;; preprocessor command? If so, locate its beginning. (when (eq (cdr res) 'macro-boundary) ! (setq macro-fence ! (save-excursion ! (if macro-fence ! (progn ! (end-of-line) ! (and (not (eobp)) ! (progn (c-skip-ws-forward) ! (c-beginning-of-macro)) ! (progn (c-end-of-macro) ! (point)))) ! (and (not (eobp)) ! (c-beginning-of-macro) ! (progn (c-end-of-macro) (point))))))) ;; Are we about to move backwards into a literal? (when (memq (cdr res) '(macro-boundary literal)) (setq range (c-ascertain-preceding-literal))) --- 2564,2575 ---- ;; Are we about to move backwards into or out of a ;; preprocessor command? If so, locate its beginning. (when (eq (cdr res) 'macro-boundary) ! (save-excursion ! (beginning-of-line) ! (setq macro-fence ! (and (not (bobp)) ! (progn (c-skip-ws-backward) (c-beginning-of-macro)) ! (point))))) ;; Are we about to move backwards into a literal? (when (memq (cdr res) '(macro-boundary literal)) (setq range (c-ascertain-preceding-literal))) What does everybody think? -- Alan Mackenzie (Nuremberg, Germany). From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 07 Mar 2011 20:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Chong Yidong Cc: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org, Daniel Colascione , Stefan Monnier Received: via spool by submit@debbugs.gnu.org id=B.129953080422165 (code B ref -1); Mon, 07 Mar 2011 20:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 20:46:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwhKF-0005lS-Jk for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:46:43 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwhKD-0005lG-CW for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:46:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwhK7-0005at-B6 for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:46:36 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:55708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwhJu-0005Ww-0V for submit@debbugs.gnu.org; Mon, 07 Mar 2011 15:46:35 -0500 Received: from [140.186.70.92] (port=36237 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwhJh-0000LQ-3d for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 15:46:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwhJa-0005V1-1l for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 15:46:04 -0500 Received: from colin.muc.de ([193.149.48.1]:1427 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwhJZ-0005Ur-LY for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 15:46:02 -0500 Received: (qmail 9409 invoked by uid 3782); 7 Mar 2011 20:45:59 -0000 Received: from acm.muc.de (pD9E513F9.dip.t-dialin.net [217.229.19.249]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 07 Mar 2011 21:45:57 +0100 Received: (qmail 3952 invoked by uid 1000); 7 Mar 2011 21:02:25 -0000 Date: Mon, 7 Mar 2011 21:02:25 +0000 Message-ID: <20110307210225.GC2488@muc.de> References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> <4D741A35.9030501@gmail.com> <20110307195441.GA2488@muc.de> <87hbben15a.fsf@stupidchicken.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87hbben15a.fsf@stupidchicken.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) Hi, Yidong, On Mon, Mar 07, 2011 at 03:09:21PM -0500, Chong Yidong wrote: > Alan Mackenzie writes: > > First thing about Daniel's bug: it doesn't occur in the stand-alone CC > > Mode running on Emacs 23.2; this version of CC Mode contains my original > > patch from a couple of months ago. > > Before applying a fix to the current bug (Daniel, are you sure the > > current bug is the "same" (whatever that means) as the original bug?), > > I'd like to work out what the difference is between stand-alone CC Mode > > and the one in Emacs-23.3/..../lisp/progmodes. > OK, I see the problem. The patch you supplied in the email was not > applied correctly to the branch. The second hunk ended up in > c-beginning-of-statement. I think the problem is in the Emacs 24 trunk, too. > So, it looks like my fault, and I'm not sure how it happened (maybe due > to the line number mismatch). Sorry. > With this corrected in the branch, the new problem goes away. I will > make a second release candidate with this fix. Excellent! Thanks for finding it. -- Alan Mackenzie (Nuremberg, Germany). From unknown Tue Aug 19 10:25:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Resent-From: Daniel Colascione Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 08 Mar 2011 07:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7595 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: bug-cc-mode@gnu.org, Chong Yidong , bug-gnu-emacs@gnu.org, Stefan Monnier Received: via spool by submit@debbugs.gnu.org id=B.129956914211144 (code B ref -1); Tue, 08 Mar 2011 07:26:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Mar 2011 07:25:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwrIc-0002tg-48 for submit@debbugs.gnu.org; Tue, 08 Mar 2011 02:25:42 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwrIa-0002tV-LH for submit@debbugs.gnu.org; Tue, 08 Mar 2011 02:25:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwrIU-0002u7-I7 for submit@debbugs.gnu.org; Tue, 08 Mar 2011 02:25:35 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:45174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwrIU-0002u1-Ey for submit@debbugs.gnu.org; Tue, 08 Mar 2011 02:25:34 -0500 Received: from [140.186.70.92] (port=45103 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwrIT-0003IQ-1O for bug-gnu-emacs@gnu.org; Tue, 08 Mar 2011 02:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwrIR-0002tP-Ni for bug-gnu-emacs@gnu.org; Tue, 08 Mar 2011 02:25:32 -0500 Received: from mail-gw0-f51.google.com ([74.125.83.51]:56142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwrIR-0002tD-Kr; Tue, 08 Mar 2011 02:25:31 -0500 Received: by gwb15 with SMTP id 15so2532114gwb.38 for ; Mon, 07 Mar 2011 23:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type; bh=V8/UeH5os8URGywgLebUVJ5bx7GjHNNyQMVFeGBA+Ks=; b=Qk/+kS64g33UCac4DtCX3YthvgLZUK/EbMpfbtE784KLJ+bu1kvSC8mj4qDYc7hGnE 73d+z0o1q/OLOIOQY2EvQO08bvWvwDpIVLSrep9cJH2neFBBB+hzkrwQjLGudso85Qzy Z3FBe0sHWfwtEyrpsoTOr3YJapxcPNL5GRyIg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=lul8qAyQ33HMdcvOh+v2s3cKS4rpqLjwj56Ob6chDZK5EMX04yfHfd8x6D3NQnXS0k KBTAy4Pa3RKi1Bw+NhvzwCmZaZqEsBDFaVNm+4H/EsOmwWoFZOD89m/Kjz+wDkNjA9OK /etVwdykCbf8hja6IrmtZCbttmI0IwXSLtnvY= Received: by 10.150.163.20 with SMTP id l20mr5664439ybe.249.1299569130209; Mon, 07 Mar 2011 23:25:30 -0800 (PST) Received: from [192.168.1.2] (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id v13sm2318885ybk.6.2011.03.07.23.25.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Mar 2011 23:25:29 -0800 (PST) Message-ID: <4D75D9E4.7030802@gmail.com> Date: Mon, 07 Mar 2011 23:25:24 -0800 From: Daniel Colascione User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 References: <4D000FF1.10307@gmail.com> <20101216213915.GA3442__49696.8405823738$1292537376$gmane$org@muc.de> <4D45F34F.8030601@gmail.com> <87tygo3c4q.fsf__35531.9466595121$1296517007$gmane$org@stupidchicken.com> <4D741A35.9030501@gmail.com> <20110307195441.GA2488@muc.de> <87hbben15a.fsf@stupidchicken.com> <20110307210225.GC2488@muc.de> In-Reply-To: <20110307210225.GC2488@muc.de> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigCBD0CE65F7D80ED4C5131241" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.5 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigCBD0CE65F7D80ED4C5131241 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Alan, Yidong, On 3/7/11 1:02 PM, Alan Mackenzie wrote: > I think the problem is in the Emacs 24 trunk, too. >=20 >> So, it looks like my fault, and I'm not sure how it happened (maybe du= e >> to the line number mismatch). Sorry. >=20 >> With this corrected in the branch, the new problem goes away. I will >> make a second release candidate with this fix. >=20 > Excellent! Thanks for finding it. >=20 Thanks for looking into this: by the time I get a chance to relax for the day and check my email, it's already fixed. :-) It never even occurred to me that the patch wasn't properly applied, or that I should check against the cc-mode CVS; I usually hew closer to the Emacs trunk cc-mode. I've never seen patch botch a modification like this before. Out of curiosity, I rolled my branch back to the state it was in when I applied your patch manually, and it worked fine (albeit with frighteningly mismatched line numbers). I wonder how many other silently misapplied changes are lurking in the code. Maybe we should start including more context in our diffs? Alan, by the way: have you considered keeping cc-mode HEAD in a dvcs? It'd make synchronizing the various codebases easier, and it'd be possible to simply issue pull requests instead of emailing patches or manually making multiple checkins. Thanks, Daniel Colascione --------------enigCBD0CE65F7D80ED4C5131241 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk112eYACgkQ17c2LVA10Vs2XACfb7ZipPP4GpFESwY/vc7n//aR AH8AniPpv0R4lXDJCTXWsoF4amgBjZci =yZSh -----END PGP SIGNATURE----- --------------enigCBD0CE65F7D80ED4C5131241--