From: Stefan Monnier Date: Wed, 25 Feb 2015 06:03:14 +0000 (-0500) Subject: * lisp/emacs-lisp/edebug.el (edebug--display): Save-excursion. X-Git-Tag: emacs-25.0.90~2564^2~297 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8bb64d2722632fcc2b7c816e5f85d64ff10161f9;p=emacs.git * lisp/emacs-lisp/edebug.el (edebug--display): Save-excursion. Fixes: debbugs:19611 * lisp/emacs-lisp/debug.el (debugger-env-macro): Remove redundant save-excursion. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5fa7ef757b3..fc2893e1c1d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-02-25 Stefan Monnier + + * emacs-lisp/edebug.el (edebug--display): Save-excursion (bug#19611). + * emacs-lisp/debug.el (debugger-env-macro): Remove redundant + save-excursion. + 2015-02-24 Glenn Morris * mail/rmailsum.el (rmail-summary-previous-all) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index dc0e666836e..8c1440d02f3 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -535,11 +535,7 @@ Applies to the frame whose line point is on in the backtrace." (defmacro debugger-env-macro (&rest body) "Run BODY in original environment." (declare (indent 0)) - `(save-excursion - (if (null (buffer-live-p debugger-old-buffer)) - ;; old buffer deleted - (setq debugger-old-buffer (current-buffer))) - (set-buffer debugger-old-buffer) + `(progn (set-match-data debugger-outer-match-data) (prog1 (progn ,@body) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 7faa101299e..10918775f49 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2358,6 +2358,12 @@ MSG is printed after `::::} '." (defalias 'edebug-mark-marker 'mark-marker) (defun edebug--display (value offset-index arg-mode) + ;; edebug--display-1 is too big, we should split it. This function + ;; here was just introduced to avoid making edebug--display-1 + ;; yet a bit deeper. + (save-excursion (edebug--display-1 value offset-index arg-mode))) + +(defun edebug--display-1 (value offset-index arg-mode) (unless (marker-position edebug-def-mark) ;; The buffer holding the source has been killed. ;; Let's at least show a backtrace so the user can figure out @@ -3317,6 +3323,9 @@ Return the result of the last expression." ;; Restore outside context. (setq-default cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w) (unwind-protect + ;; FIXME: This restoring of edebug-outside-buffer and + ;; edebug-outside-point is redundant now that backtrace-eval does it + ;; for us. (with-current-buffer edebug-outside-buffer ; of edebug-buffer (goto-char edebug-outside-point) (if (marker-buffer (edebug-mark-marker))