mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 22:41:06 -08:00
(debug-help-follow): New function.
(debugger-mode-map): Use that instead of help-follow. (debugger-setup-buffer): Use eval-buffer-list to handle eval-buffer frames.
This commit is contained in:
parent
3f39f99678
commit
245f0222c6
1 changed files with 34 additions and 14 deletions
|
|
@ -312,18 +312,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 " ; Reading at buffer position %d"
|
||||
(with-current-buffer
|
||||
(or (nth 2 (backtrace-frame (debugger-frame-number)))
|
||||
debugger-old-buffer)
|
||||
(point)))))
|
||||
(while (re-search-forward "^ eval-region(" nil t)
|
||||
(end-of-line)
|
||||
(insert (format " ; Reading at buffer position %d"
|
||||
(with-current-buffer debugger-old-buffer
|
||||
(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)
|
||||
|
|
@ -598,10 +597,10 @@ 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))
|
||||
|
||||
|
||||
(defcustom debugger-record-buffer "*Debugger-record*"
|
||||
"*Buffer name for expression values, for \\[debugger-record-expression]."
|
||||
:type 'string
|
||||
|
|
@ -627,6 +626,27 @@ Applies to the frame whose line point is on in the backtrace."
|
|||
(buffer-substring (line-beginning-position 0)
|
||||
(line-end-position 0)))))
|
||||
|
||||
(defun debug-help-follow (&optional pos)
|
||||
"Follow cross-reference at POS, defaulting to point.
|
||||
|
||||
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))))))
|
||||
|
||||
(put 'debugger-mode 'mode-class 'special)
|
||||
|
||||
(defun debugger-mode ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue