summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/edebug.el
diff options
context:
space:
mode:
authorKenichi Handa <handa@gnu.org>2012-11-23 23:36:24 +0900
committerKenichi Handa <handa@gnu.org>2012-11-23 23:36:24 +0900
commit2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9 (patch)
tree3711b97807201b7eeaa066003b1c3a4ce929e5bb /lisp/emacs-lisp/edebug.el
parente1d276cbf9e18f13101328f56bed1a1c0a66e63a (diff)
parente7d0e5ee247a155a268ffbf80bedbe25e15b5032 (diff)
downloademacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.tar.gz
emacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.tar.bz2
emacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.zip
Diffstat (limited to 'lisp/emacs-lisp/edebug.el')
-rw-r--r--lisp/emacs-lisp/edebug.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 483ed64de20..12311711fe0 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -4268,6 +4268,21 @@ With prefix argument, make it a temporary breakpoint."
;;; Finalize Loading
+;; When edebugging a function, some of the sub-expressions are
+;; wrapped in (edebug-enter (lambda () ..)), so we need to teach
+;; called-interactively-p that calls within the inner lambda should refer to
+;; the outside function.
+(add-hook 'called-interactively-p-functions
+ #'edebug--called-interactively-skip)
+(defun edebug--called-interactively-skip (i frame1 frame2)
+ (when (and (eq (car-safe (nth 1 frame1)) 'lambda)
+ (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))
+ 'edebug-enter)
+ 2 1)))
+
;; Finally, hook edebug into the rest of Emacs.
;; There are probably some other things that could go here.