567
|
1 # Set up something to print out s-expressions.
|
|
2 define pr
|
|
3 set Fprin1 ($, Qexternal_debugging_output)
|
|
4 echo \n
|
|
5 end
|
|
6 document pr
|
|
7 Print the emacs s-expression which is $.
|
|
8 Works only when an inferior emacs is executing.
|
|
9 end
|
|
10
|
1113
|
11 # Set this to the same thing as the DATA_SEG_BITS macro in your
|
|
12 # machine-description files.
|
|
13 set $data_seg_bits = 0
|
|
14
|
567
|
15 define xtype
|
999
|
16 output (enum Lisp_Type) (($ >> 24) & 0x7f)
|
|
17 echo \n
|
567
|
18 end
|
638
|
19 document xtype
|
|
20 Print the type of $, assuming it is an Elisp value.
|
|
21 end
|
567
|
22
|
|
23 define xint
|
|
24 print (($ & 0x00ffffff) << 8) >> 8
|
|
25 end
|
638
|
26 document xint
|
|
27 Print $, assuming it is an Elisp integer. This gets the sign right.
|
|
28 end
|
567
|
29
|
|
30 define xptr
|
1113
|
31 print (void *) (($ & 0x00ffffff) | $data_seg_bits)
|
567
|
32 end
|
638
|
33 document xptr
|
|
34 Print the pointer portion of $, assuming it is an Elisp value.
|
|
35 end
|
567
|
36
|
|
37 define xwindow
|
1113
|
38 print (struct window *) (($ & 0x00ffffff) | $data_seg_bits)
|
999
|
39 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
|
567
|
40 end
|
638
|
41 document xwindow
|
|
42 Print $ as a window pointer, assuming it is an Elisp window value.
|
999
|
43 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
|
638
|
44 end
|
567
|
45
|
|
46 define xmarker
|
1113
|
47 print (struct Lisp_Marker *) (($ & 0x00ffffff) | $data_seg_bits)
|
567
|
48 end
|
638
|
49 document xmarker
|
|
50 Print $ as a marker pointer, assuming it is an Elisp marker value.
|
|
51 end
|
567
|
52
|
|
53 define xbuffer
|
1113
|
54 print (struct buffer *) (($ & 0x00ffffff) | $data_seg_bits)
|
|
55 output &((struct Lisp_String *) ((($->name) & 0x00ffffff) | $data_seg_bits))->data
|
999
|
56 echo \n
|
567
|
57 end
|
638
|
58 document xbuffer
|
727
|
59 Set $ as a buffer pointer, assuming it is an Elisp buffer value.
|
|
60 Print the name of the buffer.
|
638
|
61 end
|
567
|
62
|
|
63 define xsymbol
|
1113
|
64 print (struct Lisp_Symbol *) (($ & 0x00ffffff) | $data_seg_bits)
|
999
|
65 output &$->name->data
|
|
66 echo \n
|
567
|
67 end
|
638
|
68 document xsymbol
|
|
69 Print the name and address of the symbol $.
|
|
70 This command assumes that $ is an Elisp symbol value.
|
|
71 end
|
567
|
72
|
|
73 define xstring
|
1113
|
74 print (struct Lisp_String *) (($ & 0x00ffffff) | $data_seg_bits)
|
999
|
75 output ($->size > 10000) ? "big string" : ($->data[0])@($->size)
|
|
76 echo \n
|
567
|
77 end
|
|
78 document xstring
|
638
|
79 Print the contents and address of the string $.
|
|
80 This command assumes that $ is an Elisp string value.
|
567
|
81 end
|
|
82
|
|
83 define xvector
|
1113
|
84 print (struct Lisp_Vector *) (($ & 0x00ffffff) | $data_seg_bits)
|
999
|
85 output ($->size > 1000) ? "big vector" : ($->contents[0])@($->size)
|
|
86 echo \n
|
567
|
87 end
|
|
88 document xvector
|
638
|
89 Print the contents and address of the vector $.
|
|
90 This command assumes that $ is an Elisp vector value.
|
567
|
91 end
|
|
92
|
1113
|
93 define xframe
|
|
94 print (struct frame *) (($ & 0x00ffffff) | $data_seg_bits)
|
567
|
95 end
|
1113
|
96 document xframe
|
|
97 Print $ as a frame pointer, assuming it is an Elisp frame value.
|
638
|
98 end
|
567
|
99
|
|
100 define xcons
|
1113
|
101 print (struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits)
|
1069
|
102 output *$
|
999
|
103 echo \n
|
567
|
104 end
|
638
|
105 document xcons
|
|
106 Print the contents of $, assuming it is an Elisp cons.
|
|
107 end
|
567
|
108
|
|
109 define xcar
|
1113
|
110 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits))->car : 0)
|
567
|
111 end
|
638
|
112 document xcar
|
|
113 Print the car of $, assuming it is an Elisp pair.
|
|
114 end
|
567
|
115
|
|
116 define xcdr
|
1113
|
117 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits))->cdr : 0)
|
567
|
118 end
|
638
|
119 document xcdr
|
|
120 Print the cdr of $, assuming it is an Elisp pair.
|
|
121 end
|
567
|
122
|
1113
|
123 define xsubr
|
|
124 print (struct Lisp_Subr *) (($ & 0x00ffffff) | $data_seg_bits)
|
|
125 output *$
|
|
126 echo \n
|
|
127 end
|
|
128 document xsubr
|
|
129 Print the address of the subr which the Lisp_Object $ points to.
|
|
130 end
|
|
131
|
638
|
132 set print pretty on
|
567
|
133
|
732
|
134 unset environment TERMCAP
|
|
135 unset environment TERM
|
999
|
136 echo TERMCAP and TERM environment variables unset.\n
|
732
|
137 show environment DISPLAY
|
|
138 set args -q
|
|
139
|
567
|
140 # Don't let abort actually run, as it will make
|
|
141 # stdio stop working and therefore the `pr' command below as well.
|
|
142 break abort
|
|
143
|
|
144 # If we are running in synchronous mode, we want a chance to look around
|
|
145 # before Emacs exits. Perhaps we should put the break somewhere else
|
|
146 # instead...
|
|
147 break _XPrintDefaultError
|
|
148
|