changeset 60256:62670df9ca97

(debug): Hide the buffer if it's not killed. Remove unused and inexistent var `inhibit-trace'. (debugger-mode): Use run-mode-hooks. (debugger-list-functions): Add buttons; setup xref stack.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 26 Feb 2005 05:28:24 +0000
parents 3b19d2763b8b
children 4104a4e7e5c2
files lisp/ChangeLog lisp/emacs-lisp/debug.el
diffstat 2 files changed, 70 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Feb 25 23:32:44 2005 +0000
+++ b/lisp/ChangeLog	Sat Feb 26 05:28:24 2005 +0000
@@ -13,8 +13,8 @@
 
 2005-02-24  Ulf Jasper  <ulf.jasper@web.de>
 
-	* calendar/icalendar.el (icalendar--decode-isodatetime): New
-	optional argument DAY-SHIFT.
+	* calendar/icalendar.el (icalendar--decode-isodatetime):
+	New optional argument DAY-SHIFT.
 	(icalendar-export-region): Fix coding-system-for-write.
 	(icalendar--convert-ical-to-diary): Shift end-day of all-day
 	events by one.
@@ -29,6 +29,13 @@
 	during redisplay.  Call force-window-update after read-event
 	and delete-region to signal that window is not accurate.
 
+2005-02-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/debug.el (debug): Hide the buffer if it's not killed.
+	Remove unused and inexistent var `inhibit-trace'.
+	(debugger-mode): Use run-mode-hooks.
+	(debugger-list-functions): Add buttons; setup xref stack.
+
 2005-02-23  Richard M. Stallman  <rms@gnu.org>
 
 	* calendar/appt.el (appt-time-msg-list): 3rd elt of each
@@ -161,8 +168,8 @@
 	* viper-util.el (viper-glob-unix-files): Fix shell status check.
 	(viper-file-remote-p): Make equivalent to file-remote-p.
 
-	* viper.el (viper-major-mode-modifier-list): Use
-	viper-gnus-modifier-map.
+	* viper.el (viper-major-mode-modifier-list):
+	Use viper-gnus-modifier-map.
 
 2005-02-19  David Kastrup  <dak@gnu.org>
 
@@ -172,7 +179,7 @@
 2005-02-19  Jay Belanger  <belanger@truman.edu>
 
 	* calc/calc-math.el (calc-arctan, calc-tanh, calc-arctanh):
-	Removed extra definitions.
+	Remove extra definitions.
 	(calc-coth): New function.
 	(calcFunc-cot): Fix `let'.
 
@@ -189,8 +196,8 @@
 	query-replace-from-history-variable to handle the case of an empty
 	string entered to accept the suggested default.
 
-	* net/tramp.el (tramp-file-name-for-operation): Use
-	dired-call-process instead of dired-call-process-command.
+	* net/tramp.el (tramp-file-name-for-operation):
+	Use dired-call-process instead of dired-call-process-command.
 
 2005-02-19  Jay Belanger  <belanger@truman.edu>
 
@@ -211,22 +218,22 @@
 
 2005-02-19  Michael Kifer  <kifer@cs.stonybrook.edu>
 
-	* ediff.el (ediff-set-diff-overlays-in-one-buffer,
-	ediff-set-fine-overlays-in-one-buffer,ediff-goto-word) make sure
+	* ediff.el (ediff-set-diff-overlays-in-one-buffer)
+	(ediff-set-fine-overlays-in-one-buffer,ediff-goto-word): Make sure
 	we use the syntax table of the correct buffer.
-	(ediff-same-file-contents,ediff-same-contents): enhancements thanks to
+	(ediff-same-file-contents,ediff-same-contents): Enhancements thanks to
 	Felix Gatzemeier.
 
-	* ediff-init.el (ediff-hide-face): checks for definedness of functions.
-	(ediff-file-remote-p): make synonymous with file-remote-p.
+	* ediff-init.el (ediff-hide-face): Check for definedness of functions.
+	(ediff-file-remote-p): Make synonymous with file-remote-p.
 	In all deffaces ediff-*-face-*, use min-colors.
 
-	* ediff-mult.el (ediff-meta-mark-equal-files): make use of
-        ediff-recurse-to-subdirectories.
-	(ediff-mark-if-equal): check that the arguments are strings, use
+	* ediff-mult.el (ediff-meta-mark-equal-files): Make use of
+	ediff-recurse-to-subdirectories.
+	(ediff-mark-if-equal): Check that the arguments are strings, use
 	ediff-same-contents (after to Felix Gatzemeier).
 
-	* ediff.el (ediff-merge-on-startup): don't set buffer-modified-p to
+	* ediff.el (ediff-merge-on-startup): Don't set buffer-modified-p to
 	nil.
 
 2005-02-18  Stefan Monnier  <monnier@iro.umontreal.ca>
@@ -296,7 +303,7 @@
 2005-02-15  Jay Belanger  <belanger@truman.edu>
 
 	* calc/calc-alg.el: Add simplification rules for calcFunc-sec,
-	calcFunc-csc, calcFunc-cot, calcFunc-sech, calcFunc-csch and
+	calcFunc-csc, calcFunc-cot, calcFunc-sech, calcFunc-csch, and
 	calcFunc-coth.
 	(math-simplify-sqrt): Add simplifications.
 
--- a/lisp/emacs-lisp/debug.el	Fri Feb 25 23:32:44 2005 +0000
+++ b/lisp/emacs-lisp/debug.el	Sat Feb 26 05:28:24 2005 +0000
@@ -1,6 +1,7 @@
 ;;; debug.el --- debuggers and related commands for Emacs
 
