From e2acf4d29d6f03c7b8c6fbeb61ed1f4a6ef5b1fd Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 20 Oct 2019 11:29:34 +0200 Subject: New command edebug-remove-instrumentation * doc/lispref/edebug.texi (Instrumenting): Document it. * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): New command (bug#15843). --- lisp/emacs-lisp/edebug.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 85c56f43486..e0a4eb3db5a 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -4423,5 +4423,23 @@ With prefix argument, make it a temporary breakpoint." ;; Continue standard unloading. nil) +(defun edebug-remove-instrumentation () + "Remove Edebug instrumentation from all functions." + (interactive) + (let ((functions nil)) + (mapatoms + (lambda (symbol) + (when (and (functionp symbol) + (get symbol 'edebug)) + (let ((unwrapped (edebug-unwrap* (symbol-function symbol)))) + (unless (equal unwrapped (symbol-function symbol)) + (push symbol functions) + (setf (symbol-function symbol) unwrapped))))) + obarray) + (if (not functions) + (message "Found no functions to remove instrumentation from") + (message "Remove edebug instrumentation from %s" + (mapconcat #'symbol-name functions ", "))))) + (provide 'edebug) ;;; edebug.el ends here -- cgit v1.2.3