aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/edebug.el48
1 files changed, 31 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index d81052318cb..6b55d7cff03 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -4571,23 +4571,37 @@ With prefix argument, make it a temporary breakpoint."
4571 ;; Continue standard unloading. 4571 ;; Continue standard unloading.
4572 nil) 4572 nil)
4573 4573
4574(defun edebug-remove-instrumentation () 4574(defun edebug-remove-instrumentation (functions)
4575 "Remove Edebug instrumentation from all functions." 4575 "Remove Edebug instrumentation from FUNCTIONS.
4576 (interactive) 4576Interactively, the user is prompted for the function to remove
4577 (let ((functions nil)) 4577instrumentation for, defaulting to all functions."
4578 (mapatoms 4578 (interactive
4579 (lambda (symbol) 4579 (list
4580 (when (and (functionp symbol) 4580 (let ((functions nil))
4581 (get symbol 'edebug)) 4581 (mapatoms
4582 (let ((unwrapped (edebug-unwrap* (symbol-function symbol)))) 4582 (lambda (symbol)
4583 (unless (equal unwrapped (symbol-function symbol)) 4583 (when (and (functionp symbol)
4584 (push symbol functions) 4584 (get symbol 'edebug))
4585 (setf (symbol-function symbol) unwrapped))))) 4585 (let ((unwrapped (edebug-unwrap* (symbol-function symbol))))
4586 obarray) 4586 (unless (equal unwrapped (symbol-function symbol))
4587 (if (not functions) 4587 (push symbol functions)))))
4588 (message "Found no functions to remove instrumentation from") 4588 obarray)
4589 (message "Remove edebug instrumentation from %s" 4589 (unless functions
4590 (mapconcat #'symbol-name functions ", "))))) 4590 (error "Found no functions to remove instrumentation from"))
4591 (let ((name
4592 (completing-read
4593 "Remove instrumentation from (default all functions): "
4594 functions)))
4595 (if (and name
4596 (not (equal name "")))
4597 (list (intern name))
4598 functions)))))
4599 ;; Remove instrumentation.
4600 (dolist (symbol functions)
4601 (setf (symbol-function symbol)
4602 (edebug-unwrap* (symbol-function symbol))))
4603 (message "Removed edebug instrumentation from %s"
4604 (mapconcat #'symbol-name functions ", ")))
4591 4605
4592(provide 'edebug) 4606(provide 'edebug)
4593;;; edebug.el ends here 4607;;; edebug.el ends here