diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 66 |
1 files changed, 26 insertions, 40 deletions
diff --git a/src/buffer.c b/src/buffer.c index 238923a2ba0..e2f34d629e9 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -471,8 +471,8 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) | |||
| 471 | 471 | ||
| 472 | /* buffer-local Lisp variables start at `undo_list', | 472 | /* buffer-local Lisp variables start at `undo_list', |
| 473 | tho only the ones from `name' on are GC'd normally. */ | 473 | tho only the ones from `name' on are GC'd normally. */ |
| 474 | for (offset = PER_BUFFER_VAR_OFFSET (undo_list); | 474 | for (offset = PER_BUFFER_VAR_OFFSET (FIRST_FIELD_PER_BUFFER); |
| 475 | offset < sizeof *to; | 475 | offset <= PER_BUFFER_VAR_OFFSET (LAST_FIELD_PER_BUFFER); |
| 476 | offset += sizeof (Lisp_Object)) | 476 | offset += sizeof (Lisp_Object)) |
| 477 | { | 477 | { |
| 478 | Lisp_Object obj; | 478 | Lisp_Object obj; |
| @@ -830,8 +830,8 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too) | |||
| 830 | 830 | ||
| 831 | /* buffer-local Lisp variables start at `undo_list', | 831 | /* buffer-local Lisp variables start at `undo_list', |
| 832 | tho only the ones from `name' on are GC'd normally. */ | 832 | tho only the ones from `name' on are GC'd normally. */ |
| 833 | for (offset = PER_BUFFER_VAR_OFFSET (undo_list); | 833 | for (offset = PER_BUFFER_VAR_OFFSET (FIRST_FIELD_PER_BUFFER); |
| 834 | offset < sizeof *b; | 834 | offset <= PER_BUFFER_VAR_OFFSET (LAST_FIELD_PER_BUFFER); |
| 835 | offset += sizeof (Lisp_Object)) | 835 | offset += sizeof (Lisp_Object)) |
| 836 | { | 836 | { |
| 837 | int idx = PER_BUFFER_IDX (offset); | 837 | int idx = PER_BUFFER_IDX (offset); |
| @@ -1055,8 +1055,8 @@ No argument or nil as argument means use current buffer as BUFFER. */) | |||
| 1055 | 1055 | ||
| 1056 | /* buffer-local Lisp variables start at `undo_list', | 1056 | /* buffer-local Lisp variables start at `undo_list', |
| 1057 | tho only the ones from `name' on are GC'd normally. */ | 1057 | tho only the ones from `name' on are GC'd normally. */ |
| 1058 | for (offset = PER_BUFFER_VAR_OFFSET (undo_list); | 1058 | for (offset = PER_BUFFER_VAR_OFFSET (FIRST_FIELD_PER_BUFFER); |
| 1059 | offset < sizeof (struct buffer); | 1059 | offset <= PER_BUFFER_VAR_OFFSET (LAST_FIELD_PER_BUFFER); |
| 1060 | /* sizeof EMACS_INT == sizeof Lisp_Object */ | 1060 | /* sizeof EMACS_INT == sizeof Lisp_Object */ |
| 1061 | offset += (sizeof (EMACS_INT))) | 1061 | offset += (sizeof (EMACS_INT))) |
| 1062 | { | 1062 | { |
| @@ -4056,7 +4056,8 @@ DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0, | |||
| 4056 | } | 4056 | } |
| 4057 | 4057 | ||
| 4058 | DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, | 4058 | DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, |
| 4059 | doc: /* Set one property of overlay OVERLAY: give property PROP value VALUE. */) | 4059 | doc: /* Set one property of overlay OVERLAY: give property PROP value VALUE. |
| 4060 | VALUE will be returned.*/) | ||
| 4060 | (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) | 4061 | (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) |
| 4061 | { | 4062 | { |
| 4062 | Lisp_Object tail, buffer; | 4063 | Lisp_Object tail, buffer; |
| @@ -5209,39 +5210,26 @@ syms_of_buffer (void) | |||
| 5209 | staticpro (&Vbuffer_alist); | 5210 | staticpro (&Vbuffer_alist); |
| 5210 | staticpro (&Qprotected_field); | 5211 | staticpro (&Qprotected_field); |
| 5211 | staticpro (&Qpermanent_local); | 5212 | staticpro (&Qpermanent_local); |
| 5212 | Qpermanent_local_hook = intern_c_string ("permanent-local-hook"); | ||
| 5213 | staticpro (&Qpermanent_local_hook); | ||
| 5214 | staticpro (&Qkill_buffer_hook); | 5213 | staticpro (&Qkill_buffer_hook); |
| 5215 | Qoverlayp = intern_c_string ("overlayp"); | 5214 | |
| 5216 | staticpro (&Qoverlayp); | 5215 | DEFSYM (Qpermanent_local_hook, "permanent-local-hook"); |
| 5217 | Qevaporate = intern_c_string ("evaporate"); | 5216 | DEFSYM (Qoverlayp, "overlayp"); |
| 5218 | staticpro (&Qevaporate); | 5217 | DEFSYM (Qevaporate, "evaporate"); |
| 5219 | Qmodification_hooks = intern_c_string ("modification-hooks"); | 5218 | DEFSYM (Qmodification_hooks, "modification-hooks"); |
| 5220 | staticpro (&Qmodification_hooks); | 5219 | DEFSYM (Qinsert_in_front_hooks, "insert-in-front-hooks"); |
| 5221 | Qinsert_in_front_hooks = intern_c_string ("insert-in-front-hooks"); | 5220 | DEFSYM (Qinsert_behind_hooks, "insert-behind-hooks"); |
| 5222 | staticpro (&Qinsert_in_front_hooks); | 5221 | DEFSYM (Qget_file_buffer, "get-file-buffer"); |
| 5223 | Qinsert_behind_hooks = intern_c_string ("insert-behind-hooks"); | 5222 | DEFSYM (Qpriority, "priority"); |
| 5224 | staticpro (&Qinsert_behind_hooks); | 5223 | DEFSYM (Qbefore_string, "before-string"); |
| 5225 | Qget_file_buffer = intern_c_string ("get-file-buffer"); | 5224 | DEFSYM (Qafter_string, "after-string"); |
| 5226 | staticpro (&Qget_file_buffer); | 5225 | DEFSYM (Qfirst_change_hook, "first-change-hook"); |
| 5227 | Qpriority = intern_c_string ("priority"); | 5226 | DEFSYM (Qbefore_change_functions, "before-change-functions"); |
| 5228 | staticpro (&Qpriority); | 5227 | DEFSYM (Qafter_change_functions, "after-change-functions"); |
| 5229 | Qbefore_string = intern_c_string ("before-string"); | 5228 | DEFSYM (Qkill_buffer_query_functions, "kill-buffer-query-functions"); |
| 5230 | staticpro (&Qbefore_string); | 5229 | |
| 5231 | Qafter_string = intern_c_string ("after-string"); | ||
| 5232 | staticpro (&Qafter_string); | ||
| 5233 | Qfirst_change_hook = intern_c_string ("first-change-hook"); | ||
| 5234 | staticpro (&Qfirst_change_hook); | ||
| 5235 | Qbefore_change_functions = intern_c_string ("before-change-functions"); | ||
| 5236 | staticpro (&Qbefore_change_functions); | ||
| 5237 | Qafter_change_functions = intern_c_string ("after-change-functions"); | ||
| 5238 | staticpro (&Qafter_change_functions); | ||
| 5239 | /* The next one is initialized in init_buffer_once. */ | 5230 | /* The next one is initialized in init_buffer_once. */ |
| 5240 | staticpro (&Qucs_set_table_for_input); | 5231 | staticpro (&Qucs_set_table_for_input); |
| 5241 | 5232 | ||
| 5242 | Qkill_buffer_query_functions = intern_c_string ("kill-buffer-query-functions"); | ||
| 5243 | staticpro (&Qkill_buffer_query_functions); | ||
| 5244 | |||
| 5245 | Fput (Qprotected_field, Qerror_conditions, | 5233 | Fput (Qprotected_field, Qerror_conditions, |
| 5246 | pure_cons (Qprotected_field, pure_cons (Qerror, Qnil))); | 5234 | pure_cons (Qprotected_field, pure_cons (Qerror, Qnil))); |
| 5247 | Fput (Qprotected_field, Qerror_message, | 5235 | Fput (Qprotected_field, Qerror_message, |
| @@ -6035,8 +6023,7 @@ If any of them returns nil, the buffer is not killed. */); | |||
| 6035 | doc: /* Normal hook run before changing the major mode of a buffer. | 6023 | doc: /* Normal hook run before changing the major mode of a buffer. |
| 6036 | The function `kill-all-local-variables' runs this before doing anything else. */); | 6024 | The function `kill-all-local-variables' runs this before doing anything else. */); |
| 6037 | Vchange_major_mode_hook = Qnil; | 6025 | Vchange_major_mode_hook = Qnil; |
| 6038 | Qchange_major_mode_hook = intern_c_string ("change-major-mode-hook"); | 6026 | DEFSYM (Qchange_major_mode_hook, "change-major-mode-hook"); |
| 6039 | staticpro (&Qchange_major_mode_hook); | ||
| 6040 | 6027 | ||
| 6041 | DEFVAR_LISP ("buffer-list-update-hook", Vbuffer_list_update_hook, | 6028 | DEFVAR_LISP ("buffer-list-update-hook", Vbuffer_list_update_hook, |
| 6042 | doc: /* Hook run when the buffer list changes. | 6029 | doc: /* Hook run when the buffer list changes. |
| @@ -6044,8 +6031,7 @@ Functions running this hook are `get-buffer-create', | |||
| 6044 | `make-indirect-buffer', `rename-buffer', `kill-buffer', | 6031 | `make-indirect-buffer', `rename-buffer', `kill-buffer', |
| 6045 | `record-buffer' and `unrecord-buffer'. */); | 6032 | `record-buffer' and `unrecord-buffer'. */); |
| 6046 | Vbuffer_list_update_hook = Qnil; | 6033 | Vbuffer_list_update_hook = Qnil; |
| 6047 | Qbuffer_list_update_hook = intern_c_string ("buffer-list-update-hook"); | 6034 | DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook"); |
| 6048 | staticpro (&Qbuffer_list_update_hook); | ||
| 6049 | 6035 | ||
| 6050 | defsubr (&Sbuffer_live_p); | 6036 | defsubr (&Sbuffer_live_p); |
| 6051 | defsubr (&Sbuffer_list); | 6037 | defsubr (&Sbuffer_list); |