summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-10-20 11:29:34 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-20 11:29:34 +0200
commite2acf4d29d6f03c7b8c6fbeb61ed1f4a6ef5b1fd (patch)
tree3b7371ade78bfa73c66ede8d7fd58a05b778ac23 /lisp/emacs-lisp
parentcfaecdb293cbe19536232bcef8ead9f8e98af2ff (diff)
downloademacs-e2acf4d29d6f03c7b8c6fbeb61ed1f4a6ef5b1fd.tar.gz
emacs-e2acf4d29d6f03c7b8c6fbeb61ed1f4a6ef5b1fd.tar.bz2
emacs-e2acf4d29d6f03c7b8c6fbeb61ed1f4a6ef5b1fd.zip
New command edebug-remove-instrumentation
* doc/lispref/edebug.texi (Instrumenting): Document it. * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): New command (bug#15843).
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/edebug.el18
1 files changed, 18 insertions, 0 deletions
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