emacs-pretest-bug
[Top][All Lists]
Advanced

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

re-search-forward ... nil t) results in error instead of returning nil


From: Drew Adams
Subject: re-search-forward ... nil t) results in error instead of returning nil
Date: Sat, 20 Nov 2004 08:57:25 -0800

emacs -q

Go to node Key Index of Emacs Info manual. Execute this:

(re-search-forward "\"\\(?:[^\\\"]\\|\\\\\\(?:.\\|[\n]\\)\\)*\"\\|`[^']+'"
nil t)

You get this error:

Debugger entered--Lisp error: (error "Stack overflow in regexp matcher")
  re-search-forward("\"\\(?:[^\\\"]\\|\\\\\\(?:.\\|[\n]\\)\\)*\"\\|`[^']+'"
nil t)
  eval((re-search-forward
"\"\\(?:[^\\\"]\\|\\\\\\(?:.\\|[\n]\\)\\)*\"\\|`[^']+'" nil t))
  eval-expression((re-search-forward
"\"\\(?:[^\\\"]\\|\\\\\\(?:.\\|[\n]\\)\\)*\"\\|`[^']+'" nil t) nil)
  call-interactively(eval-expression)

Maybe I misunderstand the meaning of the third arg. I thought that if
non-nil any error would be caught and nil would be returned, instead
of raising an error. Is this a bug or is my understanding wrong? Is
there perhaps also a bug in the regexp matcher, which makes this
overflow?

I suspect that I just misunderstand. If so: 1) please let me know and
2) we might want to clarify this in the doc.

Thanks,

   Drew

BTW (probably unrelated to bug): In Emacs 20, doing the same thing,
but using this similar regexp (no non-greedy matching), succeeds, with
no Stack overflow error:
"\"\\([^\\\"]\\|\\\\\\(.\\|[\n]\\)\\)*\"\\|`[^']+'"


In GNU Emacs 21.3.50.1 (i386-mingw-nt5.1.2600)
 of 2004-07-26 on BERATUNG4
configured using `configure --with-gcc
(3.3) --cflags -I../../jpeg-6b-1/include -I../../libpng-1.2.4-1/include -I..
/../tiff-3.5.7/include -I../../xpm-nox-4.2.0/include -I../../zlib-1.1.4-1/in
clude'





reply via email to

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