diff options
| author | Lars Ingebrigtsen | 2019-10-20 10:51:08 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-20 10:51:08 +0200 |
| commit | cfaecdb293cbe19536232bcef8ead9f8e98af2ff (patch) | |
| tree | 4d4799333da60a98653b4e8e72ff6217fd11e9d1 | |
| parent | 27490cec4e258d344c3e192301a18e36c52576a6 (diff) | |
| download | emacs-cfaecdb293cbe19536232bcef8ead9f8e98af2ff.tar.gz emacs-cfaecdb293cbe19536232bcef8ead9f8e98af2ff.zip | |
Fix doc string and interactive spec of cancel-edebug-on-entry
* lisp/emacs-lisp/edebug.el (cancel-edebug-on-entry): Add doc
string and make the interactive spec complete over functions that
have the spec (bug#10806).
(edebug-cancel-edebug-on-entry): Add alias for discoverability.
(edebug-on-entry): Clarify what this command does.
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index bfec807b5c8..85c56f43486 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -3419,14 +3419,37 @@ instrumented. Then it does `edebug-on-entry' and switches to `go' mode." | |||
| 3419 | 3419 | ||
| 3420 | (defun edebug-on-entry (function &optional flag) | 3420 | (defun edebug-on-entry (function &optional flag) |
| 3421 | "Cause Edebug to stop when FUNCTION is called. | 3421 | "Cause Edebug to stop when FUNCTION is called. |
| 3422 | |||
| 3423 | FUNCTION needs to be edebug-instrumented for this to work; if | ||
| 3424 | FUNCTION isn't, this function has no effect. | ||
| 3425 | |||
| 3422 | With prefix argument, make this temporary so it is automatically | 3426 | With prefix argument, make this temporary so it is automatically |
| 3423 | canceled the first time the function is entered." | 3427 | canceled the first time the function is entered." |
| 3424 | (interactive "aEdebug on entry to: \nP") | 3428 | (interactive "aEdebug on entry to: \nP") |
| 3425 | ;; Could store this in the edebug data instead. | 3429 | ;; Could store this in the edebug data instead. |
| 3426 | (put function 'edebug-on-entry (if flag 'temp t))) | 3430 | (put function 'edebug-on-entry (if flag 'temp t))) |
| 3427 | 3431 | ||
| 3432 | (defalias 'edebug-cancel-edebug-on-entry #'cancel-edebug-on-entry) | ||
| 3433 | |||
| 3428 | (defun cancel-edebug-on-entry (function) | 3434 | (defun cancel-edebug-on-entry (function) |
| 3429 | (interactive "aEdebug on entry to: ") | 3435 | "Cause Edebug to not stop when FUNCTION is called. |
| 3436 | The removes the effect of `edebug-on-entry'." | ||
| 3437 | (interactive | ||
| 3438 | (list (let ((name (completing-read | ||
| 3439 | "Cancel edebug on entry to: " | ||
| 3440 | (let ((functions nil)) | ||
| 3441 | (mapatoms | ||
| 3442 | (lambda (symbol) | ||
| 3443 | (when (and (fboundp symbol) | ||
| 3444 | (get symbol 'edebug-on-entry)) | ||
| 3445 | (push symbol functions))) | ||
| 3446 | obarray) | ||
| 3447 | (unless functions | ||
| 3448 | (error "No functions have `edebug-on-entry'.")) | ||
| 3449 | functions)))) | ||
| 3450 | (when (and name | ||
| 3451 | (not (equal name ""))) | ||
| 3452 | (intern name))))) | ||
| 3430 | (put function 'edebug-on-entry nil)) | 3453 | (put function 'edebug-on-entry nil)) |
| 3431 | 3454 | ||
| 3432 | 3455 | ||