Subject: Re: bug#12500: 24.2.50; (search-failed "\n debug(") in debugger

From: Stefan Monnier <[email-masked]>
Date: Thu, 06 Dec 2012 23:21:34 -0500

> When stepping, the (search-forward "\n  debug(") in
> debugger-setup-buffer sometimes fails.  To reproduce this 

The patch below seems to fix the problem in your test case; can you
confirm that it fixes your problem?

        Stefan

=== modified file 'lisp/emacs-lisp/debug.el'
--- lisp/emacs-lisp/debug.el	2012-11-13 03:06:56 +0000
+++ lisp/emacs-lisp/debug.el	2012-12-07 04:19:04 +0000
@@ -333,7 +333,7 @@
   (goto-char (point-min))
   (delete-region (point)
 		 (progn
-		   (search-forward "\n  debug(")
+		   (re-search-forward "\n. debug(")
 		   (forward-line (if (eq (car args) 'debug)
                                      ;; Remove debug--implement-debug-on-entry
                                      ;; and the advice's `apply' frame.