diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/buffer.c b/src/buffer.c index 045a22c8e31..675992db316 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -99,17 +99,6 @@ DECL_ALIGN (struct buffer, buffer_local_symbols); | |||
| 99 | /* A Lisp_Object pointer to the above, used for staticpro */ | 99 | /* A Lisp_Object pointer to the above, used for staticpro */ |
| 100 | static Lisp_Object Vbuffer_local_symbols; | 100 | static Lisp_Object Vbuffer_local_symbols; |
| 101 | 101 | ||
| 102 | /* This structure holds the required types for the values in the | ||
| 103 | buffer-local slots. If a slot contains Qnil, then the | ||
| 104 | corresponding buffer slot may contain a value of any type. If a | ||
| 105 | slot contains an integer, then prospective values' tags must be | ||
| 106 | equal to that integer (except nil is always allowed). | ||
| 107 | When a tag does not match, the function | ||
| 108 | buffer_slot_type_mismatch will signal an error. | ||
| 109 | |||
| 110 | If a slot here contains -1, the corresponding variable is read-only. */ | ||
| 111 | struct buffer buffer_local_types; | ||
| 112 | |||
| 113 | /* Flags indicating which built-in buffer-local variables | 102 | /* Flags indicating which built-in buffer-local variables |
| 114 | are permanent locals. */ | 103 | are permanent locals. */ |
| 115 | static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS]; | 104 | static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS]; |
| @@ -4402,13 +4391,13 @@ evaporate_overlays (pos) | |||
| 4402 | in the slot with offset OFFSET. */ | 4391 | in the slot with offset OFFSET. */ |
| 4403 | 4392 | ||
| 4404 | void | 4393 | void |
| 4405 | buffer_slot_type_mismatch (offset) | 4394 | buffer_slot_type_mismatch (sym, type) |
| 4406 | int offset; | 4395 | Lisp_Object sym; |
| 4396 | int type; | ||
| 4407 | { | 4397 | { |
| 4408 | Lisp_Object sym; | ||
| 4409 | char *type_name; | 4398 | char *type_name; |
| 4410 | 4399 | ||
| 4411 | switch (XINT (PER_BUFFER_TYPE (offset))) | 4400 | switch (type) |
| 4412 | { | 4401 | { |
| 4413 | case Lisp_Int: | 4402 | case Lisp_Int: |
| 4414 | type_name = "integers"; | 4403 | type_name = "integers"; |
| @@ -4426,7 +4415,6 @@ buffer_slot_type_mismatch (offset) | |||
| 4426 | abort (); | 4415 | abort (); |
| 4427 | } | 4416 | } |
| 4428 | 4417 | ||
| 4429 | sym = PER_BUFFER_SYMBOL (offset); | ||
| 4430 | error ("Only %s should be stored in the buffer-local variable %s", | 4418 | error ("Only %s should be stored in the buffer-local variable %s", |
| 4431 | type_name, SDATA (SYMBOL_NAME (sym))); | 4419 | type_name, SDATA (SYMBOL_NAME (sym))); |
| 4432 | } | 4420 | } |
| @@ -5274,9 +5262,9 @@ defvar_per_buffer (namestring, address, type, doc) | |||
| 5274 | 5262 | ||
| 5275 | XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; | 5263 | XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; |
| 5276 | XBUFFER_OBJFWD (val)->offset = offset; | 5264 | XBUFFER_OBJFWD (val)->offset = offset; |
| 5265 | XBUFFER_OBJFWD (val)->slottype = type; | ||
| 5277 | SET_SYMBOL_VALUE (sym, val); | 5266 | SET_SYMBOL_VALUE (sym, val); |
| 5278 | PER_BUFFER_SYMBOL (offset) = sym; | 5267 | PER_BUFFER_SYMBOL (offset) = sym; |
| 5279 | PER_BUFFER_TYPE (offset) = type; | ||
| 5280 | 5268 | ||
| 5281 | if (PER_BUFFER_IDX (offset) == 0) | 5269 | if (PER_BUFFER_IDX (offset) == 0) |
| 5282 | /* Did a DEFVAR_PER_BUFFER without initializing the corresponding | 5270 | /* Did a DEFVAR_PER_BUFFER without initializing the corresponding |