Mercurial > emacs
annotate lisp/emacs-lisp/debug.el @ 44196:357e40df43b5
Fix typo.
author | Pavel Janík <Pavel@Janik.cz> |
---|---|
date | Thu, 28 Mar 2002 14:16:09 +0000 |
parents | afe64ec4637c |
children | 5496c590d5ad |
rev | line source |
---|---|
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
477
diff
changeset
|
1 ;;; debug.el --- debuggers and related commands for Emacs |
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
477
diff
changeset
|
2 |
43911 | 3 ;; Copyright (C) 1985, 1986, 1994, 2001 Free Software Foundation, Inc. |
845 | 4 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
5 ;; Maintainer: FSF |
2247
2c7997f249eb
Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
6 ;; Keywords: lisp, tools, maint |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
7 |
473 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
473 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
14169 | 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
473 | 24 |
2307
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
25 ;;; Commentary: |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
26 |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
27 ;; This is a major mode documented in the Emacs manual. |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
28 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
29 ;;; Code: |
473 | 30 |
43911 | 31 (require 'button) |
32 | |
21365 | 33 (defgroup debugger nil |
34 "Debuggers and related commands for Emacs." | |
35 :prefix "debugger-" | |
36 :group 'debug) | |
37 | |
38 (defcustom debugger-mode-hook nil | |
39 "*Hooks run when `debugger-mode' is turned on." | |
40 :type 'hook | |
21669
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21365
diff
changeset
|
41 :group 'debugger |
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21365
diff
changeset
|
42 :version "20.3") |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
43 |
26325
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
44 (defcustom debugger-batch-max-lines 40 |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
45 "*Maximum lines to show in debugger buffer in a noninteractive Emacs. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
46 When the debugger is entered and Emacs is running in batch mode, |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
47 if the backtrace text has more than this many lines, |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
48 the middle is discarded, and just the beginning and end are displayed." |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
49 :type 'integer |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
50 :group 'debugger |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
51 :version "21.1") |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
52 |
21365 | 53 (defcustom debug-function-list nil |
54 "List of functions currently set for debug on entry." | |
55 :type '(repeat function) | |
56 :group 'debugger) | |
473 | 57 |
21365 | 58 (defcustom debugger-step-after-exit nil |
59 "Non-nil means \"single-step\" after the debugger exits." | |
60 :type 'boolean | |
61 :group 'debugger) | |
10731
65e10f44e765
(debugger-step-after-exit): Variable declared.
Richard M. Stallman <rms@gnu.org>
parents:
10728
diff
changeset
|
62 |
65e10f44e765
(debugger-step-after-exit): Variable declared.
Richard M. Stallman <rms@gnu.org>
parents:
10728
diff
changeset
|
63 (defvar debugger-value nil |
65e10f44e765
(debugger-step-after-exit): Variable declared.
Richard M. Stallman <rms@gnu.org>
parents:
10728
diff
changeset
|
64 "This is the value for the debugger to return, when it returns.") |
65e10f44e765
(debugger-step-after-exit): Variable declared.
Richard M. Stallman <rms@gnu.org>
parents:
10728
diff
changeset
|
65 |
65e10f44e765
(debugger-step-after-exit): Variable declared.
Richard M. Stallman <rms@gnu.org>
parents:
10728
diff
changeset
|
66 (defvar debugger-old-buffer nil |
65e10f44e765
(debugger-step-after-exit): Variable declared.
Richard M. Stallman <rms@gnu.org>
parents:
10728
diff
changeset
|
67 "This is the buffer that was current when the debugger was entered.") |
65e10f44e765
(debugger-step-after-exit): Variable declared.
Richard M. Stallman <rms@gnu.org>
parents:
10728
diff
changeset
|
68 |
42063
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
69 (defvar debugger-previous-backtrace nil |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
70 "The contents of the previous backtrace (including text properties). |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
71 This is to optimize `debugger-make-xrefs'.") |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
72 |
6926
027b7de8a571
(debug, debugger-eval-expression): Preserve match-data.
Karl Heuer <kwzh@gnu.org>
parents:
6567
diff
changeset
|
73 (defvar debugger-outer-match-data) |
11062
302f676eeca0
(debugger-outer-load-read-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
10731
diff
changeset
|
74 (defvar debugger-outer-load-read-function) |
302f676eeca0
(debugger-outer-load-read-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
10731
diff
changeset
|
75 (defvar debugger-outer-overriding-local-map) |
18166
84c0a412aa71
(debug, debugger-eval-expression):
Richard M. Stallman <rms@gnu.org>
parents:
17262
diff
changeset
|
76 (defvar debugger-outer-overriding-terminal-local-map) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
77 (defvar debugger-outer-track-mouse) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
78 (defvar debugger-outer-last-command) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
79 (defvar debugger-outer-this-command) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
80 (defvar debugger-outer-unread-command-char) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
81 (defvar debugger-outer-unread-command-events) |
22921
48b85e4a4dd3
(debugger-outer-unread-post-input-method-events): New variable.
Kenichi Handa <handa@m17n.org>
parents:
22114
diff
changeset
|
82 (defvar debugger-outer-unread-post-input-method-events) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
83 (defvar debugger-outer-last-input-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
84 (defvar debugger-outer-last-command-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
85 (defvar debugger-outer-last-nonmenu-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
86 (defvar debugger-outer-last-event-frame) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
87 (defvar debugger-outer-standard-input) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
88 (defvar debugger-outer-standard-output) |
24741
00ef85c8a0ff
(debugger-outer-inhibit-redisplay): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24524
diff
changeset
|
89 (defvar debugger-outer-inhibit-redisplay) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
90 (defvar debugger-outer-cursor-in-echo-area) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
91 |
473 | 92 ;;;###autoload |
93 (setq debugger 'debug) | |
94 ;;;###autoload | |
95 (defun debug (&rest debugger-args) | |
6048
ff40882c5578
(debug, debug-on-entry): Doc strings.
Richard M. Stallman <rms@gnu.org>
parents:
5585
diff
changeset
|
96 "Enter debugger. To return, type \\<debugger-mode-map>`\\[debugger-continue]'. |
473 | 97 Arguments are mainly for use when this is called from the internals |
98 of the evaluator. | |
99 | |
100 You may call with no args, or you may pass nil as the first arg and | |
101 any other args you like. In that case, the list of args after the | |
102 first will be printed into the backtrace buffer." | |
11069
ee94cf4fd05a
(debug): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11062
diff
changeset
|
103 (interactive) |
26325
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
104 (unless noninteractive |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
105 (message "Entering debugger...")) |
473 | 106 (let (debugger-value |
107 (debug-on-error nil) | |
108 (debug-on-quit nil) | |
109 (debugger-buffer (let ((default-major-mode 'fundamental-mode)) | |
6567
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
110 (get-buffer-create "*Backtrace*"))) |
473 | 111 (debugger-old-buffer (current-buffer)) |
112 (debugger-step-after-exit nil) | |
113 ;; Don't keep reading from an executing kbd macro! | |
15302
c23c9712ef5c
Use executing-kbd-macro, not executing-macro.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
114 (executing-kbd-macro nil) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
115 ;; Save the outer values of these vars for the `e' command |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
116 ;; before we replace the values. |
6926
027b7de8a571
(debug, debugger-eval-expression): Preserve match-data.
Karl Heuer <kwzh@gnu.org>
parents:
6567
diff
changeset
|
117 (debugger-outer-match-data (match-data)) |
11062
302f676eeca0
(debugger-outer-load-read-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
10731
diff
changeset
|
118 (debugger-outer-load-read-function load-read-function) |
302f676eeca0
(debugger-outer-load-read-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
10731
diff
changeset
|
119 (debugger-outer-overriding-local-map overriding-local-map) |
18166
84c0a412aa71
(debug, debugger-eval-expression):
Richard M. Stallman <rms@gnu.org>
parents:
17262
diff
changeset
|
120 (debugger-outer-overriding-terminal-local-map |
84c0a412aa71
(debug, debugger-eval-expression):
Richard M. Stallman <rms@gnu.org>
parents:
17262
diff
changeset
|
121 overriding-terminal-local-map) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
122 (debugger-outer-track-mouse track-mouse) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
123 (debugger-outer-last-command last-command) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
124 (debugger-outer-this-command this-command) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
125 (debugger-outer-unread-command-char unread-command-char) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
126 (debugger-outer-unread-command-events unread-command-events) |
22921
48b85e4a4dd3
(debugger-outer-unread-post-input-method-events): New variable.
Kenichi Handa <handa@m17n.org>
parents:
22114
diff
changeset
|
127 (debugger-outer-unread-post-input-method-events |
48b85e4a4dd3
(debugger-outer-unread-post-input-method-events): New variable.
Kenichi Handa <handa@m17n.org>
parents:
22114
diff
changeset
|
128 unread-post-input-method-events) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
129 (debugger-outer-last-input-event last-input-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
130 (debugger-outer-last-command-event last-command-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
131 (debugger-outer-last-nonmenu-event last-nonmenu-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
132 (debugger-outer-last-event-frame last-event-frame) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
133 (debugger-outer-standard-input standard-input) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
134 (debugger-outer-standard-output standard-output) |
24741
00ef85c8a0ff
(debugger-outer-inhibit-redisplay): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24524
diff
changeset
|
135 (debugger-outer-inhibit-redisplay inhibit-redisplay) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
136 (debugger-outer-cursor-in-echo-area cursor-in-echo-area)) |
18190
bca8e581535a
(debug): Set overriding-terminal-local-map to nil,
Richard M. Stallman <rms@gnu.org>
parents:
18166
diff
changeset
|
137 ;; Set this instead of binding it, so that `q' |
bca8e581535a
(debug): Set overriding-terminal-local-map to nil,
Richard M. Stallman <rms@gnu.org>
parents:
18166
diff
changeset
|
138 ;; will not restore it. |
26428
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
139 (setq overriding-terminal-local-map nil) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
140 ;; Don't let these magic variables affect the debugger itself. |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
141 (let ((last-command nil) this-command track-mouse |
5585
0c8f4489999d
(debug): Bind unread-command-char to -1, not nil.
Richard M. Stallman <rms@gnu.org>
parents:
5545
diff
changeset
|
142 (unread-command-char -1) unread-command-events |
22921
48b85e4a4dd3
(debugger-outer-unread-post-input-method-events): New variable.
Kenichi Handa <handa@m17n.org>
parents:
22114
diff
changeset
|
143 unread-post-input-method-events |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
144 last-input-event last-command-event last-nonmenu-event |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
145 last-event-frame |
11062
302f676eeca0
(debugger-outer-load-read-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
10731
diff
changeset
|
146 overriding-local-map |
302f676eeca0
(debugger-outer-load-read-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
10731
diff
changeset
|
147 load-read-function |
19889
3e6802bae367
(debug): Allow recursive minibuffers if we're in a minibuffer already.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
148 ;; If we are inside a minibuffer, allow nesting |
3e6802bae367
(debug): Allow recursive minibuffers if we're in a minibuffer already.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
149 ;; so that we don't get an error from the `e' command. |
23988
571d2c4f3edf
(debug): Leave recursive minibuffer enabled
Andreas Schwab <schwab@suse.de>
parents:
22921
diff
changeset
|
150 (enable-recursive-minibuffers |
571d2c4f3edf
(debug): Leave recursive minibuffer enabled
Andreas Schwab <schwab@suse.de>
parents:
22921
diff
changeset
|
151 (or enable-recursive-minibuffers (> (minibuffer-depth) 0))) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
152 (standard-input t) (standard-output t) |
24741
00ef85c8a0ff
(debugger-outer-inhibit-redisplay): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24524
diff
changeset
|
153 inhibit-redisplay |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
154 (cursor-in-echo-area nil)) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
155 (unwind-protect |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
156 (save-excursion |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
157 (save-window-excursion |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
158 (pop-to-buffer debugger-buffer) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
159 (debugger-mode) |
26325
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
160 (debugger-setup-buffer debugger-args) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
161 (when noninteractive |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
162 ;; If the backtrace is long, save the beginning |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
163 ;; and the end, but discard the middle. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
164 (when (> (count-lines (point-min) (point-max)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
165 debugger-batch-max-lines) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
166 (goto-char (point-min)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
167 (forward-line (/ 2 debugger-batch-max-lines)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
168 (let ((middlestart (point))) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
169 (goto-char (point-max)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
170 (forward-line (- (/ 2 debugger-batch-max-lines) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
171 debugger-batch-max-lines)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
172 (delete-region middlestart (point))) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
173 (insert "...\n")) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
174 (goto-char (point-min)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
175 (message (buffer-string)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
176 (kill-emacs)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
177 (if (eq (car debugger-args) 'debug) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
178 ;; Skip the frames for backtrace-debug, byte-code, and debug. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
179 (backtrace-debug 3 t)) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
180 (debugger-reenable) |
473 | 181 (message "") |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
182 (let ((inhibit-trace t) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
183 (standard-output nil) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
184 (buffer-read-only t)) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
185 (message "") |
17262
76bfab081263
(debug): Use save-excursion inside the binding of buffer-read-only.
Richard M. Stallman <rms@gnu.org>
parents:
17003
diff
changeset
|
186 ;; Make sure we unbind buffer-read-only in the right buffer. |
76bfab081263
(debug): Use save-excursion inside the binding of buffer-read-only.
Richard M. Stallman <rms@gnu.org>
parents:
17003
diff
changeset
|
187 (save-excursion |
76bfab081263
(debug): Use save-excursion inside the binding of buffer-read-only.
Richard M. Stallman <rms@gnu.org>
parents:
17003
diff
changeset
|
188 (recursive-edit))))) |
6567
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
189 ;; Kill or at least neuter the backtrace buffer, so that users |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
190 ;; don't try to execute debugger commands in an invalid context. |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
191 (if (get-buffer-window debugger-buffer 'visible) |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
192 ;; Still visible despite the save-window-excursion? Maybe it |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
193 ;; it's in a pop-up frame. It would be annoying to delete and |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
194 ;; recreate it every time the debugger stops, so instead we'll |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
195 ;; erase it but leave it visible. |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
196 (save-excursion |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
197 (set-buffer debugger-buffer) |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
198 (erase-buffer) |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
199 (fundamental-mode)) |
baf8fe0c51e3
(debug): Behave sensibly if pop-up-frames is set.
Karl Heuer <kwzh@gnu.org>
parents:
6468
diff
changeset
|
200 (kill-buffer debugger-buffer)) |
21161
37f271ee9f6f
(debug, debugger-env-macro): store-match-data => set-match-data.
Richard M. Stallman <rms@gnu.org>
parents:
20885
diff
changeset
|
201 (set-match-data debugger-outer-match-data))) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
202 ;; Put into effect the modified values of these variables |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
203 ;; in case the user set them with the `e' command. |
11062
302f676eeca0
(debugger-outer-load-read-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
10731
diff
changeset
|
204 (setq load-read-function debugger-outer-load-read-function) |
302f676eeca0
(debugger-outer-load-read-function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
10731
diff
changeset
|
205 (setq overriding-local-map debugger-outer-overriding-local-map) |
18166
84c0a412aa71
(debug, debugger-eval-expression):
Richard M. Stallman <rms@gnu.org>
parents:
17262
diff
changeset
|
206 (setq overriding-terminal-local-map |
84c0a412aa71
(debug, debugger-eval-expression):
Richard M. Stallman <rms@gnu.org>
parents:
17262
diff
changeset
|
207 debugger-outer-overriding-terminal-local-map) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
208 (setq track-mouse debugger-outer-track-mouse) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
209 (setq last-command debugger-outer-last-command) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
210 (setq this-command debugger-outer-this-command) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
211 (setq unread-command-char debugger-outer-unread-command-char) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
212 (setq unread-command-events debugger-outer-unread-command-events) |
22921
48b85e4a4dd3
(debugger-outer-unread-post-input-method-events): New variable.
Kenichi Handa <handa@m17n.org>
parents:
22114
diff
changeset
|
213 (setq unread-post-input-method-events |
48b85e4a4dd3
(debugger-outer-unread-post-input-method-events): New variable.
Kenichi Handa <handa@m17n.org>
parents:
22114
diff
changeset
|
214 debugger-outer-unread-post-input-method-events) |
5544
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
215 (setq last-input-event debugger-outer-last-input-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
216 (setq last-command-event debugger-outer-last-command-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
217 (setq last-nonmenu-event debugger-outer-last-nonmenu-event) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
218 (setq last-event-frame debugger-outer-last-event-frame) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
219 (setq standard-input debugger-outer-standard-input) |
ab9c9a611b5a
(debug): Bind a bunch of vars, like last-command, to
Richard M. Stallman <rms@gnu.org>
parents:
5430
diff
changeset
|
220 (setq standard-output debugger-outer-standard-output) |
24741
00ef85c8a0ff
(debugger-outer-inhibit-redisplay): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
24524
diff
changeset
|
221 (setq inhibit-redisplay debugger-outer-inhibit-redisplay) |
5545 | 222 (setq cursor-in-echo-area debugger-outer-cursor-in-echo-area) |
473 | 223 (setq debug-on-next-call debugger-step-after-exit) |
224 debugger-value)) | |
225 | |
26325
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
226 (defun debugger-setup-buffer (debugger-args) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
227 "Initialize the `*Backtrace*' buffer for entry to the debugger. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
228 That buffer should be current already." |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
229 (setq buffer-read-only nil) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
230 (erase-buffer) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
231 (set-buffer-multibyte nil) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
232 (let ((standard-output (current-buffer)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
233 (print-escape-newlines t) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
234 (print-level 8) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
235 (print-length 50)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
236 (backtrace)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
237 (goto-char (point-min)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
238 (delete-region (point) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
239 (progn |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
240 (search-forward "\n debug(") |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
241 (forward-line 1) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
242 (point))) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
243 (insert "Debugger entered") |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
244 ;; lambda is for debug-on-call when a function call is next. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
245 ;; debug is for debug-on-entry function called. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
246 (cond ((memq (car debugger-args) '(lambda debug)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
247 (insert "--entering a function:\n") |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
248 (if (eq (car debugger-args) 'debug) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
249 (progn |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
250 (delete-char 1) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
251 (insert ?*) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
252 (beginning-of-line)))) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
253 ;; Exiting a function. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
254 ((eq (car debugger-args) 'exit) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
255 (insert "--returning value: ") |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
256 (setq debugger-value (nth 1 debugger-args)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
257 (prin1 debugger-value (current-buffer)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
258 (insert ?\n) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
259 (delete-char 1) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
260 (insert ? ) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
261 (beginning-of-line)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
262 ;; Debugger entered for an error. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
263 ((eq (car debugger-args) 'error) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
264 (insert "--Lisp error: ") |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
265 (prin1 (nth 1 debugger-args) (current-buffer)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
266 (insert ?\n)) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
267 ;; debug-on-call, when the next thing is an eval. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
268 ((eq (car debugger-args) t) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
269 (insert "--beginning evaluation of function call form:\n")) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
270 ;; User calls debug directly. |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
271 (t |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
272 (insert ": ") |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
273 (prin1 (if (eq (car debugger-args) 'nil) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
274 (cdr debugger-args) debugger-args) |
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
275 (current-buffer)) |
40583
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
276 (insert ?\n))) |
43134
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
277 ;; After any frame that uses eval-buffer, |
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
278 ;; insert a line that states the buffer position it's reading at. |
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
279 (save-excursion |
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
280 (while (re-search-forward "^ eval-buffer(" nil t) |
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
281 (end-of-line) |
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
282 (insert (format "\n ;;; Reading at buffer position %d" |
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
283 (with-current-buffer (nth 2 (backtrace-frame (debugger-frame-number))) |
43033
9af85e74c287
(debugger-setup-buffer): When an eval-buffer frame was reading from a buffer,
Richard M. Stallman <rms@gnu.org>
parents:
42304
diff
changeset
|
284 (point)))))) |
40583
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
285 (debugger-make-xrefs)) |
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
286 |
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
287 (defun debugger-make-xrefs (&optional buffer) |
42063
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
288 "Attach cross-references to symbol names in the `*Backtrace*' buffer." |
40583
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
289 (interactive "b") |
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
290 (save-excursion |
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
291 (set-buffer (or buffer (current-buffer))) |
42063
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
292 (setq buffer (current-buffer)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
293 (let ((buffer-read-only nil) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
294 (old-end 1) (new-end 1)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
295 ;; If we saved an old backtrace, find the common part |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
296 ;; between the new and the old. |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
297 ;; Compare line by line, starting from the end, |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
298 ;; because that's the part that is likely to be unchanged. |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
299 (if debugger-previous-backtrace |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
300 (let (old-start new-start (all-match t)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
301 (goto-char (point-max)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
302 (with-temp-buffer |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
303 (insert debugger-previous-backtrace) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
304 (while (and all-match (not (bobp))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
305 (setq old-end (point)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
306 (forward-line -1) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
307 (setq old-start (point)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
308 (with-current-buffer buffer |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
309 (setq new-end (point)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
310 (forward-line -1) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
311 (setq new-start (point))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
312 (if (not (zerop |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
313 (compare-buffer-substrings |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
314 (current-buffer) old-start old-end |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
315 buffer new-start new-end))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
316 (setq all-match nil)))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
317 ;; Now new-end is the position of the start of the |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
318 ;; unchanged part in the current buffer, and old-end is |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
319 ;; the position of that same text in the saved old |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
320 ;; backtrace. But we must subtract 1 since strings are |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
321 ;; indexed in origin 0. |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
322 |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
323 ;; Replace the unchanged part of the backtrace |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
324 ;; with the text from debugger-previous-backtrace, |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
325 ;; since that already has the proper xrefs. |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
326 ;; With this optimization, we only need to scan |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
327 ;; the changed part of the backtrace. |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
328 (delete-region new-end (point-max)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
329 (goto-char (point-max)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
330 (insert (substring debugger-previous-backtrace (1- old-end))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
331 ;; Make the unchanged part of the backtrace inaccessible |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
332 ;; so it won't be scanned. |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
333 (narrow-to-region (point-min) new-end))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
334 |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
335 ;; Scan the new part of the backtrace, inserting xrefs. |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
336 (goto-char (point-min)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
337 (while (progn |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
338 (skip-syntax-forward "^w_") |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
339 (not (eobp))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
340 (let* ((beg (point)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
341 (end (progn (skip-syntax-forward "w_") (point))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
342 (sym (intern-soft (buffer-substring-no-properties |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
343 beg end))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
344 (file (and sym (symbol-file sym)))) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
345 (when file |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
346 (goto-char beg) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
347 ;; help-xref-button needs to operate on something matched |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
348 ;; by a regexp, so set that up for it. |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
349 (re-search-forward "\\(\\(\\sw\\|\\s_\\)+\\)") |
42304
8e051a31d2cd
(debugger-mode-map): Bind C-m, not `RET'.
Richard M. Stallman <rms@gnu.org>
parents:
42078
diff
changeset
|
350 (help-xref-button 1 'help-function-def sym file))) |
8e051a31d2cd
(debugger-mode-map): Bind C-m, not `RET'.
Richard M. Stallman <rms@gnu.org>
parents:
42078
diff
changeset
|
351 (forward-line 1)) |
42063
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
352 (widen)) |
12577e136b14
(debugger-make-xrefs): Optimize by (1) using skip-syntax-forward
Richard M. Stallman <rms@gnu.org>
parents:
40856
diff
changeset
|
353 (setq debugger-previous-backtrace (buffer-string)))) |
26325
8523249aaee3
(debug): If noninteractive, display the
Gerd Moellmann <gerd@gnu.org>
parents:
24741
diff
changeset
|
354 |
473 | 355 (defun debugger-step-through () |
356 "Proceed, stepping through subexpressions of this expression. | |
357 Enter another debugger on next entry to eval, apply or funcall." | |
358 (interactive) | |
359 (setq debugger-step-after-exit t) | |
360 (message "Proceeding, will debug on next eval or call.") | |
361 (exit-recursive-edit)) | |
362 | |
363 (defun debugger-continue () | |
364 "Continue, evaluating this expression without stopping." | |
365 (interactive) | |
26948
5385b12ef9a8
(debugger-continue): Don't continue If
Gerd Moellmann <gerd@gnu.org>
parents:
26428
diff
changeset
|
366 (unless debugger-may-continue |
5385b12ef9a8
(debugger-continue): Don't continue If
Gerd Moellmann <gerd@gnu.org>
parents:
26428
diff
changeset
|
367 (error "Cannot continue")) |
473 | 368 (message "Continuing.") |
369 (exit-recursive-edit)) | |
370 | |
371 (defun debugger-return-value (val) | |
372 "Continue, specifying value to return. | |
373 This is only useful when the value returned from the debugger | |
374 will be used, such as in a debug on exit from a frame." | |
375 (interactive "XReturn value (evaluated): ") | |
376 (setq debugger-value val) | |
377 (princ "Returning " t) | |
378 (prin1 debugger-value) | |
379 (exit-recursive-edit)) | |
380 | |
381 (defun debugger-jump () | |
382 "Continue to exit from this frame, with all debug-on-entry suspended." | |
383 (interactive) | |
43134
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
384 (debugger-frame) |
473 | 385 ;; Turn off all debug-on-entry functions |
386 ;; but leave them in the list. | |
387 (let ((list debug-function-list)) | |
388 (while list | |
389 (fset (car list) | |
390 (debug-on-entry-1 (car list) (symbol-function (car list)) nil)) | |
391 (setq list (cdr list)))) | |
392 (message "Continuing through this frame") | |
393 (exit-recursive-edit)) | |
394 | |
395 (defun debugger-reenable () | |
396 "Turn all debug-on-entry functions back on." | |
397 (let ((list debug-function-list)) | |
398 (while list | |
399 (or (consp (symbol-function (car list))) | |
400 (debug-convert-byte-code (car list))) | |
401 (fset (car list) | |
402 (debug-on-entry-1 (car list) (symbol-function (car list)) t)) | |
403 (setq list (cdr list))))) | |
404 | |
405 (defun debugger-frame-number () | |
406 "Return number of frames in backtrace before the one point points at." | |
407 (save-excursion | |
408 (beginning-of-line) | |
409 (let ((opoint (point)) | |
410 (count 0)) | |
43134
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
411 (while (not (eq (cadr (backtrace-frame count)) 'debug)) |
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
412 (setq count (1+ count))) |
473 | 413 (goto-char (point-min)) |
414 (if (or (equal (buffer-substring (point) (+ (point) 6)) | |
415 "Signal") | |
416 (equal (buffer-substring (point) (+ (point) 6)) | |
417 "Return")) | |
418 (progn | |
419 (search-forward ":") | |
420 (forward-sexp 1))) | |
421 (forward-line 1) | |
422 (while (progn | |
423 (forward-char 2) | |
424 (if (= (following-char) ?\() | |
425 (forward-sexp 1) | |
426 (forward-sexp 2)) | |
427 (forward-line 1) | |
428 (<= (point) opoint)) | |
43033
9af85e74c287
(debugger-setup-buffer): When an eval-buffer frame was reading from a buffer,
Richard M. Stallman <rms@gnu.org>
parents:
42304
diff
changeset
|
429 (if (looking-at " *;;;") |
9af85e74c287
(debugger-setup-buffer): When an eval-buffer frame was reading from a buffer,
Richard M. Stallman <rms@gnu.org>
parents:
42304
diff
changeset
|
430 (forward-line 1)) |
473 | 431 (setq count (1+ count))) |
432 count))) | |
433 | |
434 (defun debugger-frame () | |
435 "Request entry to debugger when this frame exits. | |
436 Applies to the frame whose line point is on in the backtrace." | |
437 (interactive) | |
43034
c803f1ca9d2b
(debugger-frame-clear, debugger-frame): Error on non-frame line.
Richard M. Stallman <rms@gnu.org>
parents:
43033
diff
changeset
|
438 (save-excursion |
c803f1ca9d2b
(debugger-frame-clear, debugger-frame): Error on non-frame line.
Richard M. Stallman <rms@gnu.org>
parents:
43033
diff
changeset
|
439 (beginning-of-line) |
c803f1ca9d2b
(debugger-frame-clear, debugger-frame): Error on non-frame line.
Richard M. Stallman <rms@gnu.org>
parents:
43033
diff
changeset
|
440 (if (looking-at " *;;;\\|[a-z]") |
c803f1ca9d2b
(debugger-frame-clear, debugger-frame): Error on non-frame line.
Richard M. Stallman <rms@gnu.org>
parents:
43033
diff
changeset
|
441 (error "This line is not a function call"))) |
473 | 442 (beginning-of-line) |
43134
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
443 (backtrace-debug (debugger-frame-number) t) |
473 | 444 (if (= (following-char) ? ) |
445 (let ((buffer-read-only nil)) | |
446 (delete-char 1) | |
447 (insert ?*))) | |
448 (beginning-of-line)) | |
449 | |
450 (defun debugger-frame-clear () | |
22114
0fbcff056c0f
(debugger-frame-clear): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
451 "Do not enter debugger when this frame exits. |
473 | 452 Applies to the frame whose line point is on in the backtrace." |
453 (interactive) | |
43034
c803f1ca9d2b
(debugger-frame-clear, debugger-frame): Error on non-frame line.
Richard M. Stallman <rms@gnu.org>
parents:
43033
diff
changeset
|
454 (save-excursion |
c803f1ca9d2b
(debugger-frame-clear, debugger-frame): Error on non-frame line.
Richard M. Stallman <rms@gnu.org>
parents:
43033
diff
changeset
|
455 (beginning-of-line) |
c803f1ca9d2b
(debugger-frame-clear, debugger-frame): Error on non-frame line.
Richard M. Stallman <rms@gnu.org>
parents:
43033
diff
changeset
|
456 (if (looking-at " *;;;\\|[a-z]") |
c803f1ca9d2b
(debugger-frame-clear, debugger-frame): Error on non-frame line.
Richard M. Stallman <rms@gnu.org>
parents:
43033
diff
changeset
|
457 (error "This line is not a function call"))) |
473 | 458 (beginning-of-line) |
43134
ecd029f63cc0
(debugger-frame-offset): Var deleted.
Richard M. Stallman <rms@gnu.org>
parents:
43034
diff
changeset
|
459 (backtrace-debug (debugger-frame-number) nil) |
473 | 460 (if (= (following-char) ?*) |
461 (let ((buffer-read-only nil)) | |
462 (delete-char 1) | |
463 (insert ? ))) | |
464 (beginning-of-line)) | |
465 | |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
466 |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
467 |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
468 (put 'debugger-env-macro 'lisp-indent-function 0) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
469 (defmacro debugger-env-macro (&rest body) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
470 "Run BODY in original environment." |
26428
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
471 `(save-excursion |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
472 (if (null (buffer-name debugger-old-buffer)) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
473 ;; old buffer deleted |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
474 (setq debugger-old-buffer (current-buffer))) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
475 (set-buffer debugger-old-buffer) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
476 (let ((load-read-function debugger-outer-load-read-function) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
477 (overriding-terminal-local-map |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
478 debugger-outer-overriding-terminal-local-map) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
479 (overriding-local-map debugger-outer-overriding-local-map) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
480 (track-mouse debugger-outer-track-mouse) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
481 (last-command debugger-outer-last-command) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
482 (this-command debugger-outer-this-command) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
483 (unread-command-char debugger-outer-unread-command-char) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
484 (unread-command-events debugger-outer-unread-command-events) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
485 (unread-post-input-method-events |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
486 debugger-outer-unread-post-input-method-events) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
487 (last-input-event debugger-outer-last-input-event) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
488 (last-command-event debugger-outer-last-command-event) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
489 (last-nonmenu-event debugger-outer-last-nonmenu-event) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
490 (last-event-frame debugger-outer-last-event-frame) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
491 (standard-input debugger-outer-standard-input) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
492 (standard-output debugger-outer-standard-output) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
493 (inhibit-redisplay debugger-outer-inhibit-redisplay) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
494 (cursor-in-echo-area debugger-outer-cursor-in-echo-area)) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
495 (set-match-data debugger-outer-match-data) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
496 (prog1 (progn ,@body) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
497 (setq debugger-outer-match-data (match-data)) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
498 (setq debugger-outer-load-read-function load-read-function) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
499 (setq debugger-outer-overriding-terminal-local-map |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
500 overriding-terminal-local-map) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
501 (setq debugger-outer-overriding-local-map overriding-local-map) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
502 (setq debugger-outer-track-mouse track-mouse) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
503 (setq debugger-outer-last-command last-command) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
504 (setq debugger-outer-this-command this-command) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
505 (setq debugger-outer-unread-command-char unread-command-char) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
506 (setq debugger-outer-unread-command-events unread-command-events) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
507 (setq debugger-outer-unread-post-input-method-events |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
508 unread-post-input-method-events) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
509 (setq debugger-outer-last-input-event last-input-event) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
510 (setq debugger-outer-last-command-event last-command-event) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
511 (setq debugger-outer-last-nonmenu-event last-nonmenu-event) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
512 (setq debugger-outer-last-event-frame last-event-frame) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
513 (setq debugger-outer-standard-input standard-input) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
514 (setq debugger-outer-standard-output standard-output) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
515 (setq debugger-outer-inhibit-redisplay inhibit-redisplay) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
516 (setq debugger-outer-cursor-in-echo-area cursor-in-echo-area) |
f572944ca41f
* emacs-lisp/debug.el (debugger-env-macro):
Sam Steingold <sds@gnu.org>
parents:
26325
diff
changeset
|
517 )))) |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
518 |
473 | 519 (defun debugger-eval-expression (exp) |
6468
b0c731997544
(debugger-eval-expression): Use a history list.
Richard M. Stallman <rms@gnu.org>
parents:
6048
diff
changeset
|
520 "Eval an expression, in an environment like that outside the debugger." |
b0c731997544
(debugger-eval-expression): Use a history list.
Richard M. Stallman <rms@gnu.org>
parents:
6048
diff
changeset
|
521 (interactive |
b0c731997544
(debugger-eval-expression): Use a history list.
Richard M. Stallman <rms@gnu.org>
parents:
6048
diff
changeset
|
522 (list (read-from-minibuffer "Eval: " |
b0c731997544
(debugger-eval-expression): Use a history list.
Richard M. Stallman <rms@gnu.org>
parents:
6048
diff
changeset
|
523 nil read-expression-map t |
b0c731997544
(debugger-eval-expression): Use a history list.
Richard M. Stallman <rms@gnu.org>
parents:
6048
diff
changeset
|
524 'read-expression-history))) |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
525 (debugger-env-macro (eval-expression exp))) |
473 | 526 |
527 (defvar debugger-mode-map nil) | |
40583
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
528 (unless debugger-mode-map |
473 | 529 (let ((loop ? )) |
530 (setq debugger-mode-map (make-keymap)) | |
43911 | 531 (set-keymap-parent debugger-mode-map button-buffer-map) |
473 | 532 (suppress-keymap debugger-mode-map) |
533 (define-key debugger-mode-map "-" 'negative-argument) | |
534 (define-key debugger-mode-map "b" 'debugger-frame) | |
535 (define-key debugger-mode-map "c" 'debugger-continue) | |
536 (define-key debugger-mode-map "j" 'debugger-jump) | |
537 (define-key debugger-mode-map "r" 'debugger-return-value) | |
538 (define-key debugger-mode-map "u" 'debugger-frame-clear) | |
539 (define-key debugger-mode-map "d" 'debugger-step-through) | |
540 (define-key debugger-mode-map "l" 'debugger-list-functions) | |
541 (define-key debugger-mode-map "h" 'describe-mode) | |
542 (define-key debugger-mode-map "q" 'top-level) | |
543 (define-key debugger-mode-map "e" 'debugger-eval-expression) | |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
544 (define-key debugger-mode-map " " 'next-line) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
545 (define-key debugger-mode-map "R" 'debugger-record-expression) |
42304
8e051a31d2cd
(debugger-mode-map): Bind C-m, not `RET'.
Richard M. Stallman <rms@gnu.org>
parents:
42078
diff
changeset
|
546 (define-key debugger-mode-map "\C-m" 'help-follow) |
40583
87996dd441b7
easy source access from the *debugger* buffer
Sam Steingold <sds@gnu.org>
parents:
26948
diff
changeset
|
547 (define-key debugger-mode-map [mouse-2] 'push-button) |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
548 )) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
549 |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
550 |
21365 | 551 (defcustom debugger-record-buffer "*Debugger-record*" |
552 "*Buffer name for expression values, for \\[debugger-record-expression]." | |
553 :type 'string | |
21669
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21365
diff
changeset
|
554 :group 'debugger |
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21365
diff
changeset
|
555 :version "20.3") |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
556 |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
557 (defun debugger-record-expression (exp) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
558 "Display a variable's value and record it in `*Backtrace-record*' buffer." |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
559 (interactive |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
560 (list (read-from-minibuffer |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
561 "Record Eval: " |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
562 nil |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
563 read-expression-map t |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
564 'read-expression-history))) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
565 (let* ((buffer (get-buffer-create debugger-record-buffer)) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
566 (standard-output buffer)) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
567 (princ (format "Debugger Eval (%s): " exp)) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
568 (princ (debugger-eval-expression exp)) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
569 (terpri)) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
570 |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
571 (with-current-buffer (get-buffer debugger-record-buffer) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
572 (save-excursion |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
573 (forward-line -1) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
574 (message |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
575 (buffer-substring (point) (progn (end-of-line) (point))))))) |
473 | 576 |
577 (put 'debugger-mode 'mode-class 'special) | |
578 | |
579 (defun debugger-mode () | |
580 "Mode for backtrace buffers, selected in debugger. | |
581 \\<debugger-mode-map> | |
582 A line starts with `*' if exiting that frame will call the debugger. | |
583 Type \\[debugger-frame] or \\[debugger-frame-clear] to set or remove the `*'. | |
584 | |
585 When in debugger due to frame being exited, | |
586 use the \\[debugger-return-value] command to override the value | |
587 being returned from that frame. | |
588 | |
589 Use \\[debug-on-entry] and \\[cancel-debug-on-entry] to control | |
590 which functions will enter the debugger when called. | |
591 | |
592 Complete list of commands: | |
593 \\{debugger-mode-map}" | |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
594 (kill-all-local-variables) |
473 | 595 (setq major-mode 'debugger-mode) |
596 (setq mode-name "Debugger") | |
597 (setq truncate-lines t) | |
598 (set-syntax-table emacs-lisp-mode-syntax-table) | |
20403
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
599 (use-local-map debugger-mode-map) |
698119867c21
(debugger-mode-hook): New user variable.
Karl Heuer <kwzh@gnu.org>
parents:
19889
diff
changeset
|
600 (run-hooks 'debugger-mode-hook)) |
473 | 601 |
602 ;;;###autoload | |
603 (defun debug-on-entry (function) | |
604 "Request FUNCTION to invoke debugger each time it is called. | |
6048
ff40882c5578
(debug, debug-on-entry): Doc strings.
Richard M. Stallman <rms@gnu.org>
parents:
5585
diff
changeset
|
605 If you tell the debugger to continue, FUNCTION's execution proceeds. |
ff40882c5578
(debug, debug-on-entry): Doc strings.
Richard M. Stallman <rms@gnu.org>
parents:
5585
diff
changeset
|
606 This works by modifying the definition of FUNCTION, |
473 | 607 which must be written in Lisp, not predefined. |
608 Use \\[cancel-debug-on-entry] to cancel the effect of this command. | |
6048
ff40882c5578
(debug, debug-on-entry): Doc strings.
Richard M. Stallman <rms@gnu.org>
parents:
5585
diff
changeset
|
609 Redefining FUNCTION also cancels it." |
473 | 610 (interactive "aDebug on entry (to function): ") |
611 (debugger-reenable) | |
20404
7cce7f974c78
(debug-on-entry): If definition is a symbol,
Karl Heuer <kwzh@gnu.org>
parents:
20403
diff
changeset
|
612 ;; Handle a function that has been aliased to some other function. |
7cce7f974c78
(debug-on-entry): If definition is a symbol,
Karl Heuer <kwzh@gnu.org>
parents:
20403
diff
changeset
|
613 (if (symbolp (symbol-function function)) |
7cce7f974c78
(debug-on-entry): If definition is a symbol,
Karl Heuer <kwzh@gnu.org>
parents:
20403
diff
changeset
|
614 (fset function `(lambda (&rest debug-on-entry-args) |
7cce7f974c78
(debug-on-entry): If definition is a symbol,
Karl Heuer <kwzh@gnu.org>
parents:
20403
diff
changeset
|
615 (apply ',(symbol-function function) |
7cce7f974c78
(debug-on-entry): If definition is a symbol,
Karl Heuer <kwzh@gnu.org>
parents:
20403
diff
changeset
|
616 debug-on-entry-args)))) |
473 | 617 (if (subrp (symbol-function function)) |
618 (error "Function %s is a primitive" function)) | |
619 (or (consp (symbol-function function)) | |
620 (debug-convert-byte-code function)) | |
621 (or (consp (symbol-function function)) | |
622 (error "Definition of %s is not a list" function)) | |
623 (fset function (debug-on-entry-1 function (symbol-function function) t)) | |
624 (or (memq function debug-function-list) | |
625 (setq debug-function-list (cons function debug-function-list))) | |
626 function) | |
627 | |
628 ;;;###autoload | |
629 (defun cancel-debug-on-entry (&optional function) | |
630 "Undo effect of \\[debug-on-entry] on FUNCTION. | |
631 If argument is nil or an empty string, cancel for all functions." | |
477 | 632 (interactive |
633 (list (let ((name | |
634 (completing-read "Cancel debug on entry (to function): " | |
635 ;; Make an "alist" of the functions | |
636 ;; that now have debug on entry. | |
637 (mapcar 'list | |
638 (mapcar 'symbol-name | |
639 debug-function-list)) | |
640 nil t nil))) | |
641 (if name (intern name))))) | |
473 | 642 (debugger-reenable) |
643 (if (and function (not (string= function ""))) | |
644 (progn | |
645 (fset function | |
646 (debug-on-entry-1 function (symbol-function function) nil)) | |
647 (setq debug-function-list (delq function debug-function-list)) | |
648 function) | |
649 (message "Cancelling debug-on-entry for all functions") | |
650 (mapcar 'cancel-debug-on-entry debug-function-list))) | |
651 | |
652 (defun debug-convert-byte-code (function) | |
653 (let ((defn (symbol-function function))) | |
654 (if (not (consp defn)) | |
655 ;; Assume a compiled code object. | |
656 (let* ((contents (append defn nil)) | |
657 (body | |
658 (list (list 'byte-code (nth 1 contents) | |
659 (nth 2 contents) (nth 3 contents))))) | |
660 (if (nthcdr 5 contents) | |
661 (setq body (cons (list 'interactive (nth 5 contents)) body))) | |
662 (if (nth 4 contents) | |
10571
0bd8034a4f54
(debug-convert-byte-code): Convert the doc info to a string.
Richard M. Stallman <rms@gnu.org>
parents:
9857
diff
changeset
|
663 ;; Use `documentation' here, to get the actual string, |
0bd8034a4f54
(debug-convert-byte-code): Convert the doc info to a string.
Richard M. Stallman <rms@gnu.org>
parents:
9857
diff
changeset
|
664 ;; in case the compiled function has a reference |
0bd8034a4f54
(debug-convert-byte-code): Convert the doc info to a string.
Richard M. Stallman <rms@gnu.org>
parents:
9857
diff
changeset
|
665 ;; to the .elc file. |
0bd8034a4f54
(debug-convert-byte-code): Convert the doc info to a string.
Richard M. Stallman <rms@gnu.org>
parents:
9857
diff
changeset
|
666 (setq body (cons (documentation function) body))) |
473 | 667 (fset function (cons 'lambda (cons (car contents) body))))))) |
668 | |
669 (defun debug-on-entry-1 (function defn flag) | |
670 (if (subrp defn) | |
671 (error "%s is a built-in function" function) | |
672 (if (eq (car defn) 'macro) | |
673 (debug-on-entry-1 function (cdr defn) flag) | |
674 (or (eq (car defn) 'lambda) | |
675 (error "%s not user-defined Lisp function" function)) | |
676 (let (tail prec) | |
677 (if (stringp (car (nthcdr 2 defn))) | |
678 (setq tail (nthcdr 3 defn) | |
679 prec (list (car defn) (car (cdr defn)) | |
680 (car (cdr (cdr defn))))) | |
681 (setq tail (nthcdr 2 defn) | |
682 prec (list (car defn) (car (cdr defn))))) | |
683 (if (eq flag (equal (car tail) '(debug 'debug))) | |
684 defn | |
685 (if flag | |
686 (nconc prec (cons '(debug 'debug) tail)) | |
687 (nconc prec (cdr tail)))))))) | |
688 | |
689 (defun debugger-list-functions () | |
690 "Display a list of all the functions now set to debug on entry." | |
691 (interactive) | |
692 (with-output-to-temp-buffer "*Help*" | |
693 (if (null debug-function-list) | |
694 (princ "No debug-on-entry functions now\n") | |
695 (princ "Functions set to debug on entry:\n\n") | |
696 (let ((list debug-function-list)) | |
697 (while list | |
698 (prin1 (car list)) | |
699 (terpri) | |
700 (setq list (cdr list)))) | |
701 (princ "Note: if you have redefined a function, then it may no longer\n") | |
9857
b1455d954e44
(debugger-list-functions): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
6926
diff
changeset
|
702 (princ "be set to debug on entry, even if it is in the list.")) |
b1455d954e44
(debugger-list-functions): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
6926
diff
changeset
|
703 (save-excursion |
b1455d954e44
(debugger-list-functions): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
6926
diff
changeset
|
704 (set-buffer standard-output) |
b1455d954e44
(debugger-list-functions): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
6926
diff
changeset
|
705 (help-mode)))) |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
477
diff
changeset
|
706 |
18383 | 707 (provide 'debug) |
708 | |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
477
diff
changeset
|
709 ;;; debug.el ends here |