From 6874724a3ddcb08578175939bc6d04ccf5d56682 Mon Sep 17 00:00:00 2001 From: Ari Roponen Date: Mon, 22 Jul 2013 13:39:32 +0200 Subject: lisp/emacs-lisp/package.el (package-menu-mode): Fix bug#14930. Don't modify the global value of tabulated-list-revert-hook. --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 32339249085..68d2880d33e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1393,7 +1393,7 @@ Letters do not insert themselves; instead, they are commands. ("Description" 0 nil)]) (setq tabulated-list-padding 2) (setq tabulated-list-sort-key (cons "Status" nil)) - (add-hook 'tabulated-list-revert-hook 'package-menu--refresh) + (add-hook 'tabulated-list-revert-hook 'package-menu--refresh nil t) (tabulated-list-init-header)) (defmacro package--push (pkg-desc status listname) -- cgit v1.2.3 From 7d22ce18d44b3639e5644ed72c2bfc54ca8b91d2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 22 Jul 2013 19:21:14 -0400 Subject: * lisp/emacs-lisp/autoload.el (autoload--setup-output): New function, extracted from autoload--insert-text. (autoload--insert-text): Remove. (autoload--print-cookie-text): New function, extracted from autoload--insert-cookie-text. (autoload--insert-cookie-text): Remove. (autoload-generate-file-autoloads): Adjust calls accordingly. --- lisp/ChangeLog | 8 ++++++ lisp/emacs-lisp/autoload.el | 65 +++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 35 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7e104ad69b9..660ea562910 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2013-07-22 Stefan Monnier + * emacs-lisp/autoload.el (autoload--setup-output): New function, + extracted from autoload--insert-text. + (autoload--insert-text): Remove. + (autoload--print-cookie-text): New function, extracted from + autoload--insert-cookie-text. + (autoload--insert-cookie-text): Remove. + (autoload-generate-file-autoloads): Adjust calls accordingly. + * winner.el (winner-hook-installed-p): Remove. (winner-mode): Simplify accordingly. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 22713c6589c..e531bc0bdae 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -436,33 +436,26 @@ Return non-nil in the case where no autoloads were added at point." (defvar print-readably) -(defun autoload--insert-text (output-start otherbuf outbuf absfile - load-name printfun) - ;; If not done yet, figure out where to insert this text. - (unless (marker-buffer output-start) - (let ((outbuf - (or (if otherbuf - ;; A file-local setting of - ;; autoload-generated-file says we - ;; should ignore OUTBUF. - nil - outbuf) - (autoload-find-destination absfile load-name) - ;; The file has autoload cookies, but they're - ;; already up-to-date. If OUTFILE is nil, the - ;; entries are in the expected OUTBUF, - ;; otherwise they're elsewhere. - (throw 'done otherbuf)))) - (with-current-buffer outbuf - (move-marker output-start (point) outbuf)))) - (let ((standard-output (marker-buffer output-start))) - (funcall printfun))) -(defun autoload--insert-cookie-text (output-start otherbuf outbuf absfile - load-name file) - (autoload--insert-text - output-start otherbuf outbuf absfile load-name - (lambda () +(defun autoload--setup-output (otherbuf outbuf absfile load-name) + (let ((outbuf + (or (if otherbuf + ;; A file-local setting of + ;; autoload-generated-file says we + ;; should ignore OUTBUF. + nil + outbuf) + (autoload-find-destination absfile load-name) + ;; The file has autoload cookies, but they're + ;; already up-to-date. If OUTFILE is nil, the + ;; entries are in the expected OUTBUF, + ;; otherwise they're elsewhere. + (throw 'done otherbuf)))) + (with-current-buffer outbuf + (point-marker)))) + +(defun autoload--print-cookie-text (output-start load-name file) + (let ((standard-output (marker-buffer output-start))) (search-forward generate-autoload-cookie) (skip-chars-forward " \t") (if (eolp) @@ -490,7 +483,7 @@ Return non-nil in the case where no autoloads were added at point." ;; Eat one space. (forward-char 1)) (point)) - (progn (forward-line 1) (point)))))))) + (progn (forward-line 1) (point))))))) (defvar autoload-builtin-package-versions nil) @@ -553,23 +546,25 @@ Return non-nil if and only if FILE adds no autoloads to OUTFILE (setq package (or (lm-header "package") (file-name-sans-extension (file-name-nondirectory file)))) - (setq output-start (make-marker)) - (autoload--insert-text - output-start otherbuf outbuf absfile load-name - (lambda () + (setq output-start (autoload--setup-output + otherbuf outbuf absfile load-name)) + (let ((standard-output (marker-buffer output-start)) + (print-quoted t)) (princ `(push (purecopy ',(cons (intern package) version)) package--builtin-versions)) - (newline)))))) + (newline))))) (goto-char (point-min)) (while (not (eobp)) (skip-chars-forward " \t\n\f") (cond ((looking-at (regexp-quote generate-autoload-cookie)) - (unless output-start (setq output-start (make-marker))) - (autoload--insert-cookie-text - output-start otherbuf outbuf absfile load-name file)) + ;; If not done yet, figure out where to insert this text. + (unless output-start + (setq output-start (autoload--setup-output + otherbuf outbuf absfile load-name))) + (autoload--print-cookie-text output-start load-name file)) ((looking-at ";") ;; Don't read the comment. (forward-line 1)) -- cgit v1.2.3 From 249eea30ee8201fe9b872cf2c110aa546479b0e4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 24 Jul 2013 01:13:24 -0400 Subject: * lisp/emacs-lisp/pcase.el (pcase--u1): Verify if self-quoting values can be checked with memq. Fixes: debbugs:14935 --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/pcase.el | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24fbe1acb2c..6679bf8a9e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-07-24 Stefan Monnier + * emacs-lisp/pcase.el (pcase--u1): Verify if self-quoting values can be + checked with memq (bug#14935). + * files.el (revert-buffer-function): Use a non-nil default. (revert-buffer-preserve-modes): Declare var to provide access to the `preserve-modes' argument. diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 511f1480099..50c92518b02 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -659,11 +659,15 @@ Otherwise, it defers to REST which is a list of branches of the form (memq-fine t)) (when all (dolist (alt (cdr upat)) - (unless (or (pcase--self-quoting-p alt) - (and (eq (car-safe alt) '\`) - (or (symbolp (cadr alt)) (integerp (cadr alt)) - (setq memq-fine nil) - (stringp (cadr alt))))) + (unless (if (pcase--self-quoting-p alt) + (progn + (unless (or (symbolp alt) (integerp alt)) + (setq memq-fine nil)) + t) + (and (eq (car-safe alt) '\`) + (or (symbolp (cadr alt)) (integerp (cadr alt)) + (setq memq-fine nil) + (stringp (cadr alt))))) (setq all nil)))) (if all ;; Use memq for (or `a `b `c `d) rather than a big tree. -- cgit v1.2.3 From 56ea72917a7a700e29cf6c115fd1cd75ad782e9e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Jul 2013 03:38:18 -0400 Subject: Add support for lexical variables to the debugger's `e' command. * lisp/emacs-lisp/debug.el (debug): Don't let-bind the debugger-outer-* vars, except for debugger-outer-match-data. (debugger-frame-number): Move check for "on a function call" from callers into it. Add `skip-base' argument. (debugger-frame, debugger-frame-clear): Simplify accordingly. (debugger-env-macro): Only reset the state stored in non-variables, i.e. current-buffer and match-data. (debugger-eval-expression): Rewrite using backtrace-eval. * lisp/subr.el (internal--called-interactively-p--get-frame): Remove. (called-interactively-p): * lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip): Use the new `base' arg of backtrace-frame instead. * src/eval.c (set_specpdl_old_value): New function. (unbind_to): Minor simplification. (get_backtrace_frame): New function. (Fbacktrace_frame): Use it. Add `base' argument. (backtrace_eval_unrewind, Fbacktrace_eval): New functions. (syms_of_eval): Export backtrace-eval. * src/xterm.c (x_focus_changed): Simplify. --- etc/NEWS | 4 ++ lisp/ChangeLog | 16 +++++ lisp/emacs-lisp/debug.el | 145 ++++++++------------------------------- lisp/emacs-lisp/edebug.el | 2 +- lisp/subr.el | 18 +---- src/ChangeLog | 10 +++ src/eval.c | 169 +++++++++++++++++++++++++++++++++++++++------- src/xterm.c | 15 ++-- 8 files changed, 212 insertions(+), 167 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/etc/NEWS b/etc/NEWS index feb45f43348..c9805ab55ba 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -158,6 +158,10 @@ You can pick the name of the function and the variables with `C-x 4 a'. * Changes in Specialized Modes and Packages in Emacs 24.4 +** The debugger's `e' command evaluates the code in the context at point. +This includes using the lexical environment at point, which means that +`e' now lets you access lexical variables as well. + ** `eshell' now supports visual subcommands and options Eshell has been able to handle "visual" commands (interactive, non-line oriented commands such as top that require display diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 79582ea560a..84919e634be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2013-07-26 Stefan Monnier + + Add support for lexical variables to the debugger's `e' command. + * emacs-lisp/debug.el (debug): Don't let-bind the debugger-outer-* + vars, except for debugger-outer-match-data. + (debugger-frame-number): Move check for "on a function call" from + callers into it. Add `skip-base' argument. + (debugger-frame, debugger-frame-clear): Simplify accordingly. + (debugger-env-macro): Only reset the state stored in non-variables, + i.e. current-buffer and match-data. + (debugger-eval-expression): Rewrite using backtrace-eval. + * subr.el (internal--called-interactively-p--get-frame): Remove. + (called-interactively-p): + * emacs-lisp/edebug.el (edebug--called-interactively-skip): Use the new + `base' arg of backtrace-frame instead. + 2013-07-26 Glenn Morris * align.el (align-regexp): Doc fix. (Bug#14857) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 0728e86d072..aee48eef668 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -102,22 +102,6 @@ The value used here is passed to `quit-restore-window'." This is to optimize `debugger-make-xrefs'.") (defvar debugger-outer-match-data) -(defvar debugger-outer-load-read-function) -(defvar debugger-outer-overriding-local-map) -(defvar debugger-outer-overriding-terminal-local-map) -(defvar debugger-outer-track-mouse) -(defvar debugger-outer-last-command) -(defvar debugger-outer-this-command) -(defvar debugger-outer-unread-command-events) -(defvar debugger-outer-unread-post-input-method-events) -(defvar debugger-outer-last-input-event) -(defvar debugger-outer-last-command-event) -(defvar debugger-outer-last-nonmenu-event) -(defvar debugger-outer-last-event-frame) -(defvar debugger-outer-standard-input) -(defvar debugger-outer-standard-output) -(defvar debugger-outer-inhibit-redisplay) -(defvar debugger-outer-cursor-in-echo-area) (defvar debugger-will-be-back nil "Non-nil if we expect to get back in the debugger soon.") @@ -174,24 +158,6 @@ first will be printed into the backtrace buffer." ;; Save the outer values of these vars for the `e' command ;; before we replace the values. (debugger-outer-match-data (match-data)) - (debugger-outer-load-read-function load-read-function) - (debugger-outer-overriding-local-map overriding-local-map) - (debugger-outer-overriding-terminal-local-map - overriding-terminal-local-map) - (debugger-outer-track-mouse track-mouse) - (debugger-outer-last-command last-command) - (debugger-outer-this-command this-command) - (debugger-outer-unread-command-events unread-command-events) - (debugger-outer-unread-post-input-method-events - unread-post-input-method-events) - (debugger-outer-last-input-event last-input-event) - (debugger-outer-last-command-event last-command-event) - (debugger-outer-last-nonmenu-event last-nonmenu-event) - (debugger-outer-last-event-frame last-event-frame) - (debugger-outer-standard-input standard-input) - (debugger-outer-standard-output standard-output) - (debugger-outer-inhibit-redisplay inhibit-redisplay) - (debugger-outer-cursor-in-echo-area cursor-in-echo-area) (debugger-with-timeout-suspend (with-timeout-suspend))) ;; Set this instead of binding it, so that `q' ;; will not restore it. @@ -294,26 +260,6 @@ first will be printed into the backtrace buffer." (funcall (nth 0 debugger-previous-state)))))) (with-timeout-unsuspend debugger-with-timeout-suspend) (set-match-data debugger-outer-match-data))) - ;; Put into effect the modified values of these variables - ;; in case the user set them with the `e' command. - (setq load-read-function debugger-outer-load-read-function) - (setq overriding-local-map debugger-outer-overriding-local-map) - (setq overriding-terminal-local-map - debugger-outer-overriding-terminal-local-map) - (setq track-mouse debugger-outer-track-mouse) - (setq last-command debugger-outer-last-command) - (setq this-command debugger-outer-this-command) - (setq unread-command-events debugger-outer-unread-command-events) - (setq unread-post-input-method-events - debugger-outer-unread-post-input-method-events) - (setq last-input-event debugger-outer-last-input-event) - (setq last-command-event debugger-outer-last-command-event) - (setq last-nonmenu-event debugger-outer-last-nonmenu-event) - (setq last-event-frame debugger-outer-last-event-frame) - (setq standard-input debugger-outer-standard-input) - (setq standard-output debugger-outer-standard-output) - (setq inhibit-redisplay debugger-outer-inhibit-redisplay) - (setq cursor-in-echo-area debugger-outer-cursor-in-echo-area) (setq debug-on-next-call debugger-step-after-exit) debugger-value))) @@ -518,18 +464,21 @@ removes itself from that hook." (setq debugger-jumping-flag nil) (remove-hook 'post-command-hook 'debugger-reenable)) -(defun debugger-frame-number () +(defun debugger-frame-number (&optional skip-base) "Return number of frames in backtrace before the one point points at." (save-excursion (beginning-of-line) + (if (looking-at " *;;;\\|[a-z]") + (error "This line is not a function call")) (let ((opoint (point)) (count 0)) - (while (not (eq (cadr (backtrace-frame count)) 'debug)) - (setq count (1+ count))) - ;; Skip debug--implement-debug-on-entry frame. - (when (eq 'debug--implement-debug-on-entry - (cadr (backtrace-frame (1+ count)))) - (setq count (+ 2 count))) + (unless skip-base + (while (not (eq (cadr (backtrace-frame count)) 'debug)) + (setq count (1+ count))) + ;; Skip debug--implement-debug-on-entry frame. + (when (eq 'debug--implement-debug-on-entry + (cadr (backtrace-frame (1+ count)))) + (setq count (+ 2 count)))) (goto-char (point-min)) (when (looking-at "Debugger entered--\\(Lisp error\\|returning value\\):") (goto-char (match-end 0)) @@ -551,12 +500,8 @@ removes itself from that hook." "Request entry to debugger when this frame exits. Applies to the frame whose line point is on in the backtrace." (interactive) - (save-excursion - (beginning-of-line) - (if (looking-at " *;;;\\|[a-z]") - (error "This line is not a function call"))) - (beginning-of-line) (backtrace-debug (debugger-frame-number) t) + (beginning-of-line) (if (= (following-char) ? ) (let ((inhibit-read-only t)) (delete-char 1) @@ -567,12 +512,8 @@ Applies to the frame whose line point is on in the backtrace." "Do not enter debugger when this frame exits. Applies to the frame whose line point is on in the backtrace." (interactive) - (save-excursion - (beginning-of-line) - (if (looking-at " *;;;\\|[a-z]") - (error "This line is not a function call"))) - (beginning-of-line) (backtrace-debug (debugger-frame-number) nil) + (beginning-of-line) (if (= (following-char) ?*) (let ((inhibit-read-only t)) (delete-char 1) @@ -583,59 +524,33 @@ Applies to the frame whose line point is on in the backtrace." "Run BODY in original environment." (declare (indent 0)) `(save-excursion - (if (null (buffer-name debugger-old-buffer)) + (if (null (buffer-live-p debugger-old-buffer)) ;; old buffer deleted (setq debugger-old-buffer (current-buffer))) (set-buffer debugger-old-buffer) - (let ((load-read-function debugger-outer-load-read-function) - (overriding-terminal-local-map - debugger-outer-overriding-terminal-local-map) - (overriding-local-map debugger-outer-overriding-local-map) - (track-mouse debugger-outer-track-mouse) - (last-command debugger-outer-last-command) - (this-command debugger-outer-this-command) - (unread-command-events debugger-outer-unread-command-events) - (unread-post-input-method-events - debugger-outer-unread-post-input-method-events) - (last-input-event debugger-outer-last-input-event) - (last-command-event debugger-outer-last-command-event) - (last-nonmenu-event debugger-outer-last-nonmenu-event) - (last-event-frame debugger-outer-last-event-frame) - (standard-input debugger-outer-standard-input) - (standard-output debugger-outer-standard-output) - (inhibit-redisplay debugger-outer-inhibit-redisplay) - (cursor-in-echo-area debugger-outer-cursor-in-echo-area)) - (set-match-data debugger-outer-match-data) - (prog1 - (progn ,@body) - (setq debugger-outer-match-data (match-data)) - (setq debugger-outer-load-read-function load-read-function) - (setq debugger-outer-overriding-terminal-local-map - overriding-terminal-local-map) - (setq debugger-outer-overriding-local-map overriding-local-map) - (setq debugger-outer-track-mouse track-mouse) - (setq debugger-outer-last-command last-command) - (setq debugger-outer-this-command this-command) - (setq debugger-outer-unread-command-events unread-command-events) - (setq debugger-outer-unread-post-input-method-events - unread-post-input-method-events) - (setq debugger-outer-last-input-event last-input-event) - (setq debugger-outer-last-command-event last-command-event) - (setq debugger-outer-last-nonmenu-event last-nonmenu-event) - (setq debugger-outer-last-event-frame last-event-frame) - (setq debugger-outer-standard-input standard-input) - (setq debugger-outer-standard-output standard-output) - (setq debugger-outer-inhibit-redisplay inhibit-redisplay) - (setq debugger-outer-cursor-in-echo-area cursor-in-echo-area) - )))) + (set-match-data debugger-outer-match-data) + (prog1 + (progn ,@body) + (setq debugger-outer-match-data (match-data))))) (defun debugger-eval-expression (exp) - "Eval an expression, in an environment like that outside the debugger." + "Eval an expression, in an environment like that outside the debugger. +The environment used is the one when entering the activation frame at point." (interactive (list (read-from-minibuffer "Eval: " nil read-expression-map t 'read-expression-history))) - (debugger-env-macro (eval-expression exp))) + (let ((nframe (condition-case nil (1+ (debugger-frame-number 'skip-base)) + (error 0))) ;; If on first line. + (base (if (eq 'debug--implement-debug-on-entry + (cadr (backtrace-frame 1 'debug))) + 'debug--implement-debug-on-entry 'debug))) + (debugger-env-macro + (let ((val (backtrace-eval exp nframe base))) + (prog1 + (prin1 val t) + (let ((str (eval-expression-print-format val))) + (if str (princ str t)))))))) (defvar debugger-mode-map (let ((map (make-keymap)) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 36c72f3a3bd..7771c3adaa4 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -4268,7 +4268,7 @@ With prefix argument, make it a temporary breakpoint." (eq (nth 1 (nth 1 frame1)) '()) (eq (nth 1 frame2) 'edebug-enter)) ;; `edebug-enter' calls itself on its first invocation. - (if (eq (nth 1 (internal--called-interactively-p--get-frame i)) + (if (eq (nth 1 (backtrace-frame i 'called-interactively-p)) 'edebug-enter) 2 1))) diff --git a/lisp/subr.el b/lisp/subr.el index 7130639dbe5..3b85a9bedb0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4191,22 +4191,6 @@ I is the index of the frame after FRAME2. It should return nil if those frames don't seem special and otherwise, it should return the number of frames to skip (minus 1).") -(defmacro internal--called-interactively-p--get-frame (n) - ;; `sym' will hold a global variable, which will be used kind of like C's - ;; "static" variables. - (let ((sym (make-symbol "base-index"))) - `(progn - (defvar ,sym) - (unless (boundp ',sym) - (let ((i 1)) - (while (not (eq (indirect-function (nth 1 (backtrace-frame i)) t) - (indirect-function 'called-interactively-p))) - (setq i (1+ i))) - (setq ,sym i))) - ;; (unless (eq (nth 1 (backtrace-frame ,sym)) 'called-interactively-p) - ;; (error "called-interactively-p: %s is out-of-sync!" ,sym)) - (backtrace-frame (+ ,sym ,n))))) - (defun called-interactively-p (&optional kind) "Return t if the containing function was called by `call-interactively'. If KIND is `interactive', then only return t if the call was made @@ -4241,7 +4225,7 @@ command is called from a keyboard macro?" (get-next-frame (lambda () (setq frame nextframe) - (setq nextframe (internal--called-interactively-p--get-frame i)) + (setq nextframe (backtrace-frame i 'called-interactively-p)) ;; (message "Frame %d = %S" i nextframe) (setq i (1+ i))))) (funcall get-next-frame) ;; Get the first frame. diff --git a/src/ChangeLog b/src/ChangeLog index 56fe20fda98..6542703adbb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2013-07-26 Stefan Monnier + + * eval.c (set_specpdl_old_value): New function. + (unbind_to): Minor simplification. + (get_backtrace_frame): New function. + (Fbacktrace_frame): Use it. Add `base' argument. + (backtrace_eval_unrewind, Fbacktrace_eval): New functions. + (syms_of_eval): Export backtrace-eval. + * xterm.c (x_focus_changed): Simplify. + 2013-07-25 Paul Eggert * fileio.c (Finsert_file_contents): Avoid double-close (Bug#14936). diff --git a/src/eval.c b/src/eval.c index 6cb2b7a92b8..e55a3b259e0 100644 --- a/src/eval.c +++ b/src/eval.c @@ -138,6 +138,13 @@ specpdl_old_value (union specbinding *pdl) return pdl->let.old_value; } +static void +set_specpdl_old_value (union specbinding *pdl, Lisp_Object val) +{ + eassert (pdl->kind >= SPECPDL_LET); + pdl->let.old_value = val; +} + static Lisp_Object specpdl_where (union specbinding *pdl) { @@ -3301,6 +3308,8 @@ unbind_to (ptrdiff_t count, Lisp_Object value) case SPECPDL_UNWIND_VOID: specpdl_ptr->unwind_void.func (); break; + case SPECPDL_BACKTRACE: + break; case SPECPDL_LET: /* If variable has a trivial value (no forwarding), we can just set it. No need to check for constant symbols here, @@ -3315,27 +3324,20 @@ unbind_to (ptrdiff_t count, Lisp_Object value) Fset_default (specpdl_symbol (specpdl_ptr), specpdl_old_value (specpdl_ptr)); break; - case SPECPDL_BACKTRACE: + case SPECPDL_LET_DEFAULT: + Fset_default (specpdl_symbol (specpdl_ptr), + specpdl_old_value (specpdl_ptr)); break; case SPECPDL_LET_LOCAL: - case SPECPDL_LET_DEFAULT: - { /* If the symbol is a list, it is really (SYMBOL WHERE - . CURRENT-BUFFER) where WHERE is either nil, a buffer, or a - frame. If WHERE is a buffer or frame, this indicates we - bound a variable that had a buffer-local or frame-local - binding. WHERE nil means that the variable had the default - value when it was bound. CURRENT-BUFFER is the buffer that - was current when the variable was bound. */ + { Lisp_Object symbol = specpdl_symbol (specpdl_ptr); Lisp_Object where = specpdl_where (specpdl_ptr); Lisp_Object old_value = specpdl_old_value (specpdl_ptr); eassert (BUFFERP (where)); - if (specpdl_ptr->kind == SPECPDL_LET_DEFAULT) - Fset_default (symbol, old_value); /* If this was a local binding, reset the value in the appropriate buffer, but only if that buffer's binding still exists. */ - else if (!NILP (Flocal_variable_p (symbol, where))) + if (!NILP (Flocal_variable_p (symbol, where))) set_internal (symbol, old_value, where, 1); } break; @@ -3422,7 +3424,30 @@ Output stream used is value of `standard-output'. */) return Qnil; } -DEFUN ("backtrace-frame", Fbacktrace_frame, Sbacktrace_frame, 1, 1, NULL, +union specbinding * +get_backtrace_frame (Lisp_Object nframes, Lisp_Object base) +{ + union specbinding *pdl = backtrace_top (); + register EMACS_INT i; + + CHECK_NATNUM (nframes); + + if (!NILP (base)) + { /* Skip up to `base'. */ + base = Findirect_function (base, Qt); + while (backtrace_p (pdl) + && !EQ (base, Findirect_function (backtrace_function (pdl), Qt))) + pdl = backtrace_next (pdl); + } + + /* Find the frame requested. */ + for (i = XFASTINT (nframes); i > 0 && backtrace_p (pdl); i--) + pdl = backtrace_next (pdl); + + return pdl; +} + +DEFUN ("backtrace-frame", Fbacktrace_frame, Sbacktrace_frame, 1, 2, NULL, doc: /* Return the function and arguments NFRAMES up from current execution point. If that frame has not evaluated the arguments yet (or is a special form), the value is (nil FUNCTION ARG-FORMS...). @@ -3431,17 +3456,12 @@ the value is (t FUNCTION ARG-VALUES...). A &rest arg is represented as the tail of the list ARG-VALUES. FUNCTION is whatever was supplied as car of evaluated list, or a lambda expression for macro calls. -If NFRAMES is more than the number of frames, the value is nil. */) - (Lisp_Object nframes) +If NFRAMES is more than the number of frames, the value is nil. +If BASE is non-nil, it should be a function and NFRAMES counts from its +nearest activation frame. */) + (Lisp_Object nframes, Lisp_Object base) { - union specbinding *pdl = backtrace_top (); - register EMACS_INT i; - - CHECK_NATNUM (nframes); - - /* Find the frame requested. */ - for (i = 0; backtrace_p (pdl) && i < XFASTINT (nframes); i++) - pdl = backtrace_next (pdl); + union specbinding *pdl = get_backtrace_frame (nframes, base); if (!backtrace_p (pdl)) return Qnil; @@ -3456,6 +3476,108 @@ If NFRAMES is more than the number of frames, the value is nil. */) } } +/* For backtrace-eval, we want to temporarily unwind the last few elements of + the specpdl stack, and then rewind them. We store the pre-unwind values + directly in the pre-existing specpdl elements (i.e. we swap the current + value and the old value stored in the specpdl), kind of like the inplace + pointer-reversal trick. As it turns out, the rewind does the same as the + unwind, except it starts from the other end of the spepdl stack, so we use + the same function for both unwind and rewind. */ +void +backtrace_eval_unrewind (int distance) +{ + union specbinding *tmp = specpdl_ptr; + int step = -1; + if (distance < 0) + { /* It's a rewind rather than unwind. */ + tmp += distance - 1; + step = 1; + distance = -distance; + } + + for (; distance > 0; distance--) + { + tmp += step; + /* */ + switch (tmp->kind) + { + /* FIXME: Ideally we'd like to "temporarily unwind" (some of) those + unwind_protect, but the problem is that we don't know how to + rewind them afterwards. */ + case SPECPDL_UNWIND: + case SPECPDL_UNWIND_PTR: + case SPECPDL_UNWIND_INT: + case SPECPDL_UNWIND_VOID: + case SPECPDL_BACKTRACE: + break; + case SPECPDL_LET: + /* If variable has a trivial value (no forwarding), we can + just set it. No need to check for constant symbols here, + since that was already done by specbind. */ + if (XSYMBOL (specpdl_symbol (tmp))->redirect + == SYMBOL_PLAINVAL) + { + struct Lisp_Symbol *sym = XSYMBOL (specpdl_symbol (tmp)); + Lisp_Object old_value = specpdl_old_value (tmp); + set_specpdl_old_value (tmp, SYMBOL_VAL (sym)); + SET_SYMBOL_VAL (sym, old_value); + break; + } + else + /* FALLTHROUGH! + NOTE: we only ever come here if make_local_foo was used for + the first time on this var within this let. */ + ; + case SPECPDL_LET_DEFAULT: + { + Lisp_Object sym = specpdl_symbol (tmp); + Lisp_Object old_value = specpdl_old_value (tmp); + set_specpdl_old_value (tmp, Fdefault_value (sym)); + Fset_default (sym, old_value); + } + break; + case SPECPDL_LET_LOCAL: + { + Lisp_Object symbol = specpdl_symbol (tmp); + Lisp_Object where = specpdl_where (tmp); + Lisp_Object old_value = specpdl_old_value (tmp); + eassert (BUFFERP (where)); + + /* If this was a local binding, reset the value in the appropriate + buffer, but only if that buffer's binding still exists. */ + if (!NILP (Flocal_variable_p (symbol, where))) + { + set_specpdl_old_value + (tmp, Fbuffer_local_value (symbol, where)); + set_internal (symbol, old_value, where, 1); + } + } + break; + } + } +} + +DEFUN ("backtrace-eval", Fbacktrace_eval, Sbacktrace_eval, 2, 3, NULL, + doc: /* Evaluate EXP in the context of some activation frame. +NFRAMES and BASE specify the activation frame to use, as in `backtrace-frame'. */) + (Lisp_Object exp, Lisp_Object nframes, Lisp_Object base) +{ + union specbinding *pdl = get_backtrace_frame (nframes, base); + ptrdiff_t count = SPECPDL_INDEX (); + ptrdiff_t distance = specpdl_ptr - pdl; + eassert (distance >= 0); + + if (!backtrace_p (pdl)) + error ("Activation frame not found!"); + + backtrace_eval_unrewind (distance); + record_unwind_protect_int (backtrace_eval_unrewind, -distance); + + /* Use eval_sub rather than Feval since the main motivation behind + backtrace-eval is to be able to get/set the value of lexical variables + from the debugger. */ + return unbind_to (count, eval_sub (exp)); +} void mark_specpdl (void) @@ -3701,6 +3823,7 @@ alist of active lexical bindings. */); defsubr (&Sbacktrace_debug); defsubr (&Sbacktrace); defsubr (&Sbacktrace_frame); + defsubr (&Sbacktrace_eval); defsubr (&Sspecial_variable_p); defsubr (&Sfunctionp); } diff --git a/src/xterm.c b/src/xterm.c index 74e495e5645..b3534871da9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3435,17 +3435,10 @@ x_focus_changed (int type, int state, struct x_display_info *dpyinfo, struct fra /* Don't stop displaying the initial startup message for a switch-frame event we don't need. */ /* When run as a daemon, Vterminal_frame is always NIL. */ - if ((NILP (Vterminal_frame) || EQ (Fdaemonp(), Qt)) - && CONSP (Vframe_list) - && !NILP (XCDR (Vframe_list))) - { - bufp->arg = Qt; - } - else - { - bufp->arg = Qnil; - } - + bufp->arg = (((NILP (Vterminal_frame) || EQ (Fdaemonp (), Qt)) + && CONSP (Vframe_list) + && !NILP (XCDR (Vframe_list))) + ? Qt : Qnil); bufp->kind = FOCUS_IN_EVENT; XSETFRAME (bufp->frame_or_window, frame); } -- cgit v1.2.3 From 53ff3e77b4c6e15b53404948254e58024c5e1556 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Jul 2013 11:09:04 -0400 Subject: * lisp/emacs-lisp/edebug.el: Use backtrace-eval to handle lexical variables. (edebug-eval): Use backtrace-eval. (edebug--display, edebug--recursive-edit): Don't let-bind the edebug-outer-* vars that keep track of variables we locally let-bind. (edebug-outside-excursion): Don't restore outside values of locally let-bound vars. (edebug--display): Use user-error. (cl-lexical-debug, cl-debug-env): Remove. --- lisp/ChangeLog | 11 +++ lisp/emacs-lisp/edebug.el | 208 +++++++--------------------------------------- 2 files changed, 43 insertions(+), 176 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 59f2bed01aa..28a9dde666c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2013-07-26 Stefan Monnier + + * emacs-lisp/edebug.el: Use backtrace-eval to handle lexical variables. + (edebug-eval): Use backtrace-eval. + (edebug--display, edebug--recursive-edit): Don't let-bind the + edebug-outer-* vars that keep track of variables we locally let-bind. + (edebug-outside-excursion): Don't restore outside values of locally + let-bound vars. + (edebug--display): Use user-error. + (cl-lexical-debug, cl-debug-env): Remove. + 2013-07-26 Juanma Barranquero * desktop.el (desktop-restore-frames): Call `sit-for' once all frames diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 7771c3adaa4..ae20e5270e1 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2088,8 +2088,6 @@ expressions; a `progn' form will be returned enclosing these forms." (defvar edebug-coverage) ; the coverage results of each expression of function. (defvar edebug-buffer) ; which buffer the function is in. -(defvar edebug-outside-executing-macro) -(defvar edebug-outside-defining-kbd-macro) (defvar edebug-execution-mode 'step) ; Current edebug mode set by user. (defvar edebug-next-execution-mode nil) ; Use once instead of initial mode. @@ -2097,12 +2095,6 @@ expressions; a `progn' form will be returned enclosing these forms." (defvar edebug-outside-debug-on-error) ; the value of debug-on-error outside (defvar edebug-outside-debug-on-quit) ; the value of debug-on-quit outside - -(defvar edebug-outside-pre-command-hook) -(defvar edebug-outside-post-command-hook) - -(defvar cl-lexical-debug) ;; Defined in cl.el - ;;; Handling signals (defun edebug-signal (signal-name signal-data) @@ -2154,10 +2146,7 @@ error is signaled again." ;; Binding these may not be the right thing to do. ;; We want to allow the global values to be changed. (debug-on-error (or debug-on-error edebug-on-error)) - (debug-on-quit edebug-on-quit) - - ;; Lexical bindings must be uncompiled for this to work. - (cl-lexical-debug t)) + (debug-on-quit edebug-on-quit)) (unwind-protect (let ((signal-hook-function 'edebug-signal)) (setq edebug-execution-mode (or edebug-next-execution-mode @@ -2386,9 +2375,6 @@ MSG is printed after `::::} '." (defvar edebug-window-data) ; window and window-start for current function (defvar edebug-outside-windows) ; outside window configuration (defvar edebug-eval-buffer) ; for the evaluation list. -(defvar edebug-outside-o-a-p) ; outside overlay-arrow-position -(defvar edebug-outside-o-a-s) ; outside overlay-arrow-string -(defvar edebug-outside-c-i-e-a) ; outside cursor-in-echo-area (defvar edebug-outside-d-c-i-n-s-w) ; outside default-cursor-in-non-selected-windows (defvar edebug-eval-list nil) ;; List of expressions to evaluate. @@ -2398,8 +2384,6 @@ MSG is printed after `::::} '." ;; Emacs 19 adds an arg to mark and mark-marker. (defalias 'edebug-mark-marker 'mark-marker) -(defvar edebug-outside-unread-command-events) - (defun edebug--display (value offset-index arg-mode) (unless (marker-position edebug-def-mark) ;; The buffer holding the source has been killed. @@ -2421,7 +2405,6 @@ MSG is printed after `::::} '." (edebug-outside-buffer (current-buffer)) (edebug-outside-point (point)) (edebug-outside-mark (edebug-mark)) - (edebug-outside-unread-command-events unread-command-events) edebug-outside-windows ; Window or screen configuration. edebug-buffer-points @@ -2431,9 +2414,6 @@ MSG is printed after `::::} '." edebug-trace-window edebug-trace-window-start - (edebug-outside-o-a-p overlay-arrow-position) - (edebug-outside-o-a-s overlay-arrow-string) - (edebug-outside-c-i-e-a cursor-in-echo-area) (edebug-outside-d-c-i-n-s-w (default-value 'cursor-in-non-selected-windows))) (unwind-protect @@ -2445,8 +2425,7 @@ MSG is printed after `::::} '." ) (setq-default cursor-in-non-selected-windows t) (if (not (buffer-name edebug-buffer)) - (let ((debug-on-error nil)) - (error "Buffer defining %s not found" edebug-function))) + (user-error "Buffer defining %s not found" edebug-function)) (if (eq 'after arg-mode) ;; Compute result string now before windows are modified. @@ -2486,10 +2465,9 @@ MSG is printed after `::::} '." ;; Check whether positions are up-to-date. ;; This assumes point is never before symbol. (if (not (memq (following-char) '(?\( ?\# ?\` ))) - (let ((debug-on-error nil)) - (error "Source has changed - reevaluate definition of %s" - edebug-function) - ))) + (user-error "Source has changed - reevaluate definition of %s" + edebug-function) + )) (setcdr edebug-window-data (edebug-adjust-window (cdr edebug-window-data))) @@ -2645,11 +2623,6 @@ MSG is printed after `::::} '." (if edebug-eval-buffer (kill-buffer edebug-eval-buffer)) (with-timeout-unsuspend edebug-with-timeout-suspend) ;; Reset global variables to outside values in case they were changed. - (setq - unread-command-events edebug-outside-unread-command-events - overlay-arrow-position edebug-outside-o-a-p - overlay-arrow-string edebug-outside-o-a-s - cursor-in-echo-area edebug-outside-c-i-e-a) (setq-default cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w) ))) @@ -2667,27 +2640,6 @@ MSG is printed after `::::} '." (defvar edebug-inside-windows) (defvar edebug-interactive-p) -(defvar edebug-outside-map) -(defvar edebug-outside-standard-output) -(defvar edebug-outside-standard-input) -(defvar edebug-outside-current-prefix-arg) -(defvar edebug-outside-last-command) -(defvar edebug-outside-this-command) - -;; Note: here we have defvars for variables that are -;; built-in in certain versions. -;; Each defvar makes a difference -;; in versions where the variable is *not* built-in. - -;; Emacs 18 FIXME - -;; Emacs 19. -(defvar edebug-outside-last-command-event) -(defvar edebug-outside-last-input-event) -(defvar edebug-outside-last-event-frame) -(defvar edebug-outside-last-nonmenu-event) -(defvar edebug-outside-track-mouse) - (defun edebug--recursive-edit (arg-mode) ;; Start up a recursive edit inside of edebug. ;; The current buffer is the edebug-buffer, which is put into edebug-mode. @@ -2705,28 +2657,6 @@ MSG is printed after `::::} '." ;; The window configuration may be saved and restored ;; during a recursive-edit edebug-inside-windows - - ;; Save the outside value of executing macro. (here??) - (edebug-outside-executing-macro executing-kbd-macro) - (edebug-outside-pre-command-hook - (edebug-var-status 'pre-command-hook)) - (edebug-outside-post-command-hook - (edebug-var-status 'post-command-hook)) - - (edebug-outside-standard-output standard-output) - (edebug-outside-standard-input standard-input) - (edebug-outside-defining-kbd-macro defining-kbd-macro) - - (edebug-outside-last-command last-command) - (edebug-outside-this-command this-command) - - (edebug-outside-current-prefix-arg current-prefix-arg) - - (edebug-outside-last-input-event last-input-event) - (edebug-outside-last-command-event last-command-event) - (edebug-outside-last-event-frame last-event-frame) - (edebug-outside-last-nonmenu-event last-nonmenu-event) - (edebug-outside-track-mouse track-mouse) ) (unwind-protect @@ -2757,7 +2687,7 @@ MSG is printed after `::::} '." (overriding-local-map nil) (overriding-terminal-local-map nil) - ;; Bind again to outside values. + ;; Bind again to outside values. (debug-on-error edebug-outside-debug-on-error) (debug-on-quit edebug-outside-debug-on-quit) @@ -2805,27 +2735,7 @@ MSG is printed after `::::} '." ;; gotta have a buffer to let its buffer local variables be set (get-buffer-create " bogus edebug buffer")) ));; inner let - - ;; Reset global vars to outside values, in case they have been changed. - (setq - last-command-event edebug-outside-last-command-event - last-command edebug-outside-last-command - this-command edebug-outside-this-command - current-prefix-arg edebug-outside-current-prefix-arg - last-input-event edebug-outside-last-input-event - last-event-frame edebug-outside-last-event-frame - last-nonmenu-event edebug-outside-last-nonmenu-event - track-mouse edebug-outside-track-mouse - - standard-output edebug-outside-standard-output - standard-input edebug-outside-standard-input - defining-kbd-macro edebug-outside-defining-kbd-macro) - - (setq executing-kbd-macro edebug-outside-executing-macro) - (edebug-restore-status - 'post-command-hook edebug-outside-post-command-hook) - (edebug-restore-status - 'pre-command-hook edebug-outside-pre-command-hook)))) + ))) ;;; Display related functions @@ -3423,6 +3333,9 @@ edebug-mode." (defmacro edebug-outside-excursion (&rest body) "Evaluate an expression list in the outside context. Return the result of the last expression." + ;; Only restores the non-variables context since all the variables let-bound + ;; by Edebug will be properly reset to the appropriate context's value by + ;; backtrace-eval. (declare (debug t)) `(save-excursion ; of current-buffer (if edebug-save-windows @@ -3435,89 +3348,32 @@ Return the result of the last expression." (edebug-set-windows edebug-outside-windows))) (set-buffer edebug-buffer) ; why? - ;; (use-local-map edebug-outside-map) (set-match-data edebug-outside-match-data) ;; Restore outside context. - (let (;; (edebug-inside-map (current-local-map)) ;; restore map?? - (last-command-event edebug-outside-last-command-event) - (last-command edebug-outside-last-command) - (this-command edebug-outside-this-command) - (unread-command-events edebug-outside-unread-command-events) - (current-prefix-arg edebug-outside-current-prefix-arg) - (last-input-event edebug-outside-last-input-event) - (last-event-frame edebug-outside-last-event-frame) - (last-nonmenu-event edebug-outside-last-nonmenu-event) - (track-mouse edebug-outside-track-mouse) - (standard-output edebug-outside-standard-output) - (standard-input edebug-outside-standard-input) - - (executing-kbd-macro edebug-outside-executing-macro) - (defining-kbd-macro edebug-outside-defining-kbd-macro) - ;; Get the values out of the saved statuses. - (pre-command-hook (cdr edebug-outside-pre-command-hook)) - (post-command-hook (cdr edebug-outside-post-command-hook)) - - ;; See edebug-display. - (overlay-arrow-position edebug-outside-o-a-p) - (overlay-arrow-string edebug-outside-o-a-s) - (cursor-in-echo-area edebug-outside-c-i-e-a) - ) - (setq-default cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w) - (unwind-protect - (with-current-buffer edebug-outside-buffer ; of edebug-buffer - (goto-char edebug-outside-point) - (if (marker-buffer (edebug-mark-marker)) - (set-marker (edebug-mark-marker) edebug-outside-mark)) - ,@body) - - ;; Back to edebug-buffer. Restore rest of inside context. - ;; (use-local-map edebug-inside-map) - (if edebug-save-windows - ;; Restore inside windows. - (edebug-set-windows edebug-inside-windows)) - - ;; Save values that may have been changed. - (setq - edebug-outside-last-command-event last-command-event - edebug-outside-last-command last-command - edebug-outside-this-command this-command - edebug-outside-unread-command-events unread-command-events - edebug-outside-current-prefix-arg current-prefix-arg - edebug-outside-last-input-event last-input-event - edebug-outside-last-event-frame last-event-frame - edebug-outside-last-nonmenu-event last-nonmenu-event - edebug-outside-track-mouse track-mouse - edebug-outside-standard-output standard-output - edebug-outside-standard-input standard-input - - edebug-outside-executing-macro executing-kbd-macro - edebug-outside-defining-kbd-macro defining-kbd-macro - - edebug-outside-o-a-p overlay-arrow-position - edebug-outside-o-a-s overlay-arrow-string - edebug-outside-c-i-e-a cursor-in-echo-area - edebug-outside-d-c-i-n-s-w (default-value - 'cursor-in-non-selected-windows) - ) - - ;; Restore the outside saved values; don't alter - ;; the outside binding loci. - (setcdr edebug-outside-pre-command-hook pre-command-hook) - (setcdr edebug-outside-post-command-hook post-command-hook) - - (setq-default cursor-in-non-selected-windows t) - )) ; let - )) - -(defvar cl-debug-env) ; defined in cl; non-nil when lexical env used. + (setq-default cursor-in-non-selected-windows edebug-outside-d-c-i-n-s-w) + (unwind-protect + (with-current-buffer edebug-outside-buffer ; of edebug-buffer + (goto-char edebug-outside-point) + (if (marker-buffer (edebug-mark-marker)) + (set-marker (edebug-mark-marker) edebug-outside-mark)) + ,@body) + + ;; Back to edebug-buffer. Restore rest of inside context. + ;; (use-local-map edebug-inside-map) + (if edebug-save-windows + ;; Restore inside windows. + (edebug-set-windows edebug-inside-windows)) + + ;; Save values that may have been changed. + (setq edebug-outside-d-c-i-n-s-w + (default-value 'cursor-in-non-selected-windows)) + + ;; Restore the outside saved values; don't alter + ;; the outside binding loci. + (setq-default cursor-in-non-selected-windows t)))) (defun edebug-eval (expr) - ;; Are there cl lexical variables active? - (eval (if (and (bound-and-true-p cl-debug-env) - (fboundp 'cl-macroexpand-all)) - (cl-macroexpand-all expr cl-debug-env) - expr) - lexical-binding)) + (backtrace-eval expr 0 'edebug-after)) (defun edebug-safe-eval (expr) ;; Evaluate EXPR safely. -- cgit v1.2.3 From 7ced0d044656b5fa4a9cd2bcc2326908be432bcf Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Jul 2013 14:41:18 -0400 Subject: * lisp/emacs-lisp/nadvice.el (advice--called-interactively-skip): Use the new `base' arg of backtrace-frame. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/nadvice.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d2f03c15301..9aecbd0f280 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-07-26 Stefan Monnier + + * emacs-lisp/nadvice.el (advice--called-interactively-skip): Use the new + `base' arg of backtrace-frame. + 2013-07-26 Juanma Barranquero * desktop.el (desktop--select-frame): diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 8b149aad7bb..edcfc409085 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -425,7 +425,7 @@ of the piece of advice." (get-next-frame (lambda () (setq frame1 frame2) - (setq frame2 (internal--called-interactively-p--get-frame i)) + (setq frame2 (backtrace-frame i #'called-interactively-p)) ;; (message "Advice Frame %d = %S" i frame2) (setq i (1+ i))))) (when (and (eq (nth 1 frame2) 'apply) -- cgit v1.2.3