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#18306: 24.4.50; emacs 24.4.5 hangs in c-mode with '[' character Date: Sat, 23 Aug 2014 11:18:37 +0000 (UTC) Organization: muc.de e.V. Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1408793622 16258 80.91.229.3 (23 Aug 2014 11:33:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Aug 2014 11:33:42 +0000 (UTC) To: gnu-emacs-bug@moderators.isc.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 23 13:33:32 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XL9Za-0007h1-0k for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Aug 2014 13:33:30 +0200 Original-Received: from localhost ([::1]:40704 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XL9ZZ-00086W-FH for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Aug 2014 07:33:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XL9Mp-0007O9-O8 for bug-gnu-emacs@gnu.org; Sat, 23 Aug 2014 07:20:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XL9Mi-0001Z9-Dy for bug-gnu-emacs@gnu.org; Sat, 23 Aug 2014 07:20:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XL9MZ-0001JT-DH; Sat, 23 Aug 2014 07:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XL9MY-0001Ro-T7; Sat, 23 Aug 2014 07:20:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <53F553DD.5000509@wordtronix.org> Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 23 Aug 2014 11:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18306 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: confirmed Original-Received: via spool by submit@debbugs.gnu.org id=B.14087927515496 (code B ref -1); Sat, 23 Aug 2014 11:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Aug 2014 11:19:11 +0000 Original-Received: from localhost ([127.0.0.1]:49948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XL9Lj-0001QZ-5h for submit@debbugs.gnu.org; Sat, 23 Aug 2014 07:19:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36470) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XL9Lf-0001QF-T8 for submit@debbugs.gnu.org; Sat, 23 Aug 2014 07:19:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XL9LT-00011t-BG for submit@debbugs.gnu.org; Sat, 23 Aug 2014 07:19:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XL9LT-00011p-8h for submit@debbugs.gnu.org; Sat, 23 Aug 2014 07:18:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XL9LM-0007FD-Ra for bug-gnu-emacs@gnu.org; Sat, 23 Aug 2014 07:18:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XL9LG-00010v-Jv for bug-gnu-emacs@gnu.org; Sat, 23 Aug 2014 07:18:48 -0400 Original-Received: from xvm-90.mit.edu ([18.181.2.90]:39110 helo=mod-relay.xvm.mit.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XL9LG-00010o-G1 for bug-gnu-emacs@gnu.org; Sat, 23 Aug 2014 07:18:42 -0400 Original-Received: by mod-relay.xvm.mit.edu (Postfix) id 1034F20F80; Sat, 23 Aug 2014 07:18:40 -0400 (EDT) Original-Received: from mail.muc.de (colin.muc.de [193.149.48.1]) by mod-relay.xvm.mit.edu (Postfix) with ESMTP id B9A9B2079D for ; Sat, 23 Aug 2014 07:18:39 -0400 (EDT) Original-Received: (qmail 79695 invoked by uid 8); 23 Aug 2014 11:18:37 -0000 Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 41 Original-NNTP-Posting-Host: news.muc.de Original-X-Trace: colin.muc.de 1408792717 79693 193.149.48.2 (23 Aug 2014 11:18:37 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: Sat, 23 Aug 2014 11:18:37 +0000 (UTC) User-Agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/8.4-RELEASE (amd64)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Sat, 23 Aug 2014 07:33:27 -0400 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:92620 Archived-At: Hi, Nick. nick wrote: > While in c-mode writing the line: char s[]; emacs hangs without update. > Obviously not happening in this bugreport mode. :/ . Yes, there was an infinite loop down in the fontification code. I think it's fixed now. Would you please try it out and confirm that it is indeed fixed. Either download and build the latest trunk, or apply this patch: diff -r 2cd4e65a2f5a cc-fonts.el --- a/cc-fonts.el Sat Aug 02 18:12:32 2014 +0000 +++ b/cc-fonts.el Sat Aug 23 10:36:15 2014 +0000 @@ -1088,14 +1088,11 @@ ;; initializing brace lists. (let (found) (while - (and (setq found - (c-syntactic-re-search-forward - "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t)) - (eq (char-before) ?\[)) - (backward-char) - (c-safe (c-forward-sexp 1)) - (setq found nil) - (setq brackets-after-id t)) + (and (setq found (c-syntactic-re-search-forward + "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t)) + (eq (char-before) ?\[) + (c-go-up-list-forward)) + (setq brackets-after-id t)) found)) (setq next-pos (match-beginning 0) Thanks for taking to trouble to report this bug. -- Alan Mackenzie (Nuremberg, Germany).