all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: David Maus <maus.david@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Question on re-search-forward and infinite loop
Date: Thu, 26 Nov 2009 22:11:24 +0100	[thread overview]
Message-ID: <e01d8a50911261311p2c23ece4p787ca5b2a697015@mail.gmail.com> (raw)
In-Reply-To: <874oohxapb.wl%maus.david@gmail.com>

On Thu, Nov 26, 2009 at 10:01 PM, David Maus <maus.david@gmail.com> 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
> `----
>
>  -- go back beyond the while-clause and evaluate it, Emacs enters an
>    infinite loop. As far as I was able to find out
>    `re-search-forward' with this regexp moves point to the beginning
>    of the next line above the "S" of "Something else" and stays there
>    forever 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.




  reply	other threads:[~2009-11-26 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-26 21:01 Question on re-search-forward and infinite loop David Maus
2009-11-26 21:11 ` Lennart Borgman [this message]
     [not found] <mailman.11588.1259269277.2239.help-gnu-emacs@gnu.org>
2009-11-26 23:17 ` Barry Margolin
2009-11-30  8:24   ` David Maus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e01d8a50911261311p2c23ece4p787ca5b2a697015@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=maus.david@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.