diff options
author | Miles Bader <miles@gnu.org> | 2005-07-14 08:02:00 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2005-07-14 08:02:00 +0000 |
commit | bacb9790f594207469f22ed9f3e8085ab76e5e2b (patch) | |
tree | b1cee62715d6cd2797f3122e4f058d7bc18ceef6 /lisp/emacs-lisp/debug.el | |
parent | d3e4babdd1267fb5690a17949196640a47c6f159 (diff) | |
parent | ead25b5cabbe092711864eae13a76437e6a65ce1 (diff) | |
download | emacs-bacb9790f594207469f22ed9f3e8085ab76e5e2b.tar.gz emacs-bacb9790f594207469f22ed9f3e8085ab76e5e2b.tar.bz2 emacs-bacb9790f594207469f22ed9f3e8085ab76e5e2b.zip |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-69
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 474-484)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 88-91)
- Merge from emacs--cvs-trunk--0
- Update FSF's address in GPL notices
- Update from CVS
Diffstat (limited to 'lisp/emacs-lisp/debug.el')
-rw-r--r-- | lisp/emacs-lisp/debug.el | 89 |
1 files changed, 59 insertions, 30 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 94cca83a61d..4f968c60b5e 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -150,7 +150,8 @@ first will be printed into the backtrace buffer." (debugger-outer-standard-input standard-input) (debugger-outer-standard-output standard-output) (debugger-outer-inhibit-redisplay inhibit-redisplay) - (debugger-outer-cursor-in-echo-area cursor-in-echo-area)) + (debugger-outer-cursor-in-echo-area cursor-in-echo-area) + (debugger-with-timeout-suspend (with-timeout-suspend))) ;; Set this instead of binding it, so that `q' ;; will not restore it. (setq overriding-terminal-local-map nil) @@ -235,6 +236,7 @@ first will be printed into the backtrace buffer." ;; Drew Adams. --Stef (quit-window)))) (kill-buffer debugger-buffer)) + (with-timeout-unsuspend debugger-with-timeout-suspend) (set-match-data debugger-outer-match-data))) ;; Put into effect the modified values of these variables ;; in case the user set them with the `e' command. @@ -312,11 +314,17 @@ That buffer should be current already." ;; After any frame that uses eval-buffer, ;; insert a line that states the buffer position it's reading at. (save-excursion - (while (re-search-forward "^ eval-buffer(" nil t) - (end-of-line) - (insert (format "\n ;;; Reading at buffer position %d" - (with-current-buffer (nth 2 (backtrace-frame (debugger-frame-number))) - (point)))))) + (let ((tem eval-buffer-list)) + (while (and tem + (re-search-forward "^ eval-\\(buffer\\|region\\)(" nil t)) + (end-of-line) + (insert (format " ; Reading at buffer position %d" + ;; This will get the wrong result + ;; if there are two nested eval-region calls + ;; for the same buffer. That's not a very useful case. + (with-current-buffer (car tem) + (point)))) + (pop tem)))) (debugger-make-xrefs)) (defun debugger-make-xrefs (&optional buffer) @@ -591,10 +599,35 @@ Applies to the frame whose line point is on in the backtrace." (define-key map "e" 'debugger-eval-expression) (define-key map " " 'next-line) (define-key map "R" 'debugger-record-expression) - (define-key map "\C-m" 'help-follow) + (define-key map "\C-m" 'debug-help-follow) (define-key map [mouse-2] 'push-button) map)) +(put 'debugger-mode 'mode-class 'special) + +(defun debugger-mode () + "Mode for backtrace buffers, selected in debugger. +\\<debugger-mode-map> +A line starts with `*' if exiting that frame will call the debugger. +Type \\[debugger-frame] or \\[debugger-frame-clear] to set or remove the `*'. + +When in debugger due to frame being exited, +use the \\[debugger-return-value] command to override the value +being returned from that frame. + +Use \\[debug-on-entry] and \\[cancel-debug-on-entry] to control +which functions will enter the debugger when called. + +Complete list of commands: +\\{debugger-mode-map}" + (kill-all-local-variables) + (setq major-mode 'debugger-mode) + (setq mode-name "Debugger") + (setq truncate-lines t) + (set-syntax-table emacs-lisp-mode-syntax-table) + (use-local-map debugger-mode-map) + (run-mode-hooks 'debugger-mode-hook)) + (defcustom debugger-record-buffer "*Debugger-record*" "*Buffer name for expression values, for \\[debugger-record-expression]." :type 'string @@ -620,30 +653,26 @@ Applies to the frame whose line point is on in the backtrace." (buffer-substring (line-beginning-position 0) (line-end-position 0))))) -(put 'debugger-mode 'mode-class 'special) - -(defun debugger-mode () - "Mode for backtrace buffers, selected in debugger. -\\<debugger-mode-map> -A line starts with `*' if exiting that frame will call the debugger. -Type \\[debugger-frame] or \\[debugger-frame-clear] to set or remove the `*'. +(defun debug-help-follow (&optional pos) + "Follow cross-reference at POS, defaulting to point. -When in debugger due to frame being exited, -use the \\[debugger-return-value] command to override the value -being returned from that frame. - -Use \\[debug-on-entry] and \\[cancel-debug-on-entry] to control -which functions will enter the debugger when called. - -Complete list of commands: -\\{debugger-mode-map}" - (kill-all-local-variables) - (setq major-mode 'debugger-mode) - (setq mode-name "Debugger") - (setq truncate-lines t) - (set-syntax-table emacs-lisp-mode-syntax-table) - (use-local-map debugger-mode-map) - (run-mode-hooks 'debugger-mode-hook)) +For the cross-reference format, see `help-make-xrefs'." + (interactive "d") + (require 'help-mode) + (unless pos + (setq pos (point))) + (unless (push-button pos) + ;; check if the symbol under point is a function or variable + (let ((sym + (intern + (save-excursion + (goto-char pos) (skip-syntax-backward "w_") + (buffer-substring (point) + (progn (skip-syntax-forward "w_") + (point))))))) + (when (or (boundp sym) (fboundp sym) (facep sym)) + (switch-to-buffer-other-window (generate-new-buffer "*Help*")) + (help-do-xref pos #'help-xref-interned (list sym)))))) ;; When you change this, you may also need to change the number of ;; frames that the debugger skips. |