-;; Copyright (C) 1985, 1986, 1994, 2001, 2003  Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1994, 2001, 2003, 2005
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: lisp, tools, maint
@@ -188,8 +189,7 @@
 		    (backtrace-debug 3 t))
 		(debugger-reenable)
 		(message "")
-		(let ((inhibit-trace t)
-		      (standard-output nil)
+		(let ((standard-output nil)
 		      (buffer-read-only t))
 		  (message "")
 		  ;; Make sure we unbind buffer-read-only in the right buffer.
@@ -197,15 +197,16 @@
 		    (recursive-edit)))))
 	  ;; Kill or at least neuter the backtrace buffer, so that users
 	  ;; don't try to execute debugger commands in an invalid context.
-	  (if (get-buffer-window debugger-buffer 'visible)
+	  (if (get-buffer-window debugger-buffer 0)
 	      ;; Still visible despite the save-window-excursion?  Maybe it
 	      ;; it's in a pop-up frame.  It would be annoying to delete and
 	      ;; recreate it every time the debugger stops, so instead we'll
-	      ;; erase it but leave it visible.
-	      (save-excursion
-		(set-buffer debugger-buffer)
+	      ;; erase it and hide it but keep it alive.
+	      (with-current-buffer debugger-buffer
 		(erase-buffer)
-		(fundamental-mode))
+		(fundamental-mode)
+		(with-selected-window (get-buffer-window debugger-buffer 0)
+		  (bury-buffer)))
 	    (kill-buffer debugger-buffer))
 	  (set-match-data debugger-outer-match-data)))
       ;; Put into effect the modified values of these variables
@@ -543,29 +544,26 @@
 			       'read-expression-history)))
   (debugger-env-macro (eval-expression exp)))
 
-(defvar debugger-mode-map nil)
-(unless debugger-mode-map
-  (let ((loop ? ))
-    (setq debugger-mode-map (make-keymap))
-    (set-keymap-parent debugger-mode-map button-buffer-map)
-    (suppress-keymap debugger-mode-map)
-    (define-key debugger-mode-map "-" 'negative-argument)
-    (define-key debugger-mode-map "b" 'debugger-frame)
-    (define-key debugger-mode-map "c" 'debugger-continue)
-    (define-key debugger-mode-map "j" 'debugger-jump)
-    (define-key debugger-mode-map "r" 'debugger-return-value)
-    (define-key debugger-mode-map "u" 'debugger-frame-clear)
-    (define-key debugger-mode-map "d" 'debugger-step-through)
-    (define-key debugger-mode-map "l" 'debugger-list-functions)
-    (define-key debugger-mode-map "h" 'describe-mode)
-    (define-key debugger-mode-map "q" 'top-level)
-    (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 "\C-m" 'help-follow)
-    (define-key debugger-mode-map [mouse-2] 'push-button)
-    ))
-
+(defvar debugger-mode-map
+  (let ((map (make-keymap)))
+    (set-keymap-parent map button-buffer-map)
+    (suppress-keymap map)
+    (define-key map "-" 'negative-argument)
+    (define-key map "b" 'debugger-frame)
+    (define-key map "c" 'debugger-continue)
+    (define-key map "j" 'debugger-jump)
+    (define-key map "r" 'debugger-return-value)
+    (define-key map "u" 'debugger-frame-clear)
+    (define-key map "d" 'debugger-step-through)
+    (define-key map "l" 'debugger-list-functions)
+    (define-key map "h" 'describe-mode)
+    (define-key map "q" 'top-level)
+    (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 [mouse-2] 'push-button)
+    map))
 
 (defcustom debugger-record-buffer "*Debugger-record*"
   "*Buffer name for expression values, for \\[debugger-record-expression]."
@@ -616,7 +614,7 @@
   (setq truncate-lines t)
   (set-syntax-table emacs-lisp-mode-syntax-table)
   (use-local-map debugger-mode-map)
-  (run-hooks 'debugger-mode-hook))
+  (run-mode-hooks 'debugger-mode-hook))
 
 ;;;###autoload
 (defun debug-on-entry (function)
@@ -716,22 +714,23 @@
 (defun debugger-list-functions ()
   "Display a list of all the functions now set to debug on entry."
   (interactive)
-  (with-output-to-temp-buffer "*Help*"
-    (if (null debug-function-list)
-	(princ "No debug-on-entry functions now\n")
-      (princ "Functions set to debug on entry:\n\n")
-      (let ((list debug-function-list))
-	(while list
-	  (prin1 (car list))
-	  (terpri)
-	  (setq list (cdr list))))
-      (princ "Note: if you have redefined a function, then it may no longer\n")
-      (princ "be set to debug on entry, even if it is in the list."))
-    (save-excursion
-      (set-buffer standard-output)
-      (help-mode))))
+  (require 'help-mode)
+  (help-setup-xref '(debugger-list-functions) (interactive-p))
+  (with-output-to-temp-buffer (help-buffer)
+    (with-current-buffer standard-output
+      (if (null debug-function-list)
+	  (princ "No debug-on-entry functions now\n")
+	(princ "Functions set to debug on entry:\n\n")
+	(dolist (fun debug-function-list)
+	  (make-text-button (point) (progn (prin1 fun) (point))
+			    'type 'help-function
+			    'help-args (list fun))
+	  (terpri))
+	(terpri)
+	(princ "Note: if you have redefined a function, then it may no longer\n")
+	(princ "be set to debug on entry, even if it is in the list.")))))
 
 (provide 'debug)
 
-;;; arch-tag: b6ec7047-f801-4103-9c63-d69322db9d3b
+;; arch-tag: b6ec7047-f801-4103-9c63-d69322db9d3b
 ;;; debug.el ends here