emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master e2acf4d: New command edebug-remove-instrumentation


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master e2acf4d: New command edebug-remove-instrumentation
Date: Sun, 20 Oct 2019 05:29:51 -0400 (EDT)

branch: master
commit e2acf4d29d6f03c7b8c6fbeb61ed1f4a6ef5b1fd
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    New command edebug-remove-instrumentation
    
    * doc/lispref/edebug.texi (Instrumenting): Document it.
    
    * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): New
    command (bug#15843).
---
 doc/lispref/edebug.texi   |  4 ++++
 etc/NEWS                  |  5 +++++
 lisp/emacs-lisp/edebug.el | 18 ++++++++++++++++++
 3 files changed, 27 insertions(+)

diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi
index 2c0ee39..efbba40 100644
--- a/doc/lispref/edebug.texi
+++ b/doc/lispref/edebug.texi
@@ -230,6 +230,10 @@ evaluating forms that never instrument them: from a file 
with
 @code{load}, and from the minibuffer with @code{eval-expression}
 (@kbd{M-:}).
 
+@findex edebug-remove-instrumentation
+  If you want to remove Edebug instrumentation from all functions, you
+can use the @code{edebug-remove-instrumentation} command.
+
   @xref{Edebug Eval}, for other evaluation functions available
 inside of Edebug.
 
diff --git a/etc/NEWS b/etc/NEWS
index e49dc0c..21fbdb9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1463,6 +1463,11 @@ the Elisp manual for documentation of the new mode and 
its commands.
 ** Edebug
 
 +++
+*** New command 'edebug-remove-instrumentation.
+This command removes Edebug instrumentation from all functions that
+have been instrumented.
+
++++
 *** The runtime behavior of Edebug's instrumentation can be changed
 using the new variables 'edebug-behavior-alist',
 'edebug-after-instrumentation-function' and
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 85c56f4..e0a4eb3 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]