summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2012-12-13 10:45:54 +0100
committerJuanma Barranquero <lekktu@gmail.com>2012-12-13 10:45:54 +0100
commit5f3a3bb1f5f0dffb8f2aa9c1437da623c48ac8dd (patch)
tree343853af8096636fe1082a02fb1ecbd5ad449b49 /lisp/emacs-lisp
parent6ce2146306d4d76fcb365ac64110ca0a99b5530d (diff)
downloademacs-5f3a3bb1f5f0dffb8f2aa9c1437da623c48ac8dd.tar.gz
emacs-5f3a3bb1f5f0dffb8f2aa9c1437da623c48ac8dd.tar.bz2
emacs-5f3a3bb1f5f0dffb8f2aa9c1437da623c48ac8dd.zip
lisp/emacs-lisp/edebug.el: Fix bug#13163.
(edebug--require-cl-read): New function. (edebug-setup-hook, cl-read-load-hooks): Use it. (edebug-unload-function): New function.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/edebug.el27
1 files changed, 23 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 12311711fe0..c2ff81281a1 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -4258,12 +4258,13 @@ With prefix argument, make it a temporary breakpoint."
;;; Autoloading of Edebug accessories
;; edebug-cl-read and cl-read are available from liberte@cs.uiuc.edu
+(defun edebug--require-cl-read ()
+ (require 'edebug-cl-read))
+
(if (featurep 'cl-read)
- (add-hook 'edebug-setup-hook
- (function (lambda () (require 'edebug-cl-read))))
+ (add-hook 'edebug-setup-hook #'edebug--require-cl-read)
;; The following causes edebug-cl-read to be loaded when you load cl-read.el.
- (add-hook 'cl-read-load-hooks
- (function (lambda () (require 'edebug-cl-read)))))
+ (add-hook 'cl-read-load-hooks #'edebug--require-cl-read))
;;; Finalize Loading
@@ -4289,6 +4290,24 @@ With prefix argument, make it a temporary breakpoint."
;; Install edebug read and eval functions.
(edebug-install-read-eval-functions)
+(defun edebug-unload-function ()
+ "Unload the Edebug source level debugger."
+ (when edebug-active
+ (unwind-protect
+ (abort-recursive-edit)
+ (setq edebug-active nil)
+ (edebug-unload-function)))
+ (save-current-buffer
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (when (eq major-mode 'edebug-mode) (emacs-lisp-mode))))
+ (remove-hook 'called-interactively-p-functions
+ 'edebug--called-interactively-skip)
+ (remove-hook 'cl-read-load-hooks 'edebug--require-cl-read)
+ (edebug-uninstall-read-eval-functions)
+ ;; continue standard unloading
+ nil)
+
(provide 'edebug)
;;; edebug.el ends here