From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#3424: marked as done (align-regexp: Infinite loop with default regexp) Date: Sun, 14 Jun 2009 05:55:06 +0000 Message-ID: References: <87ljnv5pl7.fsf@iki.fi> <87my8upk47.fsf@iki.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1244958906-15340-0" X-Trace: ger.gmane.org 1244959059 21780 80.91.229.12 (14 Jun 2009 05:57:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Jun 2009 05:57:39 +0000 (UTC) To: Teemu Likonen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 14 07:57:36 2009 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.50) id 1MFiil-0004RS-8g for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jun 2009 07:57:35 +0200 Original-Received: from localhost ([127.0.0.1]:48563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MFiik-0008Jv-Fd for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jun 2009 01:57:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MFiie-0008Jm-5s for bug-gnu-emacs@gnu.org; Sun, 14 Jun 2009 01:57:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MFiiY-0008GQ-VD for bug-gnu-emacs@gnu.org; Sun, 14 Jun 2009 01:57:27 -0400 Original-Received: from [199.232.76.173] (port=41029 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MFiiY-0008GN-OH for bug-gnu-emacs@gnu.org; Sun, 14 Jun 2009 01:57:22 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:41708) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MFiiY-0001Yw-4N for bug-gnu-emacs@gnu.org; Sun, 14 Jun 2009 01:57:22 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5E5vKbo015938; Sat, 13 Jun 2009 22:57:20 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n5E5t66J015374; Sat, 13 Jun 2009 22:55:06 -0700 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 3424 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:28695 Archived-At: This is a multi-part message in MIME format... ------------=_1244958906-15340-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sun, 14 Jun 2009 08:52:52 +0300 with message-id <87ljnv5pl7.fsf@iki.fi> and subject line Re: align-regexp: Infinite loop with default regexp has caused the Emacs bug report #3424, regarding align-regexp: Infinite loop with default regexp to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 3424: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D3424 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1244958906-15340-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 30 May 2009 17:38:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.3 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4UHcL62003470 for ; Sat, 30 May 2009 10:38:23 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MASVd-0001gQ-Dc for bug-gnu-emacs@gnu.org; Sat, 30 May 2009 13:38:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MASVY-0001fg-Ig for bug-gnu-emacs@gnu.org; Sat, 30 May 2009 13:38:17 -0400 Received: from [199.232.76.173] (port=58935 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MASVY-0001fd-EX for bug-gnu-emacs@gnu.org; Sat, 30 May 2009 13:38:12 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:48323 helo=jenni1.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MASVV-0003dh-41 for bug-gnu-emacs@gnu.org; Sat, 30 May 2009 13:38:10 -0400 Received: from mithlond.arda.local (80.220.180.181) by jenni1.inet.fi (8.5.014) id 49F5976601498B4E for bug-gnu-emacs@gnu.org; Sat, 30 May 2009 20:38:00 +0300 Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1MASV6-00015K-Gl for bug-gnu-emacs@gnu.org; Sat, 30 May 2009 20:37:44 +0300 To: bug-gnu-emacs@gnu.org Subject: align-regexp: Infinite loop with default regexp From: Teemu Likonen Date: Sat, 30 May 2009 20:37:44 +0300 Message-ID: <87my8upk47.fsf@iki.fi> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) --=-=-= The align-regexp command enters infinite loop when it is used with the default regexp and with REPEAT argument. It's seems to be because the regexp \s-* matches also zero-length strings. Steps to reproduce: 1. Put the following line to the *scratch* buffer: foo bar 2. Put the line inside a region 3. Type command: C-u M-x align-regexp RET \(\s-*\) RET 1 RET 1 RET y 4. Loop infinitely. I suggest changing the default regexp to \(\s-+\), like the attached patch illustrates. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=align-regexp.patch diff --git i/lisp/align.el w/lisp/align.el index 0917e7d..ea36302 100644 --- i/lisp/align.el +++ w/lisp/align.el @@ -933,7 +933,7 @@ region, call `align-regexp' and type in that regular expression." (list (region-beginning) (region-end)) (if current-prefix-arg (list (read-string "Complex align using regexp: " - "\\(\\s-*\\)") + "\\(\\s-+\\)") (string-to-number (read-string "Parenthesis group to modify (justify if negative): " "1")) @@ -941,7 +941,7 @@ region, call `align-regexp' and type in that regular expression." (read-string "Amount of spacing (or column if negative): " (number-to-string align-default-spacing))) (y-or-n-p "Repeat throughout line? ")) - (list (concat "\\(\\s-*\\)" + (list (concat "\\(\\s-+\\)" (read-string "Align regexp: ")) 1 align-default-spacing nil)))) (let ((rule --=-=-=-- ------------=_1244958906-15340-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 3424-done) by emacsbugs.donarmstrong.com; 14 Jun 2009 05:52:58 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.0 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from jenni2.inet.fi (mta-out.inet.fi [195.156.147.13]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5E5qrDR015214 for <3424-done@emacsbugs.donarmstrong.com>; Sat, 13 Jun 2009 22:52:55 -0700 Received: from mithlond.arda.local (80.220.180.181) by jenni2.inet.fi (8.5.014) id 49F5CB6401C49619 for 3424-done@emacsbugs.donarmstrong.com; Sun, 14 Jun 2009 08:52:52 +0300 Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1MFieC-0000wr-5G for 3424-done@emacsbugs.donarmstrong.com; Sun, 14 Jun 2009 08:52:52 +0300 From: Teemu Likonen To: 3424-done@emacsbugs.donarmstrong.com Subject: Re: align-regexp: Infinite loop with default regexp In-Reply-To: <87my8upk47.fsf@iki.fi> (Teemu Likonen's message of "Sat, 30 May 2009 20:37:44 +0300") References: <87my8upk47.fsf@iki.fi> Date: Sun, 14 Jun 2009 08:52:52 +0300 Message-ID: <87ljnv5pl7.fsf@iki.fi> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On 2009-05-30 20:37 (+0300), Teemu Likonen wrote: > The align-regexp command enters infinite loop when it is used with the > default regexp and with REPEAT argument. It's seems to be because the > regexp \s-* matches also zero-length strings. I have misunderstood the behaviour of the regexp. The default space group \s-* is about the spaces to modify before some other matching regexp. It's a bit unexpected to me but I originally reported about infinite loop which is indeed fixed in Emacs 23. So let's close this bug. ------------=_1244958906-15340-0--