[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stack overflow with (re-search-forward "..." nil t)
From: |
rgb |
Subject: |
Re: stack overflow with (re-search-forward "..." nil t) |
Date: |
5 Jul 2005 14:21:30 -0700 |
User-agent: |
G2/0.2 |
> 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.