Function: edebug-remove-instrumentation

edebug-remove-instrumentation is an interactive and byte-compiled function defined in edebug.el.gz.

Signature

(edebug-remove-instrumentation FUNCTIONS)

Documentation

Remove Edebug instrumentation from FUNCTIONS.

Interactively, the user is prompted for the function to remove instrumentation for, defaulting to all functions.

View in manual

Probably introduced at or before Emacs version 27.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/edebug.el.gz
(defun edebug-remove-instrumentation (functions)
  "Remove Edebug instrumentation from FUNCTIONS.
Interactively, the user is prompted for the function to remove
instrumentation for, defaulting to all functions."
  (interactive
   (list
    (let ((functions nil))
      (mapatoms
       (lambda (symbol)
         (when (and (get symbol 'edebug)
                    (or (functionp symbol)
                        (macrop symbol))
                    (edebug--unwrap*-symbol-function
                     symbol))
           (push symbol functions)))
       obarray)
      (unless functions
        (user-error "Found no functions to remove instrumentation from"))
      (let ((name
             (completing-read
              (format-prompt "Remove instrumentation from"
                             "all functions")
              functions)))
        (if (and name
                 (not (equal name "")))
            (list (intern name))
          functions)))))
  ;; Remove instrumentation.
  (dolist (symbol functions)
    (when-let ((unwrapped
                (edebug--unwrap*-symbol-function symbol)))
      (edebug--strip-plist symbol)
      (defalias symbol unwrapped)))
  (message "Removed edebug instrumentation from %s"
           (mapconcat #'symbol-name functions ", ")))