diff options
| author | Lars Ingebrigtsen | 2019-10-20 11:29:34 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-20 11:29:34 +0200 |
| commit | e2acf4d29d6f03c7b8c6fbeb61ed1f4a6ef5b1fd (patch) | |
| tree | 3b7371ade78bfa73c66ede8d7fd58a05b778ac23 | |
| parent | cfaecdb293cbe19536232bcef8ead9f8e98af2ff (diff) | |
| download | emacs-e2acf4d29d6f03c7b8c6fbeb61ed1f4a6ef5b1fd.tar.gz 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).
| -rw-r--r-- | doc/lispref/edebug.texi | 4 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 18 |
3 files changed, 27 insertions, 0 deletions
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 2c0ee3969b9..efbba40916e 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 | |||
| 230 | @code{load}, and from the minibuffer with @code{eval-expression} | 230 | @code{load}, and from the minibuffer with @code{eval-expression} |
| 231 | (@kbd{M-:}). | 231 | (@kbd{M-:}). |
| 232 | 232 | ||
| 233 | @findex edebug-remove-instrumentation | ||
| 234 | If you want to remove Edebug instrumentation from all functions, you | ||
| 235 | can use the @code{edebug-remove-instrumentation} command. | ||
| 236 | |||
| 233 | @xref{Edebug Eval}, for other evaluation functions available | 237 | @xref{Edebug Eval}, for other evaluation functions available |
| 234 | inside of Edebug. | 238 | inside of Edebug. |
| 235 | 239 | ||
| @@ -1463,6 +1463,11 @@ the Elisp manual for documentation of the new mode and its commands. | |||
| 1463 | ** Edebug | 1463 | ** Edebug |
| 1464 | 1464 | ||
| 1465 | +++ | 1465 | +++ |
| 1466 | *** New command 'edebug-remove-instrumentation. | ||
| 1467 | This command removes Edebug instrumentation from all functions that | ||
| 1468 | have been instrumented. | ||
| 1469 | |||
| 1470 | +++ | ||
| 1466 | *** The runtime behavior of Edebug's instrumentation can be changed | 1471 | *** The runtime behavior of Edebug's instrumentation can be changed |
| 1467 | using the new variables 'edebug-behavior-alist', | 1472 | using the new variables 'edebug-behavior-alist', |
| 1468 | 'edebug-after-instrumentation-function' and | 1473 | 'edebug-after-instrumentation-function' and |
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." | |||
| 4423 | ;; Continue standard unloading. | 4423 | ;; Continue standard unloading. |
| 4424 | nil) | 4424 | nil) |
| 4425 | 4425 | ||
| 4426 | (defun edebug-remove-instrumentation () | ||
| 4427 | "Remove Edebug instrumentation from all functions." | ||
| 4428 | (interactive) | ||
| 4429 | (let ((functions nil)) | ||
| 4430 | (mapatoms | ||
| 4431 | (lambda (symbol) | ||
| 4432 | (when (and (functionp symbol) | ||
| 4433 | (get symbol 'edebug)) | ||
| 4434 | (let ((unwrapped (edebug-unwrap* (symbol-function symbol)))) | ||
| 4435 | (unless (equal unwrapped (symbol-function symbol)) | ||
| 4436 | (push symbol functions) | ||
| 4437 | (setf (symbol-function symbol) unwrapped))))) | ||
| 4438 | obarray) | ||
| 4439 | (if (not functions) | ||
| 4440 | (message "Found no functions to remove instrumentation from") | ||
| 4441 | (message "Remove edebug instrumentation from %s" | ||
| 4442 | (mapconcat #'symbol-name functions ", "))))) | ||
| 4443 | |||
| 4426 | (provide 'edebug) | 4444 | (provide 'edebug) |
| 4427 | ;;; edebug.el ends here | 4445 | ;;; edebug.el ends here |