diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 208 | ||||
| -rw-r--r-- | src/.gdbinit-union | 402 | ||||
| -rw-r--r-- | src/ChangeLog | 45 | ||||
| -rw-r--r-- | src/callint.c | 22 | ||||
| -rw-r--r-- | src/data.c | 46 | ||||
| -rw-r--r-- | src/editfns.c | 2 | ||||
| -rw-r--r-- | src/emacs.c | 13 | ||||
| -rw-r--r-- | src/eval.c | 10 | ||||
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/xterm.c | 57 |
10 files changed, 282 insertions, 524 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 145f4f4df87..1b141a42064 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001 | 1 | # Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 2000, 01, 2004 |
| 2 | # Free Software Foundation, Inc. | 2 | # Free Software Foundation, Inc. |
| 3 | # | 3 | # |
| 4 | # This file is part of GNU Emacs. | 4 | # This file is part of GNU Emacs. |
| @@ -38,12 +38,22 @@ handle SIGALRM ignore | |||
| 38 | # Set up a mask to use. | 38 | # Set up a mask to use. |
| 39 | # This should be EMACS_INT, but in some cases that is a macro. | 39 | # This should be EMACS_INT, but in some cases that is a macro. |
| 40 | # long ought to work in all cases right now. | 40 | # long ought to work in all cases right now. |
| 41 | set $valmask = ((long)1 << gdb_valbits) - 1 | 41 | |
| 42 | set $nonvalbits = gdb_emacs_intbits - gdb_valbits | 42 | define xgetptr |
| 43 | set $ptr = (gdb_use_union ? $arg0.u.val : $arg0 & $valmask) | gdb_data_seg_bits | ||
| 44 | end | ||
| 45 | |||
| 46 | define xgetint | ||
| 47 | set $int = gdb_use_union ? $arg0.s.val : (gdb_use_lsb ? $arg0 : $arg0 << gdb_gctypebits) >> gdb_gctypebits | ||
| 48 | end | ||
| 49 | |||
| 50 | define xgettype | ||
| 51 | set $type = gdb_use_union ? $arg0.s.type : (enum Lisp_Type) (gdb_use_lsb ? $arg0 & $tagmask : $arg0 >> gdb_valbits) | ||
| 52 | end | ||
| 43 | 53 | ||
| 44 | # Set up something to print out s-expressions. | 54 | # Set up something to print out s-expressions. |
| 45 | define pr | 55 | define pr |
| 46 | set debug_print ($) | 56 | set debug_print ($) |
| 47 | end | 57 | end |
| 48 | document pr | 58 | document pr |
| 49 | Print the emacs s-expression which is $. | 59 | Print the emacs s-expression which is $. |
| @@ -51,115 +61,135 @@ Works only when an inferior emacs is executing. | |||
| 51 | end | 61 | end |
| 52 | 62 | ||
| 53 | define xtype | 63 | define xtype |
| 54 | output (enum Lisp_Type) (($ >> gdb_valbits) & 0x7) | 64 | xgettype $ |
| 55 | echo \n | 65 | output $type |
| 56 | output ((($ >> gdb_valbits) & 0x7) == Lisp_Misc ? (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits))->type) : (($ >> gdb_valbits) & 0x7) == Lisp_Vectorlike ? ($size = ((struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits))->size, (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)) : 0) | 66 | echo \n |
| 57 | echo \n | 67 | if $type == Lisp_Misc |
| 68 | xmisctype | ||
| 69 | else | ||
| 70 | if $type == Lisp_Vectorlike | ||
| 71 | xvectype | ||
| 72 | end | ||
| 73 | end | ||
| 58 | end | 74 | end |
| 59 | document xtype | 75 | document xtype |
| 60 | Print the type of $, assuming it is an Emacs Lisp value. | 76 | Print the type of $, assuming it is an Emacs Lisp value. |
| 61 | If the first type printed is Lisp_Vector or Lisp_Misc, | 77 | If the first type printed is Lisp_Vector or Lisp_Misc, |
| 62 | the second line gives the more precise type. | 78 | a second line gives the more precise type. |
| 63 | Otherwise the second line doesn't mean anything. | ||
| 64 | end | 79 | end |
| 65 | 80 | ||
| 66 | define xvectype | 81 | define xvectype |
| 67 | set $size = ((struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits))->size | 82 | xgetptr $ |
| 68 | output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0) | 83 | set $size = ((struct Lisp_Vector *) $ptr)->size |
| 69 | echo \n | 84 | output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size |
| 85 | echo \n | ||
| 70 | end | 86 | end |
| 71 | document xvectype | 87 | document xvectype |
| 72 | Print the vector subtype of $, assuming it is a vector or pseudovector. | 88 | Print the size or vector subtype of $, assuming it is a vector or pseudovector. |
| 73 | end | 89 | end |
| 74 | 90 | ||
| 75 | define xmisctype | 91 | define xmisctype |
| 76 | output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits))->type) | 92 | xgetptr $ |
| 77 | echo \n | 93 | output (enum Lisp_Misc_Type) (((struct Lisp_Free *) $ptr)->type) |
| 94 | echo \n | ||
| 78 | end | 95 | end |
| 79 | document xmisctype | 96 | document xmisctype |
| 80 | Print the specific type of $, assuming it is some misc type. | 97 | Print the specific type of $, assuming it is some misc type. |
| 81 | end | 98 | end |
| 82 | 99 | ||
| 83 | define xint | 100 | define xint |
| 84 | print (($ & $valmask) << $nonvalbits) >> $nonvalbits | 101 | xgetint $ |
| 102 | print $int | ||
| 85 | end | 103 | end |
| 86 | document xint | 104 | document xint |
| 87 | Print $, assuming it is an Emacs Lisp integer. This gets the sign right. | 105 | Print $, assuming it is an Emacs Lisp integer. This gets the sign right. |
| 88 | end | 106 | end |
| 89 | 107 | ||
| 90 | define xptr | 108 | define xptr |
| 91 | print (void *) (($ & $valmask) | gdb_data_seg_bits) | 109 | xgetptr $ |
| 110 | print (void *) $ptr | ||
| 92 | end | 111 | end |
| 93 | document xptr | 112 | document xptr |
| 94 | Print the pointer portion of $, assuming it is an Emacs Lisp value. | 113 | Print the pointer portion of $, assuming it is an Emacs Lisp value. |
| 95 | end | 114 | end |
| 96 | 115 | ||
| 97 | define xmarker | 116 | define xmarker |
| 98 | print (struct Lisp_Marker *) (($ & $valmask) | gdb_data_seg_bits) | 117 | xgetptr $ |
| 118 | print (struct Lisp_Marker *) $ptr | ||
| 99 | end | 119 | end |
| 100 | document xmarker | 120 | document xmarker |
| 101 | Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. | 121 | Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. |
| 102 | end | 122 | end |
| 103 | 123 | ||
| 104 | define xoverlay | 124 | define xoverlay |
| 105 | print (struct Lisp_Overlay *) (($ & $valmask) | gdb_data_seg_bits) | 125 | xgetptr $ |
| 126 | print (struct Lisp_Overlay *) $ptr | ||
| 106 | end | 127 | end |
| 107 | document xoverlay | 128 | document xoverlay |
| 108 | Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value. | 129 | Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value. |
| 109 | end | 130 | end |
| 110 | 131 | ||
| 111 | define xmiscfree | 132 | define xmiscfree |
| 112 | print (struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits) | 133 | xgetptr $ |
| 134 | print (struct Lisp_Free *) $ptr | ||
| 113 | end | 135 | end |
| 114 | document xmiscfree | 136 | document xmiscfree |
| 115 | Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value. | 137 | Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value. |
| 116 | end | 138 | end |
| 117 | 139 | ||
| 118 | define xintfwd | 140 | define xintfwd |
| 119 | print (struct Lisp_Intfwd *) (($ & $valmask) | gdb_data_seg_bits) | 141 | xgetptr $ |
| 142 | print (struct Lisp_Intfwd *) $ptr | ||
| 120 | end | 143 | end |
| 121 | document xintfwd | 144 | document xintfwd |
| 122 | Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value. | 145 | Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value. |
| 123 | end | 146 | end |
| 124 | 147 | ||
| 125 | define xboolfwd | 148 | define xboolfwd |
| 126 | print (struct Lisp_Boolfwd *) (($ & $valmask) | gdb_data_seg_bits) | 149 | xgetptr $ |
| 150 | print (struct Lisp_Boolfwd *) $ptr | ||
| 127 | end | 151 | end |
| 128 | document xboolfwd | 152 | document xboolfwd |
| 129 | Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value. | 153 | Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value. |
| 130 | end | 154 | end |
| 131 | 155 | ||
| 132 | define xobjfwd | 156 | define xobjfwd |
| 133 | print (struct Lisp_Objfwd *) (($ & $valmask) | gdb_data_seg_bits) | 157 | xgetptr $ |
| 158 | print (struct Lisp_Objfwd *) $ptr | ||
| 134 | end | 159 | end |
| 135 | document xobjfwd | 160 | document xobjfwd |
| 136 | Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value. | 161 | Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value. |
| 137 | end | 162 | end |
| 138 | 163 | ||
| 139 | define xbufobjfwd | 164 | define xbufobjfwd |
| 140 | print (struct Lisp_Buffer_Objfwd *) (($ & $valmask) | gdb_data_seg_bits) | 165 | xgetptr $ |
| 166 | print (struct Lisp_Buffer_Objfwd *) $ptr | ||
| 141 | end | 167 | end |
| 142 | document xbufobjfwd | 168 | document xbufobjfwd |
| 143 | Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. | 169 | Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. |
| 144 | end | 170 | end |
| 145 | 171 | ||
| 146 | define xkbobjfwd | 172 | define xkbobjfwd |
| 147 | print (struct Lisp_Kboard_Objfwd *) (($ & $valmask) | gdb_data_seg_bits) | 173 | xgetptr $ |
| 174 | print (struct Lisp_Kboard_Objfwd *) $ptr | ||
| 148 | end | 175 | end |
| 149 | document xkbobjfwd | 176 | document xkbobjfwd |
| 150 | Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. | 177 | Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. |
| 151 | end | 178 | end |
| 152 | 179 | ||
| 153 | define xbuflocal | 180 | define xbuflocal |
| 154 | print (struct Lisp_Buffer_Local_Value *) (($ & $valmask) | gdb_data_seg_bits) | 181 | xgetptr $ |
| 182 | print (struct Lisp_Buffer_Local_Value *) $ptr | ||
| 155 | end | 183 | end |
| 156 | document xbuflocal | 184 | document xbuflocal |
| 157 | Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value. | 185 | Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value. |
| 158 | end | 186 | end |
| 159 | 187 | ||
| 160 | define xsymbol | 188 | define xsymbol |
| 161 | print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits) | 189 | xgetptr $ |
| 162 | xprintsym $ | 190 | print (struct Lisp_Symbol *) $ptr |
| 191 | xprintsym $ | ||
| 192 | echo \n | ||
| 163 | end | 193 | end |
| 164 | document xsymbol | 194 | document xsymbol |
| 165 | Print the name and address of the symbol $. | 195 | Print the name and address of the symbol $. |
| @@ -167,9 +197,10 @@ This command assumes that $ is an Emacs Lisp symbol value. | |||
| 167 | end | 197 | end |
| 168 | 198 | ||
| 169 | define xstring | 199 | define xstring |
| 170 | print (struct Lisp_String *) (($ & $valmask) | gdb_data_seg_bits) | 200 | xgetptr $ |
| 171 | output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte) | 201 | print (struct Lisp_String *) $ptr |
| 172 | echo \n | 202 | output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte) |
| 203 | echo \n | ||
| 173 | end | 204 | end |
| 174 | document xstring | 205 | document xstring |
| 175 | Print the contents and address of the string $. | 206 | Print the contents and address of the string $. |
| @@ -177,8 +208,9 @@ This command assumes that $ is an Emacs Lisp string value. | |||
| 177 | end | 208 | end |
| 178 | 209 | ||
| 179 | define xvector | 210 | define xvector |
| 180 | print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits) | 211 | xgetptr $ |
| 181 | output ($->size > 50) ? 0 : ($->contents[0])@($->size) | 212 | print (struct Lisp_Vector *) $ptr |
| 213 | output ($->size > 50) ? 0 : ($->contents[0])@($->size) | ||
| 182 | echo \n | 214 | echo \n |
| 183 | end | 215 | end |
| 184 | document xvector | 216 | document xvector |
| @@ -187,32 +219,36 @@ This command assumes that $ is an Emacs Lisp vector value. | |||
| 187 | end | 219 | end |
| 188 | 220 | ||
| 189 | define xprocess | 221 | define xprocess |
| 190 | print (struct Lisp_Process *) (($ & $valmask) | gdb_data_seg_bits) | 222 | xgetptr $ |
| 191 | output *$ | 223 | print (struct Lisp_Process *) $ptr |
| 192 | echo \n | 224 | output *$ |
| 225 | echo \n | ||
| 193 | end | 226 | end |
| 194 | document xprocess | 227 | document xprocess |
| 195 | Print the address of the struct Lisp_process which the Lisp_Object $ points to. | 228 | Print the address of the struct Lisp_process which the Lisp_Object $ points to. |
| 196 | end | 229 | end |
| 197 | 230 | ||
| 198 | define xframe | 231 | define xframe |
| 199 | print (struct frame *) (($ & $valmask) | gdb_data_seg_bits) | 232 | xgetptr $ |
| 233 | print (struct frame *) $ptr | ||
| 200 | end | 234 | end |
| 201 | document xframe | 235 | document xframe |
| 202 | Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. | 236 | Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. |
| 203 | end | 237 | end |
| 204 | 238 | ||
| 205 | define xcompiled | 239 | define xcompiled |
| 206 | print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits) | 240 | xgetptr $ |
| 207 | output ($->contents[0])@($->size & 0xff) | 241 | print (struct Lisp_Vector *) $ptr |
| 242 | output ($->contents[0])@($->size & 0xff) | ||
| 208 | end | 243 | end |
| 209 | document xcompiled | 244 | document xcompiled |
| 210 | Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value. | 245 | Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value. |
| 211 | end | 246 | end |
| 212 | 247 | ||
| 213 | define xwindow | 248 | define xwindow |
| 214 | print (struct window *) (($ & $valmask) | gdb_data_seg_bits) | 249 | xgetptr $ |
| 215 | printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top | 250 | print (struct window *) $ptr |
| 251 | printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top | ||
| 216 | end | 252 | end |
| 217 | document xwindow | 253 | document xwindow |
| 218 | Print $ as a window pointer, assuming it is an Emacs Lisp window value. | 254 | Print $ as a window pointer, assuming it is an Emacs Lisp window value. |
| @@ -220,27 +256,30 @@ Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". | |||
| 220 | end | 256 | end |
| 221 | 257 | ||
| 222 | define xwinconfig | 258 | define xwinconfig |
| 223 | print (struct save_window_data *) (($ & $valmask) | gdb_data_seg_bits) | 259 | xgetptr $ |
| 260 | print (struct save_window_data *) $ptr | ||
| 224 | end | 261 | end |
| 225 | document xwinconfig | 262 | document xwinconfig |
| 226 | Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value. | 263 | Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value. |
| 227 | end | 264 | end |
| 228 | 265 | ||
| 229 | define xsubr | 266 | define xsubr |
| 230 | print (struct Lisp_Subr *) (($ & $valmask) | gdb_data_seg_bits) | 267 | xgetptr $ |
| 231 | output *$ | 268 | print (struct Lisp_Subr *) $ptr |
| 232 | echo \n | 269 | output *$ |
| 270 | echo \n | ||
| 233 | end | 271 | end |
| 234 | document xsubr | 272 | document xsubr |
| 235 | Print the address of the subr which the Lisp_Object $ points to. | 273 | Print the address of the subr which the Lisp_Object $ points to. |
| 236 | end | 274 | end |
| 237 | 275 | ||
| 238 | define xchartable | 276 | define xchartable |
| 239 | print (struct Lisp_Char_Table *) (($ & $valmask) | gdb_data_seg_bits) | 277 | xgetptr $ |
| 240 | printf "Purpose: " | 278 | print (struct Lisp_Char_Table *) $ptr |
| 241 | output (char*)&((struct Lisp_Symbol *) ((((int) $->purpose) & $valmask) | gdb_data_seg_bits))->name->data | 279 | printf "Purpose: " |
| 242 | printf " %d extra slots", ($->size & 0x1ff) - 388 | 280 | xprintsym $->purpose |
| 243 | echo \n | 281 | printf " %d extra slots", ($->size & 0x1ff) - 388 |
| 282 | echo \n | ||
| 244 | end | 283 | end |
| 245 | document xchartable | 284 | document xchartable |
| 246 | Print the address of the char-table $, and its purpose. | 285 | Print the address of the char-table $, and its purpose. |
| @@ -248,9 +287,10 @@ This command assumes that $ is an Emacs Lisp char-table value. | |||
| 248 | end | 287 | end |
| 249 | 288 | ||
| 250 | define xboolvector | 289 | define xboolvector |
| 251 | print (struct Lisp_Bool_Vector *) (($ & $valmask) | gdb_data_seg_bits) | 290 | xgetptr $ |
| 252 | output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8) | 291 | print (struct Lisp_Bool_Vector *) $ptr |
| 253 | echo \n | 292 | output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8) |
| 293 | echo \n | ||
| 254 | end | 294 | end |
| 255 | document xboolvector | 295 | document xboolvector |
| 256 | Print the contents and address of the bool-vector $. | 296 | Print the contents and address of the bool-vector $. |
| @@ -258,9 +298,11 @@ This command assumes that $ is an Emacs Lisp bool-vector value. | |||
| 258 | end | 298 | end |
| 259 | 299 | ||
| 260 | define xbuffer | 300 | define xbuffer |
| 261 | print (struct buffer *) (($ & $valmask) | gdb_data_seg_bits) | 301 | xgetptr $ |
| 262 | output ((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data | 302 | print (struct buffer *) $ptr |
| 263 | echo \n | 303 | xgetptr $->name |
| 304 | output ((struct Lisp_String *) $ptr)->data | ||
| 305 | echo \n | ||
| 264 | end | 306 | end |
| 265 | document xbuffer | 307 | document xbuffer |
| 266 | Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. | 308 | Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. |
| @@ -268,24 +310,26 @@ Print the name of the buffer. | |||
| 268 | end | 310 | end |
| 269 | 311 | ||
| 270 | define xhashtable | 312 | define xhashtable |
| 271 | print (struct Lisp_Hash_Table *) (($ & $valmask) | gdb_data_seg_bits) | 313 | xgetptr $ |
| 314 | print (struct Lisp_Hash_Table *) $ptr | ||
| 272 | end | 315 | end |
| 273 | document xhashtable | 316 | document xhashtable |
| 274 | Set $ as a hash table pointer, assuming it is an Emacs Lisp hash table value. | 317 | Set $ as a hash table pointer, assuming it is an Emacs Lisp hash table value. |
| 275 | end | 318 | end |
| 276 | 319 | ||
| 277 | define xcons | 320 | define xcons |
| 278 | print (struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits) | 321 | xgetptr $ |
| 279 | output/x *$ | 322 | print (struct Lisp_Cons *) $ptr |
| 280 | echo \n | 323 | output/x *$ |
| 324 | echo \n | ||
| 281 | end | 325 | end |
| 282 | document xcons | 326 | document xcons |
| 283 | Print the contents of $, assuming it is an Emacs Lisp cons. | 327 | Print the contents of $, assuming it is an Emacs Lisp cons. |
| 284 | end | 328 | end |
| 285 | 329 | ||
| 286 | define nextcons | 330 | define nextcons |
| 287 | p $.cdr | 331 | p $.cdr |
| 288 | xcons | 332 | xcons |
| 289 | end | 333 | end |
| 290 | document nextcons | 334 | document nextcons |
| 291 | Print the contents of the next cell in a list. | 335 | Print the contents of the next cell in a list. |
| @@ -293,28 +337,34 @@ This assumes that the last thing you printed was a cons cell contents | |||
| 293 | (type struct Lisp_Cons) or a pointer to one. | 337 | (type struct Lisp_Cons) or a pointer to one. |
| 294 | end | 338 | end |
| 295 | define xcar | 339 | define xcar |
| 296 | print/x ((($ >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits))->car : 0) | 340 | xgetptr $ |
| 341 | xgettype $ | ||
| 342 | print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->car : 0) | ||
| 297 | end | 343 | end |
| 298 | document xcar | 344 | document xcar |
| 299 | Print the car of $, assuming it is an Emacs Lisp pair. | 345 | Print the car of $, assuming it is an Emacs Lisp pair. |
| 300 | end | 346 | end |
| 301 | 347 | ||
| 302 | define xcdr | 348 | define xcdr |
| 303 | print/x ((($ >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits))->cdr : 0) | 349 | xgetptr $ |
| 350 | xgettype $ | ||
| 351 | print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->cdr : 0) | ||
| 304 | end | 352 | end |
| 305 | document xcdr | 353 | document xcdr |
| 306 | Print the cdr of $, assuming it is an Emacs Lisp pair. | 354 | Print the cdr of $, assuming it is an Emacs Lisp pair. |
| 307 | end | 355 | end |
| 308 | 356 | ||
| 309 | define xfloat | 357 | define xfloat |
| 310 | print ((struct Lisp_Float *) (($ & $valmask) | gdb_data_seg_bits))->data | 358 | xgetptr $ |
| 359 | print ((struct Lisp_Float *) $ptr)->data | ||
| 311 | end | 360 | end |
| 312 | document xfloat | 361 | document xfloat |
| 313 | Print $ assuming it is a lisp floating-point number. | 362 | Print $ assuming it is a lisp floating-point number. |
| 314 | end | 363 | end |
| 315 | 364 | ||
| 316 | define xscrollbar | 365 | define xscrollbar |
| 317 | print (struct scrollbar *) (($ & $valmask) | gdb_data_seg_bits) | 366 | xgetptr $ |
| 367 | print (struct scrollbar *) $ptr | ||
| 318 | output *$ | 368 | output *$ |
| 319 | echo \n | 369 | echo \n |
| 320 | end | 370 | end |
| @@ -323,10 +373,11 @@ Print $ as a scrollbar pointer. | |||
| 323 | end | 373 | end |
| 324 | 374 | ||
| 325 | define xprintsym | 375 | define xprintsym |
| 326 | set $sym = (struct Lisp_Symbol *) ((((int) $arg0) & $valmask) | gdb_data_seg_bits) | 376 | xgetptr $arg0 |
| 327 | set $sym_name = ((struct Lisp_String *)(($sym->xname & $valmask) | gdb_data_seg_bits)) | 377 | set $sym = (struct Lisp_Symbol *) $ptr |
| 378 | xgetptr $sym->xname | ||
| 379 | set $sym_name = (struct Lisp_String *) $ptr | ||
| 328 | output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size : $sym_name->size_byte) | 380 | output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size : $sym_name->size_byte) |
| 329 | echo \n | ||
| 330 | end | 381 | end |
| 331 | document xprintsym | 382 | document xprintsym |
| 332 | Print argument as a symbol. | 383 | Print argument as a symbol. |
| @@ -335,14 +386,16 @@ end | |||
| 335 | define xbacktrace | 386 | define xbacktrace |
| 336 | set $bt = backtrace_list | 387 | set $bt = backtrace_list |
| 337 | while $bt | 388 | while $bt |
| 338 | set $type = (enum Lisp_Type) ((*$bt->function >> gdb_valbits) & 0x7) | 389 | xgettype (*$bt->function) |
| 339 | if $type == Lisp_Symbol | 390 | if $type == Lisp_Symbol |
| 340 | xprintsym *$bt->function | 391 | xprintsym (*$bt->function) |
| 392 | echo \n | ||
| 341 | else | 393 | else |
| 342 | printf "0x%x ", *$bt->function | 394 | printf "0x%x ", *$bt->function |
| 343 | if $type == Lisp_Vectorlike | 395 | if $type == Lisp_Vectorlike |
| 344 | set $size = ((struct Lisp_Vector *) ((*$bt->function & $valmask) | gdb_data_seg_bits))->size | 396 | xgetptr (*$bt->function) |
| 345 | output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0) | 397 | set $size = ((struct Lisp_Vector *) $ptr)->size |
| 398 | output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size | ||
| 346 | else | 399 | else |
| 347 | printf "Lisp type %d", $type | 400 | printf "Lisp type %d", $type |
| 348 | end | 401 | end |
| @@ -358,16 +411,17 @@ document xbacktrace | |||
| 358 | end | 411 | end |
| 359 | 412 | ||
| 360 | define xreload | 413 | define xreload |
| 361 | set $valmask = ((long)1 << gdb_valbits) - 1 | 414 | set $tagmask = (((long)1 << gdb_gctypebits) - 1) |
| 362 | set $nonvalbits = gdb_emacs_intbits - gdb_valbits | 415 | set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1 |
| 363 | end | 416 | end |
| 364 | document xreload | 417 | document xreload |
| 365 | When starting Emacs a second time in the same gdb session under | 418 | When starting Emacs a second time in the same gdb session under |
| 366 | FreeBSD 2.2.5, gdb 4.13, $valmask and $nonvalbits have lost | 419 | FreeBSD 2.2.5, gdb 4.13, $valmask have lost |
| 367 | their values. (The same happens on current (2000) versions of GNU/Linux | 420 | their values. (The same happens on current (2000) versions of GNU/Linux |
| 368 | with gdb 5.0.) | 421 | with gdb 5.0.) |
| 369 | This function reloads them. | 422 | This function reloads them. |
| 370 | end | 423 | end |
| 424 | xreload | ||
| 371 | 425 | ||
| 372 | define hook-run | 426 | define hook-run |
| 373 | xreload | 427 | xreload |
diff --git a/src/.gdbinit-union b/src/.gdbinit-union deleted file mode 100644 index 1af2c0976c4..00000000000 --- a/src/.gdbinit-union +++ /dev/null | |||
| @@ -1,402 +0,0 @@ | |||
| 1 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001 | ||
| 2 | # Free Software Foundation, Inc. | ||
| 3 | # | ||
| 4 | # This file is part of GNU Emacs. | ||
| 5 | # | ||
| 6 | # GNU Emacs is free software; you can redistribute it and/or modify | ||
| 7 | # it under the terms of the GNU General Public License as published by | ||
| 8 | # the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | # any later version. | ||
| 10 | # | ||
| 11 | # GNU Emacs is distributed in the hope that it will be useful, | ||
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | # GNU General Public License for more details. | ||
| 15 | # | ||
| 16 | # You should have received a copy of the GNU General Public License | ||
| 17 | # along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 18 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 19 | # Boston, MA 02111-1307, USA. | ||
| 20 | |||
| 21 | # Force loading of symbols, enough to give us gdb_valbits etc. | ||
| 22 | set main | ||
| 23 | |||
| 24 | # Find lwlib source files too. | ||
| 25 | dir ../lwlib | ||
| 26 | #dir /gd/gnu/lesstif-0.89.9/lib/Xm | ||
| 27 | |||
| 28 | # Don't enter GDB when user types C-g to quit. | ||
| 29 | # This has one unfortunate effect: you can't type C-c | ||
| 30 | # at the GDB to stop Emacs, when using X. | ||
| 31 | # However, C-z works just as well in that case. | ||
| 32 | handle 2 noprint pass | ||
| 33 | |||
| 34 | # Don't pass SIGALRM to Emacs. This makes problems when | ||
| 35 | # debugging. | ||
| 36 | handle SIGALRM ignore | ||
| 37 | |||
| 38 | # Set up a mask to use. | ||
| 39 | # This should be EMACS_INT, but in some cases that is a macro. | ||
| 40 | # long ought to work in all cases right now. | ||
| 41 | set $valmask = ((long)1 << gdb_valbits) - 1 | ||
| 42 | set $nonvalbits = gdb_emacs_intbits - gdb_valbits | ||
| 43 | |||
| 44 | # Set up something to print out s-expressions. | ||
| 45 | define pr | ||
| 46 | set debug_print ($) | ||
| 47 | end | ||
| 48 | document pr | ||
| 49 | Print the emacs s-expression which is $. | ||
| 50 | Works only when an inferior emacs is executing. | ||
| 51 | end | ||
| 52 | |||
| 53 | define xtype | ||
| 54 | output (enum Lisp_Type) (($.i >> gdb_valbits) & 0x7) | ||
| 55 | echo \n | ||
| 56 | output ((($.i >> gdb_valbits) & 0x7) == Lisp_Misc ? (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($.i & $valmask) | gdb_data_seg_bits))->type) : (($.i >> gdb_valbits) & 0x7) == Lisp_Vectorlike ? ($size = ((struct Lisp_Vector *) (($.i & $valmask) | gdb_data_seg_bits))->size, (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)) : 0) | ||
| 57 | echo \n | ||
| 58 | end | ||
| 59 | document xtype | ||
| 60 | Print the type of $, assuming it is an Emacs Lisp value. | ||
| 61 | If the first type printed is Lisp_Vector or Lisp_Misc, | ||
| 62 | the second line gives the more precise type. | ||
| 63 | Otherwise the second line doesn't mean anything. | ||
| 64 | end | ||
| 65 | |||
| 66 | define xvectype | ||
| 67 | set $size = ((struct Lisp_Vector *) (($.i & $valmask) | gdb_data_seg_bits))->size | ||
| 68 | output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0) | ||
| 69 | echo \n | ||
| 70 | end | ||
| 71 | document xvectype | ||
| 72 | Print the vector subtype of $, assuming it is a vector or pseudovector. | ||
| 73 | end | ||
| 74 | |||
| 75 | define xmisctype | ||
| 76 | output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($.i & $valmask) | gdb_data_seg_bits))->type) | ||
| 77 | echo \n | ||
| 78 | end | ||
| 79 | document xmisctype | ||
| 80 | Print the specific type of $, assuming it is some misc type. | ||
| 81 | end | ||
| 82 | |||
| 83 | define xint | ||
| 84 | print (($.i & $valmask) << $nonvalbits) >> $nonvalbits | ||
| 85 | end | ||
| 86 | document xint | ||
| 87 | Print $, assuming it is an Emacs Lisp integer. This gets the sign right. | ||
| 88 | end | ||
| 89 | |||
| 90 | define xptr | ||
| 91 | print (void *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 92 | end | ||
| 93 | document xptr | ||
| 94 | Print the pointer portion of $, assuming it is an Emacs Lisp value. | ||
| 95 | end | ||
| 96 | |||
| 97 | define xmarker | ||
| 98 | print (struct Lisp_Marker *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 99 | end | ||
| 100 | document xmarker | ||
| 101 | Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. | ||
| 102 | end | ||
| 103 | |||
| 104 | define xoverlay | ||
| 105 | print (struct Lisp_Overlay *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 106 | end | ||
| 107 | document xoverlay | ||
| 108 | Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value. | ||
| 109 | end | ||
| 110 | |||
| 111 | define xmiscfree | ||
| 112 | print (struct Lisp_Free *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 113 | end | ||
| 114 | document xmiscfree | ||
| 115 | Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value. | ||
| 116 | end | ||
| 117 | |||
| 118 | define xintfwd | ||
| 119 | print (struct Lisp_Intfwd *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 120 | end | ||
| 121 | document xintfwd | ||
| 122 | Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value. | ||
| 123 | end | ||
| 124 | |||
| 125 | define xboolfwd | ||
| 126 | print (struct Lisp_Boolfwd *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 127 | end | ||
| 128 | document xboolfwd | ||
| 129 | Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value. | ||
| 130 | end | ||
| 131 | |||
| 132 | define xobjfwd | ||
| 133 | print (struct Lisp_Objfwd *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 134 | end | ||
| 135 | document xobjfwd | ||
| 136 | Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value. | ||
| 137 | end | ||
| 138 | |||
| 139 | define xbufobjfwd | ||
| 140 | print (struct Lisp_Buffer_Objfwd *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 141 | end | ||
| 142 | document xbufobjfwd | ||
| 143 | Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. | ||
| 144 | end | ||
| 145 | |||
| 146 | define xkbobjfwd | ||
| 147 | print (struct Lisp_Kboard_Objfwd *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 148 | end | ||
| 149 | document xkbobjfwd | ||
| 150 | Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. | ||
| 151 | end | ||
| 152 | |||
| 153 | define xbuflocal | ||
| 154 | print (struct Lisp_Buffer_Local_Value *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 155 | end | ||
| 156 | document xbuflocal | ||
| 157 | Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value. | ||
| 158 | end | ||
| 159 | |||
| 160 | define xsymbol | ||
| 161 | print (struct Lisp_Symbol *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 162 | xprintsymptr $ | ||
| 163 | end | ||
| 164 | document xsymbol | ||
| 165 | Print the name and address of the symbol $. | ||
| 166 | This command assumes that $ is an Emacs Lisp symbol value. | ||
| 167 | end | ||
| 168 | |||
| 169 | define xstring | ||
| 170 | print (struct Lisp_String *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 171 | output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte) | ||
| 172 | echo \n | ||
| 173 | end | ||
| 174 | document xstring | ||
| 175 | Print the contents and address of the string $. | ||
| 176 | This command assumes that $ is an Emacs Lisp string value. | ||
| 177 | end | ||
| 178 | |||
| 179 | define xvector | ||
| 180 | print (struct Lisp_Vector *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 181 | output ($->size > 50) ? 0 : ($->contents[0])@($->size) | ||
| 182 | echo \n | ||
| 183 | end | ||
| 184 | document xvector | ||
| 185 | Print the contents and address of the vector $. | ||
| 186 | This command assumes that $ is an Emacs Lisp vector value. | ||
| 187 | end | ||
| 188 | |||
| 189 | define xprocess | ||
| 190 | print (struct Lisp_Process *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 191 | output *$ | ||
| 192 | echo \n | ||
| 193 | end | ||
| 194 | document xprocess | ||
| 195 | Print the address of the struct Lisp_process which the Lisp_Object $ points to. | ||
| 196 | end | ||
| 197 | |||
| 198 | define xframe | ||
| 199 | print (struct frame *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 200 | end | ||
| 201 | document xframe | ||
| 202 | Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. | ||
| 203 | end | ||
| 204 | |||
| 205 | define xcompiled | ||
| 206 | print (struct Lisp_Vector *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 207 | output ($->contents[0])@($->size & 0xff) | ||
| 208 | end | ||
| 209 | document xcompiled | ||
| 210 | Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value. | ||
| 211 | end | ||
| 212 | |||
| 213 | define xwindow | ||
| 214 | print (struct window *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 215 | printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top | ||
| 216 | end | ||
| 217 | document xwindow | ||
| 218 | Print $ as a window pointer, assuming it is an Emacs Lisp window value. | ||
| 219 | Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". | ||
| 220 | end | ||
| 221 | |||
| 222 | define xwinconfig | ||
| 223 | print (struct save_window_data *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 224 | end | ||
| 225 | document xwinconfig | ||
| 226 | Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value. | ||
| 227 | end | ||
| 228 | |||
| 229 | define xsubr | ||
| 230 | print (struct Lisp_Subr *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 231 | output *$ | ||
| 232 | echo \n | ||
| 233 | end | ||
| 234 | document xsubr | ||
| 235 | Print the address of the subr which the Lisp_Object $ points to. | ||
| 236 | end | ||
| 237 | |||
| 238 | define xchartable | ||
| 239 | print (struct Lisp_Char_Table *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 240 | printf "Purpose: " | ||
| 241 | output (char*)&((struct Lisp_Symbol *) (($->purpose.i & $valmask) | gdb_data_seg_bits))->name->data | ||
| 242 | printf " %d extra slots", ($->size & 0x1ff) - 388 | ||
| 243 | echo \n | ||
| 244 | end | ||
| 245 | document xchartable | ||
| 246 | Print the address of the char-table $, and its purpose. | ||
| 247 | This command assumes that $ is an Emacs Lisp char-table value. | ||
| 248 | end | ||
| 249 | |||
| 250 | define xboolvector | ||
| 251 | print (struct Lisp_Bool_Vector *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 252 | output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8) | ||
| 253 | echo \n | ||
| 254 | end | ||
| 255 | document xboolvector | ||
| 256 | Print the contents and address of the bool-vector $. | ||
| 257 | This command assumes that $ is an Emacs Lisp bool-vector value. | ||
| 258 | end | ||
| 259 | |||
| 260 | define xbuffer | ||
| 261 | print (struct buffer *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 262 | output ((struct Lisp_String *) (($->name.i & $valmask) | gdb_data_seg_bits))->data | ||
| 263 | echo \n | ||
| 264 | end | ||
| 265 | document xbuffer | ||
| 266 | Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. | ||
| 267 | Print the name of the buffer. | ||
| 268 | end | ||
| 269 | |||
| 270 | define xhashtable | ||
| 271 | print (struct Lisp_Hash_Table *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 272 | end | ||
| 273 | document xhashtable | ||
| 274 | Set $ as a hash table pointer, assuming it is an Emacs Lisp hash table value. | ||
| 275 | end | ||
| 276 | |||
| 277 | define xcons | ||
| 278 | print (struct Lisp_Cons *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 279 | output/x *$ | ||
| 280 | echo \n | ||
| 281 | end | ||
| 282 | document xcons | ||
| 283 | Print the contents of $, assuming it is an Emacs Lisp cons. | ||
| 284 | end | ||
| 285 | |||
| 286 | define nextcons | ||
| 287 | p $.cdr | ||
| 288 | xcons | ||
| 289 | end | ||
| 290 | document nextcons | ||
| 291 | Print the contents of the next cell in a list. | ||
| 292 | This assumes that the last thing you printed was a cons cell contents | ||
| 293 | (type struct Lisp_Cons) or a pointer to one. | ||
| 294 | end | ||
| 295 | |||
| 296 | define xcar | ||
| 297 | print/x ((($.i >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($.i & $valmask) | gdb_data_seg_bits))->car : 0) | ||
| 298 | end | ||
| 299 | document xcar | ||
| 300 | Print the car of $, assuming it is an Emacs Lisp pair. | ||
| 301 | end | ||
| 302 | |||
| 303 | define xcdr | ||
| 304 | print/x ((($.i >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($.i & $valmask) | gdb_data_seg_bits))->cdr : 0) | ||
| 305 | end | ||
| 306 | document xcdr | ||
| 307 | Print the cdr of $, assuming it is an Emacs Lisp pair. | ||
| 308 | end | ||
| 309 | |||
| 310 | define xfloat | ||
| 311 | print ((struct Lisp_Float *) (($.i & $valmask) | gdb_data_seg_bits))->data | ||
| 312 | end | ||
| 313 | document xfloat | ||
| 314 | Print $ assuming it is a lisp floating-point number. | ||
| 315 | end | ||
| 316 | |||
| 317 | define xscrollbar | ||
| 318 | print (struct scrollbar *) (($.i & $valmask) | gdb_data_seg_bits) | ||
| 319 | output *$ | ||
| 320 | echo \n | ||
| 321 | end | ||
| 322 | document xscrollbar | ||
| 323 | Print $ as a scrollbar pointer. | ||
| 324 | end | ||
| 325 | |||
| 326 | define xprintsym | ||
| 327 | set $sym = ((struct Lisp_Symbol *) (($arg0.i & $valmask) | gdb_data_seg_bits)) | ||
| 328 | xprintsymptr $sym | ||
| 329 | end | ||
| 330 | document xprintsym | ||
| 331 | Print argument as a symbol. | ||
| 332 | end | ||
| 333 | define xprintsymptr | ||
| 334 | set $sym = $arg0 | ||
| 335 | set $sym_name = ((struct Lisp_String *)(($sym->xname.i & $valmask) | gdb_data_seg_bits)) | ||
| 336 | output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size : $sym_name->size_byte) | ||
| 337 | echo \n | ||
| 338 | end | ||
| 339 | |||
| 340 | define xbacktrace | ||
| 341 | set $bt = backtrace_list | ||
| 342 | while $bt | ||
| 343 | set $type = (enum Lisp_Type) (((*$bt->function).i >> gdb_valbits) & 0x7) | ||
| 344 | if $type == Lisp_Symbol | ||
| 345 | xprintsym (*$bt->function) | ||
| 346 | else | ||
| 347 | printf "0x%x ", (*$bt->function).i | ||
| 348 | if $type == Lisp_Vectorlike | ||
| 349 | set $size = ((struct Lisp_Vector *) (((*$bt->function).i & $valmask) | gdb_data_seg_bits))->size | ||
| 350 | output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0) | ||
| 351 | else | ||
| 352 | printf "Lisp type %d", $type | ||
| 353 | end | ||
| 354 | echo \n | ||
| 355 | end | ||
| 356 | set $bt = $bt->next | ||
| 357 | end | ||
| 358 | end | ||
| 359 | document xbacktrace | ||
| 360 | Print a backtrace of Lisp function calls from backtrace_list. | ||
| 361 | Set a breakpoint at Fsignal and call this to see from where | ||
| 362 | an error was signaled. | ||
| 363 | end | ||
| 364 | |||
| 365 | define xreload | ||
| 366 | set $valmask = ((long)1 << gdb_valbits) - 1 | ||
| 367 | set $nonvalbits = gdb_emacs_intbits - gdb_valbits | ||
| 368 | end | ||
| 369 | document xreload | ||
| 370 | When starting Emacs a second time in the same gdb session under | ||
| 371 | FreeBSD 2.2.5, gdb 4.13, $valmask and $nonvalbits have lost | ||
| 372 | their values. (The same happens on current (2000) versions of GNU/Linux | ||
| 373 | with gdb 5.0.) | ||
| 374 | This function reloads them. | ||
| 375 | end | ||
| 376 | |||
| 377 | define hook-run | ||
| 378 | xreload | ||
| 379 | end | ||
| 380 | |||
| 381 | # Call xreload if a new Emacs executable is loaded. | ||
| 382 | define hookpost-run | ||
| 383 | xreload | ||
| 384 | end | ||
| 385 | |||
| 386 | set print pretty on | ||
| 387 | set print sevenbit-strings | ||
| 388 | |||
| 389 | # show environment DISPLAY | ||
| 390 | # show environment TERM | ||
| 391 | # set args -geometry 80x40+0+0 | ||
| 392 | |||
| 393 | # Don't let abort actually run, as it will make | ||
| 394 | # stdio stop working and therefore the `pr' command above as well. | ||
| 395 | # break abort | ||
| 396 | |||
| 397 | # If we are running in synchronous mode, we want a chance to look around | ||
| 398 | # before Emacs exits. Perhaps we should put the break somewhere else | ||
| 399 | # instead... | ||
| 400 | # break x_error_quitter | ||
| 401 | |||
| 402 | # arch-tag: 08f4d20d-0254-4374-a80c-179d5a517915 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 357060188a5..a1c384ce535 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,46 @@ | |||
| 1 | 2004-04-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * .gdbinit-union: Remove. | ||
| 4 | |||
| 5 | * .gdbinit: Make it work for USE_LSB_TAG and !NO_LISP_UNION. | ||
| 6 | (xgetptr, xgetint, xgettype): New funs. Use them everywhere. | ||
| 7 | ($nonvalbits): Remove. | ||
| 8 | ($valmask): Set it by calling xreload to avoid redundancy. | ||
| 9 | |||
| 10 | * emacs.c (gdb_use_union, gdb_use_lsb): New vars. | ||
| 11 | (gdb_emacs_intbits): Remove. | ||
| 12 | |||
| 13 | 2004-03-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 14 | |||
| 15 | * data.c (Fbyteorder): Make test work even if unsigned is not 4 bytes. | ||
| 16 | |||
| 17 | 2004-03-30 Kenichi Handa <handa@m17n.org> | ||
| 18 | |||
| 19 | * editfns.c (Fformat): Fix initialization of the array info. | ||
| 20 | |||
| 21 | 2004-03-30 Kim F. Storm <storm@cua.dk> | ||
| 22 | |||
| 23 | * xterm.c (x_mouse_click_focus_ignore_position): New var. | ||
| 24 | (syms_of_xterm): DEFVAR_BOOL it. | ||
| 25 | (ignore_next_mouse_click_timeout): New var. | ||
| 26 | (handle_one_xevent): Clear it on KeyPress, set it on EnterNotify. | ||
| 27 | Use it to filter mouse clicks following focus event. | ||
| 28 | |||
| 29 | 2004-03-29 David Ponce <david@dponce.com> | ||
| 30 | |||
| 31 | * callint.c (Fcall_interactively): Fix last change. | ||
| 32 | |||
| 33 | 2004-03-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 34 | |||
| 35 | * eval.c (Fcommandp): Simplify. | ||
| 36 | |||
| 37 | * data.c (Finteractive_form): Rename from Fsubr_interactive_form. | ||
| 38 | Extend to handle all kinds of functions. | ||
| 39 | |||
| 40 | * lisp.h (Finteractive_form): Declare. | ||
| 41 | |||
| 42 | * callint.c (Fcall_interactively): Use it. | ||
| 43 | |||
| 1 | 2004-03-26 Kim F. Storm <storm@cua.dk> | 44 | 2004-03-26 Kim F. Storm <storm@cua.dk> |
| 2 | 45 | ||
| 3 | * xdisp.c (syms_of_xdisp): Include `void-variable' in list_of_error | 46 | * xdisp.c (syms_of_xdisp): Include `void-variable' in list_of_error |
| @@ -39,7 +82,7 @@ | |||
| 39 | * image.c (Qcenter): Move to xdisp.c. | 82 | * image.c (Qcenter): Move to xdisp.c. |
| 40 | 83 | ||
| 41 | * xdisp.c (Qcenter): Declare here. | 84 | * xdisp.c (Qcenter): Declare here. |
| 42 | (syms_of_xdisp): intern and staticpro it. | 85 | (syms_of_xdisp): Intern and staticpro it. |
| 43 | (handle_single_display_prop): Allow space display property on all | 86 | (handle_single_display_prop): Allow space display property on all |
| 44 | platforms. | 87 | platforms. |
| 45 | (display_mode_line): Set mode_line_p before displaying line. | 88 | (display_mode_line): Set mode_line_p before displaying line. |
diff --git a/src/callint.c b/src/callint.c index 21a6bd0b1ad..1d7d6f9f89f 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Call a Lisp function interactively. | 1 | /* Call a Lisp function interactively. |
| 2 | Copyright (C) 1985, 86, 93, 94, 95, 1997, 2000, 02, 2003 | 2 | Copyright (C) 1985, 86, 93, 94, 95, 1997, 2000, 02, 03, 2004 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -347,25 +347,17 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 347 | goto lose; | 347 | goto lose; |
| 348 | specs = XVECTOR (fun)->contents[COMPILED_INTERACTIVE]; | 348 | specs = XVECTOR (fun)->contents[COMPILED_INTERACTIVE]; |
| 349 | } | 349 | } |
| 350 | else if (!CONSP (fun)) | 350 | else |
| 351 | goto lose; | ||
| 352 | else if (funcar = XCAR (fun), EQ (funcar, Qautoload)) | ||
| 353 | { | 351 | { |
| 352 | Lisp_Object form; | ||
| 354 | GCPRO2 (function, prefix_arg); | 353 | GCPRO2 (function, prefix_arg); |
| 355 | do_autoload (fun, function); | 354 | form = Finteractive_form (function); |
| 356 | UNGCPRO; | 355 | UNGCPRO; |
| 357 | goto retry; | 356 | if (CONSP (form)) |
| 358 | } | 357 | specs = filter_specs = Fcar (XCDR (form)); |
| 359 | else if (EQ (funcar, Qlambda)) | 358 | else |
| 360 | { | ||
| 361 | specs = Fassq (Qinteractive, Fcdr (XCDR (fun))); | ||
| 362 | if (NILP (specs)) | ||
| 363 | goto lose; | 359 | goto lose; |
| 364 | filter_specs = Fnth (make_number (1), specs); | ||
| 365 | specs = Fcar (Fcdr (specs)); | ||
| 366 | } | 360 | } |
| 367 | else | ||
| 368 | goto lose; | ||
| 369 | 361 | ||
| 370 | /* If either SPECS or STRING is set to a string, use it. */ | 362 | /* If either SPECS or STRING is set to a string, use it. */ |
| 371 | if (STRINGP (specs)) | 363 | if (STRINGP (specs)) |
diff --git a/src/data.c b/src/data.c index bff2baaed27..c3cf05e0f10 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. | 1 | /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. |
| 2 | Copyright (C) 1985,86,88,93,94,95,97,98,99, 2000, 2001, 2003 | 2 | Copyright (C) 1985,86,88,93,94,95,97,98,99, 2000, 2001, 03, 2004 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -761,17 +761,39 @@ function with `&rest' args, or `unevalled' for a special form. */) | |||
| 761 | return Fcons (make_number (minargs), make_number (maxargs)); | 761 | return Fcons (make_number (minargs), make_number (maxargs)); |
| 762 | } | 762 | } |
| 763 | 763 | ||
| 764 | DEFUN ("subr-interactive-form", Fsubr_interactive_form, Ssubr_interactive_form, 1, 1, 0, | 764 | DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0, |
| 765 | doc: /* Return the interactive form of SUBR or nil if none. | 765 | doc: /* Return the interactive form of CMD or nil if none. |
| 766 | SUBR must be a built-in function. Value, if non-nil, is a list | 766 | CMD must be a command. Value, if non-nil, is a list |
| 767 | \(interactive SPEC). */) | 767 | \(interactive SPEC). */) |
| 768 | (subr) | 768 | (cmd) |
| 769 | Lisp_Object subr; | 769 | Lisp_Object cmd; |
| 770 | { | 770 | { |
| 771 | if (!SUBRP (subr)) | 771 | Lisp_Object fun = indirect_function (cmd); |
| 772 | wrong_type_argument (Qsubrp, subr); | 772 | |
| 773 | if (XSUBR (subr)->prompt) | 773 | if (SUBRP (fun)) |
| 774 | return list2 (Qinteractive, build_string (XSUBR (subr)->prompt)); | 774 | { |
| 775 | if (XSUBR (fun)->prompt) | ||
| 776 | return list2 (Qinteractive, build_string (XSUBR (fun)->prompt)); | ||
| 777 | } | ||
| 778 | else if (COMPILEDP (fun)) | ||
| 779 | { | ||
| 780 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE) | ||
| 781 | return list2 (Qinteractive, AREF (fun, COMPILED_INTERACTIVE)); | ||
| 782 | } | ||
| 783 | else if (CONSP (fun)) | ||
| 784 | { | ||
| 785 | Lisp_Object funcar = XCAR (fun); | ||
| 786 | if (EQ (funcar, Qlambda)) | ||
| 787 | return Fassq (Qinteractive, Fcdr (XCDR (fun))); | ||
| 788 | else if (EQ (funcar, Qautoload)) | ||
| 789 | { | ||
| 790 | struct gcpro gcpro1; | ||
| 791 | GCPRO1 (cmd); | ||
| 792 | do_autoload (fun, cmd); | ||
| 793 | UNGCPRO; | ||
| 794 | return Finteractive_form (cmd); | ||
| 795 | } | ||
| 796 | } | ||
| 775 | return Qnil; | 797 | return Qnil; |
| 776 | } | 798 | } |
| 777 | 799 | ||
| @@ -2887,7 +2909,7 @@ lowercase l) for small endian machines. */) | |||
| 2887 | () | 2909 | () |
| 2888 | { | 2910 | { |
| 2889 | unsigned i = 0x04030201; | 2911 | unsigned i = 0x04030201; |
| 2890 | int order = *(char *)&i == 4 ? 66 : 108; | 2912 | int order = *(char *)&i == 1 ? 108 : 66; |
| 2891 | 2913 | ||
| 2892 | return make_number (order); | 2914 | return make_number (order); |
| 2893 | } | 2915 | } |
| @@ -3209,7 +3231,7 @@ syms_of_data () | |||
| 3209 | staticpro (&Qhash_table); | 3231 | staticpro (&Qhash_table); |
| 3210 | 3232 | ||
| 3211 | defsubr (&Sindirect_variable); | 3233 | defsubr (&Sindirect_variable); |
| 3212 | defsubr (&Ssubr_interactive_form); | 3234 | defsubr (&Sinteractive_form); |
| 3213 | defsubr (&Seq); | 3235 | defsubr (&Seq); |
| 3214 | defsubr (&Snull); | 3236 | defsubr (&Snull); |
| 3215 | defsubr (&Stype_of); | 3237 | defsubr (&Stype_of); |
diff --git a/src/editfns.c b/src/editfns.c index df183155c4b..ce075f2696c 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3280,7 +3280,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3280 | int i; | 3280 | int i; |
| 3281 | info = (struct info *) alloca (nbytes); | 3281 | info = (struct info *) alloca (nbytes); |
| 3282 | bzero (info, nbytes); | 3282 | bzero (info, nbytes); |
| 3283 | for (i = 0; i <= nargs; i++) | 3283 | for (i = 0; i < nargs; i++) |
| 3284 | info[i].start = -1; | 3284 | info[i].start = -1; |
| 3285 | discarded = (char *) alloca (SBYTES (args[0])); | 3285 | discarded = (char *) alloca (SBYTES (args[0])); |
| 3286 | bzero (discarded, SBYTES (args[0])); | 3286 | bzero (discarded, SBYTES (args[0])); |
diff --git a/src/emacs.c b/src/emacs.c index 1c7d595d3d3..011d66c5cab 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Fully extensible Emacs, running on Unix, intended for GNU. | 1 | /* Fully extensible Emacs, running on Unix, intended for GNU. |
| 2 | Copyright (C) 1985,86,87,93,94,95,97,98,1999,2001,02,2003 | 2 | Copyright (C) 1985,86,87,93,94,95,97,98,1999,2001,02,03,2004 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -87,9 +87,18 @@ extern char *index P_ ((const char *, int)); | |||
| 87 | 87 | ||
| 88 | /* Make these values available in GDB, which doesn't see macros. */ | 88 | /* Make these values available in GDB, which doesn't see macros. */ |
| 89 | 89 | ||
| 90 | #ifdef USE_LSB_TAG | ||
| 91 | int gdb_use_lsb = 1; | ||
| 92 | #else | ||
| 93 | int gdb_use_lsb = 0; | ||
| 94 | #endif | ||
| 95 | #ifdef NO_UNION_TYPE | ||
| 96 | int gdb_use_union = 0; | ||
| 97 | #else | ||
| 98 | int gdb_use_union = 1; | ||
| 99 | #endif | ||
| 90 | EMACS_INT gdb_valbits = VALBITS; | 100 | EMACS_INT gdb_valbits = VALBITS; |
| 91 | EMACS_INT gdb_gctypebits = GCTYPEBITS; | 101 | EMACS_INT gdb_gctypebits = GCTYPEBITS; |
| 92 | EMACS_INT gdb_emacs_intbits = sizeof (EMACS_INT) * BITS_PER_CHAR; | ||
| 93 | #ifdef DATA_SEG_BITS | 102 | #ifdef DATA_SEG_BITS |
| 94 | EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS; | 103 | EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS; |
| 95 | #else | 104 | #else |
diff --git a/src/eval.c b/src/eval.c index a5f66b295a6..0326a828a81 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Evaluator for GNU Emacs Lisp interpreter. | 1 | /* Evaluator for GNU Emacs Lisp interpreter. |
| 2 | Copyright (C) 1985, 86, 87, 93, 94, 95, 99, 2000, 2001, 2002 | 2 | Copyright (C) 1985, 86, 87, 93, 94, 95, 99, 2000, 2001, 02, 2004 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -1812,13 +1812,11 @@ then strings and vectors are not accepted. */) | |||
| 1812 | /* Lists may represent commands. */ | 1812 | /* Lists may represent commands. */ |
| 1813 | if (!CONSP (fun)) | 1813 | if (!CONSP (fun)) |
| 1814 | return Qnil; | 1814 | return Qnil; |
| 1815 | funcar = Fcar (fun); | 1815 | funcar = XCAR (fun); |
| 1816 | if (!SYMBOLP (funcar)) | ||
| 1817 | return Fsignal (Qinvalid_function, Fcons (fun, Qnil)); | ||
| 1818 | if (EQ (funcar, Qlambda)) | 1816 | if (EQ (funcar, Qlambda)) |
| 1819 | return Fassq (Qinteractive, Fcdr (Fcdr (fun))); | 1817 | return Fassq (Qinteractive, Fcdr (XCDR (fun))); |
| 1820 | if (EQ (funcar, Qautoload)) | 1818 | if (EQ (funcar, Qautoload)) |
| 1821 | return Fcar (Fcdr (Fcdr (Fcdr (fun)))); | 1819 | return Fcar (Fcdr (Fcdr (XCDR (fun)))); |
| 1822 | else | 1820 | else |
| 1823 | return Qnil; | 1821 | return Qnil; |
| 1824 | } | 1822 | } |
diff --git a/src/lisp.h b/src/lisp.h index 2135f80f5e8..48b9c0c7912 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2034,6 +2034,7 @@ extern Lisp_Object Qnumberp, Qnumber_or_marker_p; | |||
| 2034 | extern Lisp_Object Qinteger; | 2034 | extern Lisp_Object Qinteger; |
| 2035 | 2035 | ||
| 2036 | extern void circular_list_error P_ ((Lisp_Object)); | 2036 | extern void circular_list_error P_ ((Lisp_Object)); |
| 2037 | EXFUN (Finteractive_form, 1); | ||
| 2037 | 2038 | ||
| 2038 | /* Defined in frame.c */ | 2039 | /* Defined in frame.c */ |
| 2039 | extern Lisp_Object Qframep; | 2040 | extern Lisp_Object Qframep; |
diff --git a/src/xterm.c b/src/xterm.c index a297faa2ac0..fe1dca7fd71 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -216,6 +216,17 @@ static String Xt_default_resources[] = {0}; | |||
| 216 | 216 | ||
| 217 | static int toolkit_scroll_bar_interaction; | 217 | static int toolkit_scroll_bar_interaction; |
| 218 | 218 | ||
| 219 | /* Non-zero means to not move point as a result of clicking on a | ||
| 220 | frame to focus it (when focus-follows-mouse is nil). */ | ||
| 221 | |||
| 222 | int x_mouse_click_focus_ignore_position; | ||
| 223 | |||
| 224 | /* Non-zero timeout value means ignore next mouse click if it arrives | ||
| 225 | before that timeout elapses (i.e. as part of the same sequence of | ||
| 226 | events resulting from clicking on a frame to select it). */ | ||
| 227 | |||
| 228 | static unsigned long ignore_next_mouse_click_timeout; | ||
| 229 | |||
| 219 | /* Mouse movement. | 230 | /* Mouse movement. |
| 220 | 231 | ||
| 221 | Formerly, we used PointerMotionHintMask (in standard_event_mask) | 232 | Formerly, we used PointerMotionHintMask (in standard_event_mask) |
| @@ -748,13 +759,13 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 748 | 759 | ||
| 749 | if (p->overlay_p) | 760 | if (p->overlay_p) |
| 750 | { | 761 | { |
| 751 | clipmask = XCreatePixmapFromBitmapData (display, | 762 | clipmask = XCreatePixmapFromBitmapData (display, |
| 752 | FRAME_X_DISPLAY_INFO (f)->root_window, | 763 | FRAME_X_DISPLAY_INFO (f)->root_window, |
| 753 | bits, p->wd, p->h, | 764 | bits, p->wd, p->h, |
| 754 | 1, 0, 1); | 765 | 1, 0, 1); |
| 755 | gcv.clip_mask = clipmask; | 766 | gcv.clip_mask = clipmask; |
| 756 | gcv.clip_x_origin = p->x; | 767 | gcv.clip_x_origin = p->x; |
| 757 | gcv.clip_y_origin = p->y; | 768 | gcv.clip_y_origin = p->y; |
| 758 | XChangeGC (display, gc, GCClipMask | GCClipXOrigin | GCClipYOrigin, &gcv); | 769 | XChangeGC (display, gc, GCClipMask | GCClipXOrigin | GCClipYOrigin, &gcv); |
| 759 | } | 770 | } |
| 760 | 771 | ||
| @@ -5733,7 +5744,7 @@ event_handler_gdk (gxev, ev, data) | |||
| 5733 | else | 5744 | else |
| 5734 | { | 5745 | { |
| 5735 | current_count += | 5746 | current_count += |
| 5736 | handle_one_xevent (dpyinfo, xev, ¤t_finish, | 5747 | handle_one_xevent (dpyinfo, xev, ¤t_finish, |
| 5737 | current_hold_quit); | 5748 | current_hold_quit); |
| 5738 | } | 5749 | } |
| 5739 | } | 5750 | } |
| @@ -6175,6 +6186,8 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6175 | 6186 | ||
| 6176 | case KeyPress: | 6187 | case KeyPress: |
| 6177 | 6188 | ||
| 6189 | ignore_next_mouse_click_timeout = 0; | ||
| 6190 | |||
| 6178 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | 6191 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
| 6179 | /* Dispatch KeyPress events when in menu. */ | 6192 | /* Dispatch KeyPress events when in menu. */ |
| 6180 | if (popup_activated ()) | 6193 | if (popup_activated ()) |
| @@ -6534,6 +6547,9 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6534 | 6547 | ||
| 6535 | f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); | 6548 | f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); |
| 6536 | 6549 | ||
| 6550 | if (f && x_mouse_click_focus_ignore_position) | ||
| 6551 | ignore_next_mouse_click_timeout = event.xmotion.time + 200; | ||
| 6552 | |||
| 6537 | #if 0 | 6553 | #if 0 |
| 6538 | if (event.xcrossing.focus) | 6554 | if (event.xcrossing.focus) |
| 6539 | { | 6555 | { |
| @@ -6777,7 +6793,21 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6777 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | 6793 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
| 6778 | if (! popup_activated ()) | 6794 | if (! popup_activated ()) |
| 6779 | #endif | 6795 | #endif |
| 6780 | construct_mouse_click (&inev, &event, f); | 6796 | { |
| 6797 | if (ignore_next_mouse_click_timeout) | ||
| 6798 | { | ||
| 6799 | if (event.type == ButtonPress | ||
| 6800 | && (int)(event.xbutton.time - ignore_next_mouse_click_timeout) > 0) | ||
| 6801 | { | ||
| 6802 | ignore_next_mouse_click_timeout = 0; | ||
| 6803 | construct_mouse_click (&inev, &event, f); | ||
| 6804 | } | ||
| 6805 | if (event.type == ButtonRelease) | ||
| 6806 | ignore_next_mouse_click_timeout = 0; | ||
| 6807 | } | ||
| 6808 | else | ||
| 6809 | construct_mouse_click (&inev, &event, f); | ||
| 6810 | } | ||
| 6781 | } | 6811 | } |
| 6782 | } | 6812 | } |
| 6783 | else | 6813 | else |
| @@ -6925,7 +6955,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6925 | any_help_event_p = 1; | 6955 | any_help_event_p = 1; |
| 6926 | gen_help_event (help_echo_string, frame, help_echo_window, | 6956 | gen_help_event (help_echo_string, frame, help_echo_window, |
| 6927 | help_echo_object, help_echo_pos); | 6957 | help_echo_object, help_echo_pos); |
| 6928 | } | 6958 | } |
| 6929 | else | 6959 | else |
| 6930 | { | 6960 | { |
| 6931 | help_echo_string = Qnil; | 6961 | help_echo_string = Qnil; |
| @@ -8241,7 +8271,7 @@ x_set_offset (f, xoff, yoff, change_gravity) | |||
| 8241 | f->win_gravity = NorthWestGravity; | 8271 | f->win_gravity = NorthWestGravity; |
| 8242 | } | 8272 | } |
| 8243 | x_calc_absolute_position (f); | 8273 | x_calc_absolute_position (f); |
| 8244 | 8274 | ||
| 8245 | BLOCK_INPUT; | 8275 | BLOCK_INPUT; |
| 8246 | x_wm_set_size_hint (f, (long) 0, 0); | 8276 | x_wm_set_size_hint (f, (long) 0, 0); |
| 8247 | 8277 | ||
| @@ -10365,7 +10395,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10365 | get_bits_and_offset (dpyinfo->visual->green_mask, | 10395 | get_bits_and_offset (dpyinfo->visual->green_mask, |
| 10366 | &dpyinfo->green_bits, &dpyinfo->green_offset); | 10396 | &dpyinfo->green_bits, &dpyinfo->green_offset); |
| 10367 | } | 10397 | } |
| 10368 | 10398 | ||
| 10369 | /* See if a private colormap is requested. */ | 10399 | /* See if a private colormap is requested. */ |
| 10370 | if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) | 10400 | if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) |
| 10371 | { | 10401 | { |
| @@ -10790,6 +10820,7 @@ x_initialize () | |||
| 10790 | x_noop_count = 0; | 10820 | x_noop_count = 0; |
| 10791 | last_tool_bar_item = -1; | 10821 | last_tool_bar_item = -1; |
| 10792 | any_help_event_p = 0; | 10822 | any_help_event_p = 0; |
| 10823 | ignore_next_mouse_click_timeout = 0; | ||
| 10793 | 10824 | ||
| 10794 | #ifdef USE_GTK | 10825 | #ifdef USE_GTK |
| 10795 | current_count = -1; | 10826 | current_count = -1; |
| @@ -10877,6 +10908,16 @@ UNDERLINE_POSITION font properties, for example 7x13 on XFree prior | |||
| 10877 | to 4.1, set this to nil. */); | 10908 | to 4.1, set this to nil. */); |
| 10878 | x_use_underline_position_properties = 1; | 10909 | x_use_underline_position_properties = 1; |
| 10879 | 10910 | ||
| 10911 | DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", | ||
| 10912 | &x_mouse_click_focus_ignore_position, | ||
| 10913 | doc: /* Non-nil means that a mouse click to focus a frame does not move point. | ||
| 10914 | This variable is only used when the window manager requires that you | ||
| 10915 | click on a frame to select it (give it focus). In that case, a value | ||
| 10916 | of nil, means that the selected window and cursor position changes to | ||
| 10917 | reflect the mouse click position, while a non-nil value means that the | ||
| 10918 | selected window or cursor position is preserved. */); | ||
| 10919 | x_mouse_click_focus_ignore_position = 0; | ||
| 10920 | |||
| 10880 | DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, | 10921 | DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, |
| 10881 | doc: /* What X toolkit scroll bars Emacs uses. | 10922 | doc: /* What X toolkit scroll bars Emacs uses. |
| 10882 | A value of nil means Emacs doesn't use X toolkit scroll bars. | 10923 | A value of nil means Emacs doesn't use X toolkit scroll bars. |