From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Girault Newsgroups: gmane.emacs.help Subject: Re: re-search-forward hangs Date: Mon, 30 Jul 2018 16:35:38 -0300 Organization: Aioe.org NNTP Server Message-ID: <86va8w5xeu.fsf@dev.null> References: <83tvogpzcr.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1532979504 21064 195.159.176.226 (30 Jul 2018 19:38:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 30 Jul 2018 19:38:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 30 21:38:19 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkDzm-0005Nl-Fw for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Jul 2018 21:38:18 +0200 Original-Received: from localhost ([::1]:55559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkE1t-0007zp-98 for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Jul 2018 15:40:29 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Original-NNTP-Posting-Host: JjoR76Qgbxhqk95xNTZ79w.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.3 X-Gnus-Delayed: Thu, 02 Aug 2018 16:35:38 -0300 Cancel-Lock: sha1:lxLzO0+Cbj0CQlAd3m7SZWomQHg= Original-Xref: usenet.stanford.edu gnu.emacs.help:223488 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117613 Archived-At: Andreas Röhler writes: > On 30.07.2018 16:33, Eli Zaretskii wrote: >>> From: Andreas Röhler >>> 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.