From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.bugs Subject: bug#7595: Infinite loop in cc-mode, or the coming of autumn Date: Sun, 06 Mar 2011 21:15:01 -0800 Message-ID: <4D7469D5.3000001@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> <4D741A35.9030501@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1299476227 25694 80.91.229.12 (7 Mar 2011 05:37:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Mar 2011 05:37:07 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 07 06:37:03 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PwT7u-0002Tz-V2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Mar 2011 06:37:03 +0100 Original-Received: from localhost ([127.0.0.1]:45188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwT7u-00028d-2Q for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Mar 2011 00:37:02 -0500 Original-Received: from [140.186.70.92] (port=43779 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwT7n-00028U-8q for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:36:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwT7m-00060I-4g for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 00:36:55 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwT7k-0005zf-74; Mon, 07 Mar 2011 00:36:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PwSna-0007tI-De; Mon, 07 Mar 2011 00:16:02 -0500 X-Loop: help-debbugs@gnu.org 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: Original-Received: via spool by submit@debbugs.gnu.org id=B.129947491730281 (code B ref -1); Mon, 07 Mar 2011 05:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 05:15:17 +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 1PwSmr-0007sL-CN for submit@debbugs.gnu.org; Mon, 07 Mar 2011 00:15:17 -0500 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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= Original-Received: by 10.142.202.18 with SMTP id z18mr2883377wff.438.1299474904435; Sun, 06 Mar 2011 21:15:04 -0800 (PST) Original-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) 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: 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 07 Mar 2011 00:16:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44730 Archived-At: 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.