diff options
| author | Lute Kamstra | 2005-03-10 09:43:01 +0000 |
|---|---|---|
| committer | Lute Kamstra | 2005-03-10 09:43:01 +0000 |
| commit | 449808f757acf51ff61875c5c32dfa3000a72f24 (patch) | |
| tree | 7f7341d05427e0f9355438f40a379144066eaf25 | |
| parent | 134d277e081cd5be5836c9027cd21d73a0b6bab5 (diff) | |
| download | emacs-449808f757acf51ff61875c5c32dfa3000a72f24.tar.gz emacs-449808f757acf51ff61875c5c32dfa3000a72f24.zip | |
(debug-entry-code): Delete it.
(implement-debug-on-entry): New function to replace debug-entry-code.
(debug-on-entry-1): Use implement-debug-on-entry. Delete the second
argument as the 2005-03-07 change makes it obsolete.
(debug-on-entry, cancel-debug-on-entry): Update call to
debug-on-entry-1.
(debug, debugger-setup-buffer): Comment update.
(debugger-frame-number): Update to work with implement-debug-on-entry.
| -rw-r--r-- | lisp/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/emacs-lisp/debug.el | 39 |
2 files changed, 36 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5019b7257b7..b9952c55973 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2005-03-10 Lute Kamstra <lute@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/debug.el (debug-entry-code): Delete it. | ||
| 4 | (implement-debug-on-entry): New function to replace | ||
| 5 | debug-entry-code. | ||
| 6 | (debug-on-entry-1): Use implement-debug-on-entry. Delete the | ||
| 7 | second argument as the 2005-03-07 change makes it obsolete. | ||
| 8 | (debug-on-entry, cancel-debug-on-entry): Update call to | ||
| 9 | debug-on-entry-1. | ||
| 10 | (debug, debugger-setup-buffer): Comment update. | ||
| 11 | (debugger-frame-number): Update to work with | ||
| 12 | implement-debug-on-entry. | ||
| 13 | |||
| 1 | 2005-03-10 Jay Belanger <belanger@truman.edu> | 14 | 2005-03-10 Jay Belanger <belanger@truman.edu> |
| 2 | 15 | ||
| 3 | * calc/calc-embed.el (math-ms-args): Declare it. | 16 | * calc/calc-embed.el (math-ms-args): Declare it. |
| @@ -19,7 +32,7 @@ | |||
| 19 | (gdb-tooltip-print): Remove newline for tooltip-use-echo-area. | 32 | (gdb-tooltip-print): Remove newline for tooltip-use-echo-area. |
| 20 | 33 | ||
| 21 | * bindings.el (mode-line-mode-menu): Add tooltip-mode to mode-line. | 34 | * bindings.el (mode-line-mode-menu): Add tooltip-mode to mode-line. |
| 22 | 35 | ||
| 23 | 2005-03-09 Kim F. Storm <storm@cua.dk> | 36 | 2005-03-09 Kim F. Storm <storm@cua.dk> |
| 24 | 37 | ||
| 25 | * play/animate.el (animate-place-char): Use forward-line instead | 38 | * play/animate.el (animate-place-char): Use forward-line instead |
| @@ -40,7 +53,7 @@ | |||
| 40 | set-case-syntax-set-multibyte is nil. | 53 | set-case-syntax-set-multibyte is nil. |
| 41 | 54 | ||
| 42 | * textmodes/ispell.el (ispell-insert-word): New function. | 55 | * textmodes/ispell.el (ispell-insert-word): New function. |
| 43 | (ispell-word): Use ispell-insert-word to isnert a new word. | 56 | (ispell-word): Use ispell-insert-word to insert a new word. |
| 44 | (ispell-process-line): Likewise | 57 | (ispell-process-line): Likewise |
| 45 | (ispell-complete-word): Likewise. | 58 | (ispell-complete-word): Likewise. |
| 46 | 59 | ||
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index fc665cb973f..668157fc52a 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el | |||
| @@ -97,14 +97,6 @@ This is to optimize `debugger-make-xrefs'.") | |||
| 97 | This variable is used by `debugger-jump', `debugger-step-through', | 97 | This variable is used by `debugger-jump', `debugger-step-through', |
| 98 | and `debugger-reenable' to temporarily disable debug-on-entry.") | 98 | and `debugger-reenable' to temporarily disable debug-on-entry.") |
| 99 | 99 | ||
| 100 | ;; When you change this, you may also need to change the number of | ||
| 101 | ;; frames that the debugger skips. | ||
| 102 | (defconst debug-entry-code | ||
| 103 | '(if (or inhibit-debug-on-entry debugger-jumping-flag) | ||
| 104 | nil | ||
| 105 | (debug 'debug)) | ||
| 106 | "Code added to a function to cause it to call the debugger upon entry.") | ||
| 107 | |||
| 108 | ;;;###autoload | 100 | ;;;###autoload |
| 109 | (setq debugger 'debug) | 101 | (setq debugger 'debug) |
| 110 | ;;;###autoload | 102 | ;;;###autoload |
| @@ -200,7 +192,7 @@ first will be printed into the backtrace buffer." | |||
| 200 | (kill-emacs)) | 192 | (kill-emacs)) |
| 201 | (if (eq (car debugger-args) 'debug) | 193 | (if (eq (car debugger-args) 'debug) |
| 202 | ;; Skip the frames for backtrace-debug, byte-code, | 194 | ;; Skip the frames for backtrace-debug, byte-code, |
| 203 | ;; and debug-entry-code. | 195 | ;; and implement-debug-on-entry. |
| 204 | (backtrace-debug 4 t)) | 196 | (backtrace-debug 4 t)) |
| 205 | (message "") | 197 | (message "") |
| 206 | (let ((standard-output nil) | 198 | (let ((standard-output nil) |
| @@ -264,7 +256,7 @@ That buffer should be current already." | |||
| 264 | (progn | 256 | (progn |
| 265 | (search-forward "\n debug(") | 257 | (search-forward "\n debug(") |
| 266 | (forward-line (if (eq (car debugger-args) 'debug) | 258 | (forward-line (if (eq (car debugger-args) 'debug) |
| 267 | 2 ; Remove debug-entry-code frame. | 259 | 2 ; Remove implement-debug-on-entry frame. |
| 268 | 1)) | 260 | 1)) |
| 269 | (point))) | 261 | (point))) |
| 270 | (insert "Debugger entered") | 262 | (insert "Debugger entered") |
| @@ -432,8 +424,8 @@ removes itself from that hook." | |||
| 432 | (count 0)) | 424 | (count 0)) |
| 433 | (while (not (eq (cadr (backtrace-frame count)) 'debug)) | 425 | (while (not (eq (cadr (backtrace-frame count)) 'debug)) |
| 434 | (setq count (1+ count))) | 426 | (setq count (1+ count))) |
| 435 | ;; Skip debug-entry-code frame. | 427 | ;; Skip implement-debug-on-entry frame. |
| 436 | (when (member '(debug (quote debug)) (cdr (backtrace-frame (1+ count)))) | 428 | (when (eq 'implement-debug-on-entry (cadr (backtrace-frame (1+ count)))) |
| 437 | (setq count (1+ count))) | 429 | (setq count (1+ count))) |
| 438 | (goto-char (point-min)) | 430 | (goto-char (point-min)) |
| 439 | (when (looking-at "Debugger entered--\\(Lisp error\\|returning value\\):") | 431 | (when (looking-at "Debugger entered--\\(Lisp error\\|returning value\\):") |
| @@ -623,6 +615,16 @@ Complete list of commands: | |||
| 623 | (use-local-map debugger-mode-map) | 615 | (use-local-map debugger-mode-map) |
| 624 | (run-mode-hooks 'debugger-mode-hook)) | 616 | (run-mode-hooks 'debugger-mode-hook)) |
| 625 | 617 | ||
| 618 | ;; When you change this, you may also need to change the number of | ||
| 619 | ;; frames that the debugger skips. | ||
| 620 | (defun implement-debug-on-entry () | ||
| 621 | "Conditionally call the debugger. | ||
| 622 | A call to this function is inserted by `debug-on-entry' to cause | ||
| 623 | functions to break on entry." | ||
| 624 | (if (or inhibit-debug-on-entry debugger-jumping-flag) | ||
| 625 | nil | ||
| 626 | (funcall debugger 'debug))) | ||
| 627 | |||
| 626 | ;;;###autoload | 628 | ;;;###autoload |
| 627 | (defun debug-on-entry (function) | 629 | (defun debug-on-entry (function) |
| 628 | "Request FUNCTION to invoke debugger each time it is called. | 630 | "Request FUNCTION to invoke debugger each time it is called. |
| @@ -647,7 +649,7 @@ Redefining FUNCTION also cancels it." | |||
| 647 | (debug-convert-byte-code function)) | 649 | (debug-convert-byte-code function)) |
| 648 | (or (consp (symbol-function function)) | 650 | (or (consp (symbol-function function)) |
| 649 | (error "Definition of %s is not a list" function)) | 651 | (error "Definition of %s is not a list" function)) |
| 650 | (fset function (debug-on-entry-1 function (symbol-function function) t)) | 652 | (fset function (debug-on-entry-1 function t)) |
| 651 | (or (memq function debug-function-list) | 653 | (or (memq function debug-function-list) |
| 652 | (push function debug-function-list)) | 654 | (push function debug-function-list)) |
| 653 | function) | 655 | function) |
| @@ -664,7 +666,7 @@ If argument is nil or an empty string, cancel for all functions." | |||
| 664 | (if name (intern name))))) | 666 | (if name (intern name))))) |
| 665 | (if (and function (not (string= function ""))) | 667 | (if (and function (not (string= function ""))) |
| 666 | (progn | 668 | (progn |
| 667 | (let ((f (debug-on-entry-1 function (symbol-function function) nil))) | 669 | (let ((f (debug-on-entry-1 function nil))) |
| 668 | (condition-case nil | 670 | (condition-case nil |
| 669 | (if (and (equal (nth 1 f) '(&rest debug-on-entry-args)) | 671 | (if (and (equal (nth 1 f) '(&rest debug-on-entry-args)) |
| 670 | (eq (car (nth 3 f)) 'apply)) | 672 | (eq (car (nth 3 f)) 'apply)) |
| @@ -695,8 +697,9 @@ If argument is nil or an empty string, cancel for all functions." | |||
| 695 | (setq body (cons (documentation function) body))) | 697 | (setq body (cons (documentation function) body))) |
| 696 | (fset function (cons 'lambda (cons (car contents) body))))))) | 698 | (fset function (cons 'lambda (cons (car contents) body))))))) |
| 697 | 699 | ||
| 698 | (defun debug-on-entry-1 (function defn flag) | 700 | (defun debug-on-entry-1 (function flag) |
| 699 | (let ((tail defn)) | 701 | (let* ((defn (symbol-function function)) |
| 702 | (tail defn)) | ||
| 700 | (if (subrp tail) | 703 | (if (subrp tail) |
| 701 | (error "%s is a built-in function" function) | 704 | (error "%s is a built-in function" function) |
| 702 | (if (eq (car tail) 'macro) (setq tail (cdr tail))) | 705 | (if (eq (car tail) 'macro) (setq tail (cdr tail))) |
| @@ -708,10 +711,10 @@ If argument is nil or an empty string, cancel for all functions." | |||
| 708 | ;; Skip the interactive form. | 711 | ;; Skip the interactive form. |
| 709 | (when (eq 'interactive (car-safe (cadr tail))) | 712 | (when (eq 'interactive (car-safe (cadr tail))) |
| 710 | (setq tail (cdr tail))) | 713 | (setq tail (cdr tail))) |
| 711 | (unless (eq flag (equal (cadr tail) debug-entry-code)) | 714 | (unless (eq flag (equal (cadr tail) '(implement-debug-on-entry))) |
| 712 | ;; Add/remove debug statement as needed. | 715 | ;; Add/remove debug statement as needed. |
| 713 | (if flag | 716 | (if flag |
| 714 | (setcdr tail (cons debug-entry-code (cdr tail))) | 717 | (setcdr tail (cons '(implement-debug-on-entry) (cdr tail))) |
| 715 | (setcdr tail (cddr tail)))) | 718 | (setcdr tail (cddr tail)))) |
| 716 | defn))) | 719 | defn))) |
| 717 | 720 | ||