diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-20 12:37:37 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-20 12:37:37 +0200 |
commit | bee7beee8efa6557c11aaa7c0e8e63885411d387 (patch) | |
tree | 05eada3d3ffd21c988f42dfbf6b5aee7782b4fca /lisp/emacs-lisp | |
parent | 665208ce59fe564a17320327763a9c43d7132c0d (diff) | |
download | emacs-bee7beee8efa6557c11aaa7c0e8e63885411d387.tar.gz emacs-bee7beee8efa6557c11aaa7c0e8e63885411d387.tar.bz2 emacs-bee7beee8efa6557c11aaa7c0e8e63885411d387.zip |
Change default to cancel all edebug-on-entry in cancel-edebug-on-entry
* lisp/emacs-lisp/edebug.el (cancel-edebug-on-entry): Make the
default to cancel all edebug-on-entry.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/edebug.el | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index ad8dddf0b33..893c821f086 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3460,27 +3460,36 @@ canceled the first time the function is entered." (defalias 'edebug-cancel-edebug-on-entry #'cancel-edebug-on-entry) +(defun edebug--edebug-on-entry-functions () + (let ((functions nil)) + (mapatoms + (lambda (symbol) + (when (and (fboundp symbol) + (get symbol 'edebug-on-entry)) + (push symbol functions))) + obarray) + functions)) + (defun cancel-edebug-on-entry (function) "Cause Edebug to not stop when FUNCTION is called. -The removes the effect of `edebug-on-entry'." +The removes the effect of `edebug-on-entry'. If FUNCTION is is +nil, remove `edebug-on-entry' on all functions." (interactive (list (let ((name (completing-read - "Cancel edebug on entry to: " - (let ((functions nil)) - (mapatoms - (lambda (symbol) - (when (and (fboundp symbol) - (get symbol 'edebug-on-entry)) - (push symbol functions))) - obarray) + "Cancel edebug on entry to (default all functions): " + (let ((functions (edebug--edebug-on-entry-functions))) (unless functions (user-error "No functions have `edebug-on-entry'")) functions)))) (when (and name (not (equal name ""))) (intern name))))) - (put function 'edebug-on-entry nil)) - + (unless function + (message "Removing `edebug-on-entry' from all functions.")) + (dolist (function (if function + (list function) + (edebug--edebug-on-entry-functions))) + (put function 'edebug-on-entry nil))) '(advice-add 'debug-on-entry :around 'edebug--debug-on-entry) ;; Should we do this? ;; Also need edebug-cancel-debug-on-entry |