annotate src/.gdbinit @ 1021:22f807391bec

(Fexpand_abbrev): If pre-expand hook changes the buffer, assume that means we "did an expansion".
author Richard M. Stallman <rms@gnu.org>
date Wed, 19 Aug 1992 07:00:25 +0000
parents d8d503897aa5
children 8b201fcaa592
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 # Set up something to print out s-expressions.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 define pr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 set Fprin1 ($, Qexternal_debugging_output)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 echo \n
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 document pr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 Print the emacs s-expression which is $.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 Works only when an inferior emacs is executing.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 define xtype
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
12 output (enum Lisp_Type) (($ >> 24) & 0x7f)
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
13 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
15 document xtype
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
16 Print the type of $, assuming it is an Elisp value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
17 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 define xint
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 print (($ & 0x00ffffff) << 8) >> 8
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
22 document xint
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
23 Print $, assuming it is an Elisp integer. This gets the sign right.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
24 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 define xptr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 print (void *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
29 document xptr
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
30 Print the pointer portion of $, assuming it is an Elisp value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
31 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 define xwindow
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 print (struct window *) ($ & 0x00ffffff)
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
35 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
37 document xwindow
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
38 Print $ as a window pointer, assuming it is an Elisp window value.
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
39 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
40 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 define xmarker
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 print (struct Lisp_Marker *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
45 document xmarker
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
46 Print $ as a marker pointer, assuming it is an Elisp marker value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
47 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 define xbuffer
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 print (struct buffer *) ($ & 0x00ffffff)
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
51 output &((struct Lisp_String *) (($->name) & 0x00ffffff))->data
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
52 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
54 document xbuffer
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
55 Set $ as a buffer pointer, assuming it is an Elisp buffer value.
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
56 Print the name of the buffer.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
57 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 define xsymbol
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 print (struct Lisp_Symbol *) ($ & 0x00ffffff)
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
61 output &$->name->data
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
62 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
64 document xsymbol
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
65 Print the name and address of the symbol $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
66 This command assumes that $ is an Elisp symbol value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
67 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 define xstring
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 print (struct Lisp_String *) ($ & 0x00ffffff)
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
71 output ($->size > 10000) ? "big string" : ($->data[0])@($->size)
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
72 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 document xstring
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
75 Print the contents and address of the string $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
76 This command assumes that $ is an Elisp string value.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 define xvector
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
80 print (struct Lisp_Vector *) ($ & 0x00ffffff)
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
81 output ($->size > 1000) ? "big vector" : ($->contents[0])@($->size)
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
82 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 document xvector
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
85 Print the contents and address of the vector $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
86 This command assumes that $ is an Elisp vector value.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 define xscreen
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 print (struct screen *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
92 document xwindow
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
93 Print $ as a screen pointer, assuming it is an Elisp screen value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
94 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 define xcons
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 print (struct Lisp_Cons *) ($ & 0x00ffffff)
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
98 output *(struct Lisp_Cons *) ($ & 0x00ffffff)
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
99 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
101 document xcons
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
102 Print the contents of $, assuming it is an Elisp cons.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
103 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 define xcar
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->car : 0)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
108 document xcar
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
109 Print the car of $, assuming it is an Elisp pair.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
110 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 define xcdr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->cdr : 0)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
115 document xcdr
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
116 Print the cdr of $, assuming it is an Elisp pair.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
117 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
119 set print pretty on
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
121 unset environment TERMCAP
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
122 unset environment TERM
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
123 echo TERMCAP and TERM environment variables unset.\n
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
124 show environment DISPLAY
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
125 set args -q
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
126
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 # Don't let abort actually run, as it will make
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 # stdio stop working and therefore the `pr' command below as well.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 break abort
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 # If we are running in synchronous mode, we want a chance to look around
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 # before Emacs exits. Perhaps we should put the break somewhere else
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 # instead...
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 break _XPrintDefaultError
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135