From: Lars Ingebrigtsen Date: Sun, 20 Oct 2019 10:37:37 +0000 (+0200) Subject: Change default to cancel all edebug-on-entry in cancel-edebug-on-entry X-Git-Tag: emacs-27.0.90~965 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bee7beee8efa6557c11aaa7c0e8e63885411d387;p=emacs.git 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. --- 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