changeset 40583:87996dd441b7

easy source access from the *debugger* buffer
author Sam Steingold <sds@gnu.org>
date Wed, 31 Oct 2001 19:32:26 +0000
parents f520d592859d
children 252c24214c9f
files lisp/ChangeLog lisp/emacs-lisp/debug.el
diffstat 2 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Oct 31 18:28:11 2001 +0000
+++ b/lisp/ChangeLog	Wed Oct 31 19:32:26 2001 +0000
@@ -1,3 +1,9 @@
+2001-10-31  Sam Steingold  <sds@gnu.org>
+
+	* emacs-lisp/debug.el (debugger-make-xrefs): New function.
+	(debugger-setup-buffer): Call it.
+	(debugger-mode-map): Bind RET and mouse-2.
+
 2001-10-31  Pavel Jan,Bm(Bk  <Pavel@Janik.cz>
 
 	* startup.el: Document command line option --no-window-system
--- a/lisp/emacs-lisp/debug.el	Wed Oct 31 18:28:11 2001 +0000
+++ b/lisp/emacs-lisp/debug.el	Wed Oct 31 19:32:26 2001 +0000
@@ -267,7 +267,20 @@
 	 (prin1 (if (eq (car debugger-args) 'nil)
 		    (cdr debugger-args) debugger-args)
 		(current-buffer))
-	 (insert ?\n))))
+	 (insert ?\n)))
+  (debugger-make-xrefs))
+
+(defun debugger-make-xrefs (&optional buffer)
+  "Create cross-references in the debugger buffer."
+  (interactive "b")
+  (save-excursion
+    (set-buffer (or buffer (current-buffer)))
+    (goto-char (point-min))
+    (let ((buffer-read-only nil))
+      (while (re-search-forward "^[* ] (?\\(\\(\\sw\\|\\s_\\)+\\)" nil t)
+        (let* ((sym (intern-soft (match-string 1)))
+               (file (symbol-file sym)))
+          (when file (help-xref-button 1 'help-function-def sym file)))))))
 
 (defun debugger-step-through ()
   "Proceed, stepping through subexpressions of this expression.
@@ -441,8 +454,7 @@
   (debugger-env-macro (eval-expression exp)))
 
 (defvar debugger-mode-map nil)
-(if debugger-mode-map
-    nil
+(unless debugger-mode-map
   (let ((loop ? ))
     (setq debugger-mode-map (make-keymap))
     (suppress-keymap debugger-mode-map)
@@ -459,6 +471,8 @@
     (define-key debugger-mode-map "e" 'debugger-eval-expression)
     (define-key debugger-mode-map " " 'next-line)
     (define-key debugger-mode-map "R" 'debugger-record-expression)
+    (define-key debugger-mode-map [RET] 'help-follow)
+    (define-key debugger-mode-map [mouse-2] 'push-button)
     ))