Mercurial > emacs
comparison src/data.c @ 20996:b52e351a40fa
(store_symval_forwarding) <Lisp_Misc_Buffer_Objfwd>:
If buffer_local_types has -1, this variable is read-only.
(Fset_default) <BUFFER_OBJFWDP>:
Unconditionally set the slot in buffer_defaults.
| author | Karl Heuer <kwzh@gnu.org> |
|---|---|
| date | Fri, 27 Feb 1998 21:56:28 +0000 |
| parents | 4b85e02aae14 |
| children | 6988880cc529 |
comparison
equal
deleted
inserted
replaced
| 20995:abc60038dd2b | 20996:b52e351a40fa |
|---|---|
| 782 { | 782 { |
| 783 int offset = XBUFFER_OBJFWD (valcontents)->offset; | 783 int offset = XBUFFER_OBJFWD (valcontents)->offset; |
| 784 Lisp_Object type; | 784 Lisp_Object type; |
| 785 | 785 |
| 786 type = *(Lisp_Object *)(offset + (char *)&buffer_local_types); | 786 type = *(Lisp_Object *)(offset + (char *)&buffer_local_types); |
| 787 if (XINT (type) == -1) | |
| 788 error ("Variable %s is read-only", XSYMBOL (symbol)->name->data); | |
| 789 | |
| 787 if (! NILP (type) && ! NILP (newval) | 790 if (! NILP (type) && ! NILP (newval) |
| 788 && XTYPE (newval) != XINT (type)) | 791 && XTYPE (newval) != XINT (type)) |
| 789 buffer_slot_type_mismatch (offset); | 792 buffer_slot_type_mismatch (offset); |
| 790 | 793 |
| 791 *(Lisp_Object *)(offset + (char *)current_buffer) = newval; | 794 *(Lisp_Object *)(offset + (char *)current_buffer) = newval; |
| 1144 register int idx = XBUFFER_OBJFWD (valcontents)->offset; | 1147 register int idx = XBUFFER_OBJFWD (valcontents)->offset; |
| 1145 register struct buffer *b; | 1148 register struct buffer *b; |
| 1146 register int mask = XINT (*((Lisp_Object *) | 1149 register int mask = XINT (*((Lisp_Object *) |
| 1147 (idx + (char *)&buffer_local_flags))); | 1150 (idx + (char *)&buffer_local_flags))); |
| 1148 | 1151 |
| 1152 *(Lisp_Object *)(idx + (char *) &buffer_defaults) = value; | |
| 1153 | |
| 1154 /* If this variable is not always local in all buffers, | |
| 1155 set it in the buffers that don't nominally have a local value. */ | |
| 1149 if (mask > 0) | 1156 if (mask > 0) |
| 1150 { | 1157 { |
| 1151 *(Lisp_Object *)(idx + (char *) &buffer_defaults) = value; | |
| 1152 for (b = all_buffers; b; b = b->next) | 1158 for (b = all_buffers; b; b = b->next) |
| 1153 if (!(b->local_var_flags & mask)) | 1159 if (!(b->local_var_flags & mask)) |
| 1154 *(Lisp_Object *)(idx + (char *) b) = value; | 1160 *(Lisp_Object *)(idx + (char *) b) = value; |
| 1155 } | 1161 } |
| 1156 return value; | 1162 return value; |
