From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: stack overflow with (re-search-forward "..." nil t) Date: 5 Jul 2005 14:21:30 -0700 Organization: http://groups.google.com Message-ID: <1120598489.977017.291430@g44g2000cwa.googlegroups.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1120599147 9475 80.91.229.2 (5 Jul 2005 21:32:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2005 21:32:27 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 05 23:32:27 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dpv0J-0006LX-OM for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Jul 2005 23:30:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dpv1a-0007BU-VQ for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Jul 2005 17:32:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g44g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 17 Original-NNTP-Posting-Host: 198.74.20.118 Original-X-Trace: posting.google.com 1120598495 26001 127.0.0.1 (5 Jul 2005 21:21:35 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 5 Jul 2005 21:21:35 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g44g2000cwa.googlegroups.com; posting-host=198.74.20.118; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:132329 Original-To: help-gnu-emacs@gnu.org 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:27806 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:27806 > I don't understand the `noerror' argument to re-search-forward, when it is > `t'. For some kinds of errors it works, but I still get stack-overflow > errors signaled, instead of the function returning nil. The doc string and > Elisp manual simply say that `noerror'=t returns nil in case of error. If you expect it should return nil even in the case of a bad argument, I don't think that was the intention. In fact I'd be complaining if it did work that way. A wrapper is definitely necessary to get that level of safety. Having said that, it sounds like a bug. Although your wrapper might appear to work I suspect it just masks the true problem. That being either your regexp is bad and the error isn't being detected/reported in a useful way, or the regexp is OK but your combination of regexp tokens and buffer data trigger a bug that ultimately crashes the search. Either way I don't think a wrapper is the answer.