Mercurial > emacs
comparison src/lisp.h @ 85328:d0d527210b0c
* lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value.
(XMISCANY): New macro.
(XMISCTYPE): Use it.
(struct Lisp_Misc_Any): New type.
(union Lisp_Misc): Use it.
(struct Lisp_Buffer_Local_Value): Add `local_if_set' bit.
* data.c (Fboundp, store_symval_forwarding, swap_in_global_binding)
(find_symbol_value, set_internal, default_value, Fset_default)
(Fmake_variable_buffer_local, Fmake_local_variable)
(Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p)
(Flocal_variable_if_set_p, Fvariable_binding_locus):
The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set.
* alloc.c (allocate_buffer): Set the size and tag.
(allocate_misc, mark_maybe_object, mark_object, survives_gc_p):
Use XMISCANY.
(die): Follow the GNU convention for error messages.
* print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set.
* buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the
tag any more.
(set_buffer_internal_1):
* frame.c (store_frame_param):
* eval.c (specbind):
* xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 16 Oct 2007 15:42:58 +0000 |
parents | 2acb83e611e8 |
children | 35d2f0abc597 |
comparison
equal
deleted
inserted
replaced
85327:84eaa97c1d65 | 85328:d0d527210b0c |
---|---|
212 Lisp_Misc_Intfwd, | 212 Lisp_Misc_Intfwd, |
213 Lisp_Misc_Boolfwd, | 213 Lisp_Misc_Boolfwd, |
214 Lisp_Misc_Objfwd, | 214 Lisp_Misc_Objfwd, |
215 Lisp_Misc_Buffer_Objfwd, | 215 Lisp_Misc_Buffer_Objfwd, |
216 Lisp_Misc_Buffer_Local_Value, | 216 Lisp_Misc_Buffer_Local_Value, |
217 Lisp_Misc_Some_Buffer_Local_Value, | |
218 Lisp_Misc_Overlay, | 217 Lisp_Misc_Overlay, |
219 Lisp_Misc_Kboard_Objfwd, | 218 Lisp_Misc_Kboard_Objfwd, |
220 Lisp_Misc_Save_Value, | 219 Lisp_Misc_Save_Value, |
221 /* Currently floats are not a misc type, | 220 /* Currently floats are not a misc type, |
222 but let's define this in case we want to change that. */ | 221 but let's define this in case we want to change that. */ |
520 #define XFLOAT(a) (eassert (GC_FLOATP(a)),(struct Lisp_Float *) XPNTR(a)) | 519 #define XFLOAT(a) (eassert (GC_FLOATP(a)),(struct Lisp_Float *) XPNTR(a)) |
521 | 520 |
522 /* Misc types. */ | 521 /* Misc types. */ |
523 | 522 |
524 #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) | 523 #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) |
525 #define XMISCTYPE(a) (XMARKER (a)->type) | 524 #define XMISCANY(a) (&(XMISC(a)->u_any)) |
525 #define XMISCTYPE(a) (XMISCANY (a)->type) | |
526 #define XMARKER(a) (&(XMISC(a)->u_marker)) | 526 #define XMARKER(a) (&(XMISC(a)->u_marker)) |
527 #define XINTFWD(a) (&(XMISC(a)->u_intfwd)) | 527 #define XINTFWD(a) (&(XMISC(a)->u_intfwd)) |
528 #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) | 528 #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) |
529 #define XOBJFWD(a) (&(XMISC(a)->u_objfwd)) | 529 #define XOBJFWD(a) (&(XMISC(a)->u_objfwd)) |
530 #define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd)) | 530 #define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd)) |
1121 | 1121 |
1122 #define DEFAULT_REHASH_SIZE 1.5 | 1122 #define DEFAULT_REHASH_SIZE 1.5 |
1123 | 1123 |
1124 | 1124 |
1125 /* These structures are used for various misc types. */ | 1125 /* These structures are used for various misc types. */ |
1126 | |
1127 struct Lisp_Misc_Any /* Supertype of all Misc types. */ | |
1128 { | |
1129 int type : 16; /* = Lisp_Misc_Marker */ | |
1130 unsigned gcmarkbit : 1; | |
1131 int spacer : 15; | |
1132 }; | |
1126 | 1133 |
1127 struct Lisp_Marker | 1134 struct Lisp_Marker |
1128 { | 1135 { |
1129 int type : 16; /* = Lisp_Misc_Marker */ | 1136 int type : 16; /* = Lisp_Misc_Marker */ |
1130 unsigned gcmarkbit : 1; | 1137 unsigned gcmarkbit : 1; |
1222 the current buffer and selected frame, then load it. To load it, | 1229 the current buffer and selected frame, then load it. To load it, |
1223 first unload the previous binding, then copy the value of the new | 1230 first unload the previous binding, then copy the value of the new |
1224 binding into `realvalue' (or through it). Also update | 1231 binding into `realvalue' (or through it). Also update |
1225 LOADED-BINDING to point to the newly loaded binding. | 1232 LOADED-BINDING to point to the newly loaded binding. |
1226 | 1233 |
1227 Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value | 1234 `local_if_set' indicates that merely setting the variable creates a local |
1228 both use this kind of structure. With the former, merely setting | 1235 binding for the current buffer. Otherwise the latter, setting the |
1229 the variable creates a local binding for the current buffer. With | 1236 variable does not do that; only make-local-variable does that. */ |
1230 the latter, setting the variable does not do that; only | |
1231 make-local-variable does that. */ | |
1232 | 1237 |
1233 struct Lisp_Buffer_Local_Value | 1238 struct Lisp_Buffer_Local_Value |
1234 { | 1239 { |
1235 int type : 16; /* = Lisp_Misc_Buffer_Local_Value | 1240 int type : 16; /* = Lisp_Misc_Buffer_Local_Value */ |
1236 or Lisp_Misc_Some_Buffer_Local_Value */ | |
1237 unsigned gcmarkbit : 1; | 1241 unsigned gcmarkbit : 1; |
1238 int spacer : 12; | 1242 int spacer : 11; |
1239 | 1243 |
1244 /* 1 means that merely setting the variable creates a local | |
1245 binding for the current buffer */ | |
1246 unsigned int local_if_set : 1; | |
1240 /* 1 means this variable is allowed to have frame-local bindings, | 1247 /* 1 means this variable is allowed to have frame-local bindings, |
1241 so check for them when looking for the proper binding. */ | 1248 so check for them when looking for the proper binding. */ |
1242 unsigned int check_frame : 1; | 1249 unsigned int check_frame : 1; |
1243 /* 1 means that the binding now loaded was found | 1250 /* 1 means that the binding now loaded was found |
1244 as a local binding for the buffer in the `buffer' slot. */ | 1251 as a local binding for the buffer in the `buffer' slot. */ |
1324 /* To get the type field of a union Lisp_Misc, use XMISCTYPE. | 1331 /* To get the type field of a union Lisp_Misc, use XMISCTYPE. |
1325 It uses one of these struct subtypes to get the type field. */ | 1332 It uses one of these struct subtypes to get the type field. */ |
1326 | 1333 |
1327 union Lisp_Misc | 1334 union Lisp_Misc |
1328 { | 1335 { |
1329 struct Lisp_Free u_free; | 1336 struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ |
1337 struct Lisp_Free u_free; /* Includes padding to force alignment. */ | |
1330 struct Lisp_Marker u_marker; | 1338 struct Lisp_Marker u_marker; |
1331 struct Lisp_Intfwd u_intfwd; | 1339 struct Lisp_Intfwd u_intfwd; |
1332 struct Lisp_Boolfwd u_boolfwd; | 1340 struct Lisp_Boolfwd u_boolfwd; |
1333 struct Lisp_Objfwd u_objfwd; | 1341 struct Lisp_Objfwd u_objfwd; |
1334 struct Lisp_Buffer_Objfwd u_buffer_objfwd; | 1342 struct Lisp_Buffer_Objfwd u_buffer_objfwd; |