help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: re-search-forward hangs


From: Andreas Röhler
Subject: Re: re-search-forward hangs
Date: Mon, 30 Jul 2018 22:15:21 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 30.07.2018 21:35, Robert Girault wrote:
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

On 30.07.2018 16:33, Eli Zaretskii wrote:
From: Andreas Röhler <andreas.roehler@easy-emacs.de>
Date: Mon, 30 Jul 2018 14:24:06 +0200

(while (re-search-forward "" nil t 1))

Emacs hangs.

Same with plain

(while (search-forward "" nil t 1))

Expect it terminating.

Are there reasons for this?

Why did you expect it to terminate?

Expect a call of search-forward from  EOB not being successful.

I see.  But searching for the empty string seems to be an always
successful operation as long as you have a string.  The empty string is
before or after any character in a string, so I would expect it to be
always found by {re-}search-forward.


Hmm, when trying at BOB with some content, changing the times argument

(message "%s" (search-forward "" nil t 1))
(message "%s" (search-forward "" nil t 2))
(message "%s" (search-forward "" nil t 3))

the result remains "43" - looks like the match is not regular.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]