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
|
|
11 define xtype
|
|
12 print (enum Lisp_Type) (($ >> 24) & 0x7f)
|
|
13 p $$
|
|
14 end
|
638
|
15 document xtype
|
|
16 Print the type of $, assuming it is an Elisp value.
|
|
17 end
|
567
|
18
|
|
19 define xint
|
|
20 print (($ & 0x00ffffff) << 8) >> 8
|
|
21 end
|
638
|
22 document xint
|
|
23 Print $, assuming it is an Elisp integer. This gets the sign right.
|
|
24 end
|
567
|
25
|
|
26 define xptr
|
|
27 print (void *) ($ & 0x00ffffff)
|
|
28 end
|
638
|
29 document xptr
|
|
30 Print the pointer portion of $, assuming it is an Elisp value.
|
|
31 end
|
567
|
32
|
|
33 define xwindow
|
|
34 print (struct window *) ($ & 0x00ffffff)
|
727
|
35 print ($->left)@4
|
|
36 print $$
|
567
|
37 end
|
638
|
38 document xwindow
|
|
39 Print $ as a window pointer, assuming it is an Elisp window value.
|
727
|
40 Print the window's position as { left, top, height, width }.
|
638
|
41 end
|
567
|
42
|
|
43 define xmarker
|
|
44 print (struct Lisp_Marker *) ($ & 0x00ffffff)
|
|
45 end
|
638
|
46 document xmarker
|
|
47 Print $ as a marker pointer, assuming it is an Elisp marker value.
|
|
48 end
|
567
|
49
|
|
50 define xbuffer
|
|
51 print (struct buffer *) ($ & 0x00ffffff)
|
727
|
52 print &((struct Lisp_String *) (($->name) & 0x00ffffff))->data
|
|
53 print $$
|
567
|
54 end
|
638
|
55 document xbuffer
|
727
|
56 Set $ as a buffer pointer, assuming it is an Elisp buffer value.
|
|
57 Print the name of the buffer.
|
638
|
58 end
|
567
|
59
|
|
60 define xsymbol
|
|
61 print (struct Lisp_Symbol *) ($ & 0x00ffffff)
|
|
62 print &$->name->data
|
|
63 print $$
|
|
64 end
|
638
|
65 document xsymbol
|
|
66 Print the name and address of the symbol $.
|
|
67 This command assumes that $ is an Elisp symbol value.
|
|
68 end
|
567
|
69
|
|
70 define xstring
|
|
71 print (struct Lisp_String *) ($ & 0x00ffffff)
|
638
|
72 print ($->size > 10000) ? "big string" : ($->data[0])@($->size)
|
567
|
73 print $$
|
|
74 end
|
|
75 document xstring
|
638
|
76 Print the contents and address of the string $.
|
|
77 This command assumes that $ is an Elisp string value.
|
567
|
78 end
|
|
79
|
|
80 define xvector
|
|
81 set $temp = (struct Lisp_Vector *) ($ & 0x00ffffff)
|
638
|
82 print ($temp->size > 10000) ? "big vector" : ($temp->contents[0])@($temp->size)
|
567
|
83 print $temp
|
|
84 end
|
|
85 document xvector
|
638
|
86 Print the contents and address of the vector $.
|
|
87 This command assumes that $ is an Elisp vector value.
|
567
|
88 end
|
|
89
|
|
90 define xscreen
|
|
91 print (struct screen *) ($ & 0x00ffffff)
|
|
92 end
|
638
|
93 document xwindow
|
|
94 Print $ as a screen pointer, assuming it is an Elisp screen value.
|
|
95 end
|
567
|
96
|
|
97 define xcons
|
|
98 print (struct Lisp_Cons *) ($ & 0x00ffffff)
|
|
99 print *$
|
648
|
100 print $$
|
567
|
101 end
|
638
|
102 document xcons
|
|
103 Print the contents of $, assuming it is an Elisp cons.
|
|
104 end
|
567
|
105
|
|
106 define xcar
|
|
107 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->car : 0)
|
|
108 end
|
638
|
109 document xcar
|
|
110 Print the car of $, assuming it is an Elisp pair.
|
|
111 end
|
567
|
112
|
|
113 define xcdr
|
|
114 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->cdr : 0)
|
|
115 end
|
638
|
116 document xcdr
|
|
117 Print the cdr of $, assuming it is an Elisp pair.
|
|
118 end
|
567
|
119
|
638
|
120 set print pretty on
|
567
|
121
|
732
|
122 unset environment TERMCAP
|
|
123 unset environment TERM
|
|
124 show environment DISPLAY
|
|
125 set args -q
|
|
126
|
567
|
127 # Don't let abort actually run, as it will make
|
|
128 # stdio stop working and therefore the `pr' command below as well.
|
|
129 break abort
|
|
130
|
|
131 # If we are running in synchronous mode, we want a chance to look around
|
|
132 # before Emacs exits. Perhaps we should put the break somewhere else
|
|
133 # instead...
|
|
134 break _XPrintDefaultError
|
|
135
|