From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: Question on re-search-forward and infinite loop Date: Thu, 26 Nov 2009 22:11:24 +0100 Message-ID: References: <874oohxapb.wl%maus.david@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1259269940 6707 80.91.229.12 (26 Nov 2009 21:12:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Nov 2009 21:12:20 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: David Maus Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 26 22:12:13 2009 Return-path: Envelope-to: geh-help-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 1NDldL-00039X-KU for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Nov 2009 22:12:11 +0100 Original-Received: from localhost ([127.0.0.1]:40952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDldL-0007VM-2o for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Nov 2009 16:12:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDlcy-0007UX-LN for help-gnu-emacs@gnu.org; Thu, 26 Nov 2009 16:11:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDlcu-0007Si-Ud for help-gnu-emacs@gnu.org; Thu, 26 Nov 2009 16:11:48 -0500 Original-Received: from [199.232.76.173] (port=43719 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDlcu-0007Sd-R8 for help-gnu-emacs@gnu.org; Thu, 26 Nov 2009 16:11:44 -0500 Original-Received: from mail-yx0-f175.google.com ([209.85.210.175]:62280) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDlcu-0004q6-G8 for help-gnu-emacs@gnu.org; Thu, 26 Nov 2009 16:11:44 -0500 Original-Received: by yxe5 with SMTP id 5so1035838yxe.24 for ; Thu, 26 Nov 2009 13:11:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=+3X3xYPeKRd8jSJpiX6viOjXDAJwBCLmHuZhArxKrbU=; b=wb9RlNfUyVjNwEuTY7hGG28k1L1Qx1NDJuWiblf96YoXWa0nK781OKkHgh4fW6V8OV Ffumsa4z9Ohb0j5WJdKbQPNiD2xCDL1JCCajPR4lHMvxYTIFSch7LP2WgpMD/XMygVka 1dh1UsHDKrcX4PBoUyJhNxBUIsqtOz3fXq7Gc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=aGC2TQopHbq1n+iFxScEDFyPfzn+o3xZejeZVNuA5u6UaYWp5QQuHABzuT/kP2RRW6 GAuEzIk+VZ4lf0ABzxuSR26s4TvA7mwLzhdAj5j+RPbIfdoMPj+hfvX98LX7gHbuQs0g 1ChIrEjduGhCURcVsl1j4bm/MYWL990COlNvI= Original-Received: by 10.101.189.3 with SMTP id r3mr101464anp.105.1259269904090; Thu, 26 Nov 2009 13:11:44 -0800 (PST) In-Reply-To: <874oohxapb.wl%maus.david@gmail.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70158 Archived-At: On Thu, Nov 26, 2009 at 10:01 PM, David Maus wrote: > Hi, > > By accident I stumpled on a way to force Emacs in a infinite loop with > `re-search-forward'. > > If I create a shiny new buffer, insert something like this: > > ,---- > | (while (re-search-forward "^[ \t]*")) > | Something else > `---- > > =C2=A0-- go back beyond the while-clause and evaluate it, Emacs enters an > =C2=A0 =C2=A0infinite loop. As far as I was able to find out > =C2=A0 =C2=A0`re-search-forward' with this regexp moves point to the begi= nning > =C2=A0 =C2=A0of the next line above the "S" of "Something else" and stays= there > =C2=A0 =C2=A0forever so it never reaches end-of-buffer. > > As I dunno much (or better: anything) on Emacs' interiors my question > is: Why does this happen? If the match on next line is 0 chars long then it will not move forward.