diff options
| author | Luc Teirlinck | 2005-06-11 23:52:51 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-06-11 23:52:51 +0000 |
| commit | 8e71c318da60b6bc1a02e0c14b859a3c0bb00b23 (patch) | |
| tree | 556e5b35b5eada9fadad1c11c1b5bb24dd243a7f | |
| parent | 9edbd0074e6117b4171f9e2289742a9834d6f5a8 (diff) | |
| download | emacs-8e71c318da60b6bc1a02e0c14b859a3c0bb00b23.tar.gz emacs-8e71c318da60b6bc1a02e0c14b859a3c0bb00b23.zip | |
(debug-on-entry, cancel-debug-on-entry): Doc fixes.
| -rw-r--r-- | lisp/emacs-lisp/debug.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index f1ff37551d7..83e07f6d199 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el | |||
| @@ -614,7 +614,7 @@ Applies to the frame whose line point is on in the backtrace." | |||
| 614 | (terpri)) | 614 | (terpri)) |
| 615 | 615 | ||
| 616 | (with-current-buffer (get-buffer debugger-record-buffer) | 616 | (with-current-buffer (get-buffer debugger-record-buffer) |
| 617 | (message "%s" | 617 | (message "%s" |
| 618 | (buffer-substring (line-beginning-position 0) | 618 | (buffer-substring (line-beginning-position 0) |
| 619 | (line-end-position 0))))) | 619 | (line-end-position 0))))) |
| 620 | 620 | ||
| @@ -656,22 +656,23 @@ functions to break on entry." | |||
| 656 | ;;;###autoload | 656 | ;;;###autoload |
| 657 | (defun debug-on-entry (function) | 657 | (defun debug-on-entry (function) |
| 658 | "Request FUNCTION to invoke debugger each time it is called. | 658 | "Request FUNCTION to invoke debugger each time it is called. |
| 659 | When called interactively, prompt for FUNCTION in the minibuffer. | ||
| 659 | If you tell the debugger to continue, FUNCTION's execution proceeds. | 660 | If you tell the debugger to continue, FUNCTION's execution proceeds. |
| 660 | This works by modifying the definition of FUNCTION, | 661 | This works by modifying the definition of FUNCTION, |
| 661 | which must be written in Lisp, not predefined. | 662 | which must be written in Lisp, not predefined. |
| 662 | Use \\[cancel-debug-on-entry] to cancel the effect of this command. | 663 | Use \\[cancel-debug-on-entry] to cancel the effect of this command. |
| 663 | Redefining FUNCTION also cancels it." | 664 | Redefining FUNCTION also cancels it." |
| 664 | (interactive "aDebug on entry (to function): ") | 665 | (interactive "aDebug on entry (to function): ") |
| 665 | (when (and (subrp (symbol-function function)) | 666 | (when (and (subrp (symbol-function function)) |
| 666 | (eq (cdr (subr-arity (symbol-function function))) 'unevalled)) | 667 | (eq (cdr (subr-arity (symbol-function function))) 'unevalled)) |
| 667 | (error "Function %s is a special form" function)) | 668 | (error "Function %s is a special form" function)) |
| 668 | (if (or (symbolp (symbol-function function)) | 669 | (if (or (symbolp (symbol-function function)) |
| 669 | (subrp (symbol-function function))) | 670 | (subrp (symbol-function function))) |
| 670 | ;; The function is built-in or aliased to another function. | 671 | ;; The function is built-in or aliased to another function. |
| 671 | ;; Create a wrapper in which we can add the debug call. | 672 | ;; Create a wrapper in which we can add the debug call. |
| 672 | (fset function `(lambda (&rest debug-on-entry-args) | 673 | (fset function `(lambda (&rest debug-on-entry-args) |
| 673 | ,(interactive-form (symbol-function function)) | 674 | ,(interactive-form (symbol-function function)) |
| 674 | (apply ',(symbol-function function) | 675 | (apply ',(symbol-function function) |
| 675 | debug-on-entry-args))) | 676 | debug-on-entry-args))) |
| 676 | (when (eq (car-safe (symbol-function function)) 'autoload) | 677 | (when (eq (car-safe (symbol-function function)) 'autoload) |
| 677 | ;; The function is autoloaded. Load its real definition. | 678 | ;; The function is autoloaded. Load its real definition. |
| @@ -692,7 +693,9 @@ Redefining FUNCTION also cancels it." | |||
| 692 | ;;;###autoload | 693 | ;;;###autoload |
| 693 | (defun cancel-debug-on-entry (&optional function) | 694 | (defun cancel-debug-on-entry (&optional function) |
| 694 | "Undo effect of \\[debug-on-entry] on FUNCTION. | 695 | "Undo effect of \\[debug-on-entry] on FUNCTION. |
| 695 | If argument is nil or an empty string, cancel for all functions." | 696 | If argument is nil or an empty string, cancel for all functions. |
| 697 | When called interactively, prompt for FUNCTION in the minibuffer. | ||
| 698 | To specify a nil argument interactively, exit with an empty minibuffer." | ||
| 696 | (interactive | 699 | (interactive |
| 697 | (list (let ((name | 700 | (list (let ((name |
| 698 | (completing-read "Cancel debug on entry (to function): " | 701 | (completing-read "Cancel debug on entry (to function): " |
| @@ -739,7 +742,7 @@ If argument is nil or an empty string, cancel for all functions." | |||
| 739 | (defun debug-on-entry-1 (function flag) | 742 | (defun debug-on-entry-1 (function flag) |
| 740 | (let* ((defn (symbol-function function)) | 743 | (let* ((defn (symbol-function function)) |
| 741 | (tail defn)) | 744 | (tail defn)) |
| 742 | (when (eq (car-safe tail) 'macro) | 745 | (when (eq (car-safe tail) 'macro) |
| 743 | (setq tail (cdr tail))) | 746 | (setq tail (cdr tail))) |
| 744 | (if (not (eq (car-safe tail) 'lambda)) | 747 | (if (not (eq (car-safe tail) 'lambda)) |
| 745 | ;; Only signal an error when we try to set debug-on-entry. | 748 | ;; Only signal an error when we try to set debug-on-entry. |