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
|
999
|
12 output (enum Lisp_Type) (($ >> 24) & 0x7f)
|
|
13 echo \n
|
567
|
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)
|
999
|
35 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
|
567
|
36 end
|
638
|
37 document xwindow
|
|
38 Print $ as a window pointer, assuming it is an Elisp window value.
|
999
|
39 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
|
638
|
40 end
|
567
|
41
|
|
42 define xmarker
|
|
43 print (struct Lisp_Marker *) ($ & 0x00ffffff)
|
|
44 end
|
638
|
45 document xmarker
|
|
46 Print $ as a marker pointer, assuming it is an Elisp marker value.
|
|
47 end
|
567
|
48
|
|
49 define xbuffer
|
|
50 print (struct buffer *) ($ & 0x00ffffff)
|
999
|
51 output &((struct Lisp_String *) (($->name) & 0x00ffffff))->data
|
|
52 echo \n
|
567
|
53 end
|
638
|
54 document xbuffer
|
727
|
55 Set $ as a buffer pointer, assuming it is an Elisp buffer value.
|
|
56 Print the name of the buffer.
|
638
|
57 end
|
567
|
58
|
|
59 define xsymbol
|
|
60 print (struct Lisp_Symbol *) ($ & 0x00ffffff)
|
999
|
61 output &$->name->data
|
|
62 echo \n
|
567
|
63 end
|
638
|
64 document xsymbol
|
|
65 Print the name and address of the symbol $.
|
|
66 This command assumes that $ is an Elisp symbol value.
|
|
67 end
|
567
|
68
|
|
69 define xstring
|
|
70 print (struct Lisp_String *) ($ & 0x00ffffff)
|
999
|
71 output ($->size > 10000) ? "big string" : ($->data[0])@($->size)
|
|
72 echo \n
|
567
|
73 end
|
|
74 document xstring
|
638
|
75 Print the contents and address of the string $.
|
|
76 This command assumes that $ is an Elisp string value.
|
567
|
77 end
|
|
78
|
|
79 define xvector
|
999
|
80 print (struct Lisp_Vector *) ($ & 0x00ffffff)
|
|
81 output ($->size > 1000) ? "big vector" : ($->contents[0])@($->size)
|
|
82 echo \n
|
567
|
83 end
|
|
84 document xvector
|
638
|
85 Print the contents and address of the vector $.
|
|
86 This command assumes that $ is an Elisp vector value.
|
567
|
87 end
|
|
88
|
|
89 define xscreen
|
|
90 print (struct screen *) ($ & 0x00ffffff)
|
|
91 end
|
638
|
92 document xwindow
|
|
93 Print $ as a screen pointer, assuming it is an Elisp screen value.
|
|
94 end
|
567
|
95
|
|
96 define xcons
|
|
97 print (struct Lisp_Cons *) ($ & 0x00ffffff)
|
999
|
98 output *(struct Lisp_Cons *) ($ & 0x00ffffff)
|
|
99 echo \n
|
567
|
100 end
|
638
|
101 document xcons
|
|
102 Print the contents of $, assuming it is an Elisp cons.
|
|
103 end
|
567
|
104
|
|
105 define xcar
|
|
106 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->car : 0)
|
|
107 end
|
638
|
108 document xcar
|
|
109 Print the car of $, assuming it is an Elisp pair.
|
|
110 end
|
567
|
111
|
|
112 define xcdr
|
|
113 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->cdr : 0)
|
|
114 end
|
638
|
115 document xcdr
|
|
116 Print the cdr of $, assuming it is an Elisp pair.
|
|
117 end
|
567
|
118
|
638
|
119 set print pretty on
|
567
|
120
|
732
|
121 unset environment TERMCAP
|
|
122 unset environment TERM
|
999
|
123 echo TERMCAP and TERM environment variables unset.\n
|
732
|
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
|