aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorTom Tromey2012-08-20 07:34:41 -0600
committerTom Tromey2012-08-20 07:34:41 -0600
commit49bc1a9dfc6e81a370bf12157c3c573743ee200a (patch)
tree24df8b040aff367adc11a2c676334ec238651e1d /src/buffer.c
parentb94de893429bbfbb27572c8c3118fcc876957adb (diff)
parenta05731a0cc2553af0469bd9b7d6ac10cd2e6a817 (diff)
downloademacs-49bc1a9dfc6e81a370bf12157c3c573743ee200a.tar.gz
emacs-49bc1a9dfc6e81a370bf12157c3c573743ee200a.zip
Merge from trunk
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c593
1 files changed, 416 insertions, 177 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 7fb1029a314..6f748158e21 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -155,6 +155,228 @@ static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay
155static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); 155static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t);
156static Lisp_Object buffer_lisp_local_variables (struct buffer *, int); 156static Lisp_Object buffer_lisp_local_variables (struct buffer *, int);
157 157
158/* These setters are used only in this file, so they can be private. */
159static inline void
160bset_abbrev_mode (struct buffer *b, Lisp_Object val)
161{
162 b->INTERNAL_FIELD (abbrev_mode) = val;
163}
164static inline void
165bset_abbrev_table (struct buffer *b, Lisp_Object val)
166{
167 b->INTERNAL_FIELD (abbrev_table) = val;
168}
169static inline void
170bset_auto_fill_function (struct buffer *b, Lisp_Object val)
171{
172 b->INTERNAL_FIELD (auto_fill_function) = val;
173}
174static inline void
175bset_auto_save_file_format (struct buffer *b, Lisp_Object val)
176{
177 b->INTERNAL_FIELD (auto_save_file_format) = val;
178}
179static inline void
180bset_auto_save_file_name (struct buffer *b, Lisp_Object val)
181{
182 b->INTERNAL_FIELD (auto_save_file_name) = val;
183}
184static inline void
185bset_backed_up (struct buffer *b, Lisp_Object val)
186{
187 b->INTERNAL_FIELD (backed_up) = val;
188}
189static inline void
190bset_begv_marker (struct buffer *b, Lisp_Object val)
191{
192 b->INTERNAL_FIELD (begv_marker) = val;
193}
194static inline void
195bset_bidi_display_reordering (struct buffer *b, Lisp_Object val)
196{
197 b->INTERNAL_FIELD (bidi_display_reordering) = val;
198}
199static inline void
200bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val)
201{
202 b->INTERNAL_FIELD (buffer_file_coding_system) = val;
203}
204static inline void
205bset_cache_long_line_scans (struct buffer *b, Lisp_Object val)
206{
207 b->INTERNAL_FIELD (cache_long_line_scans) = val;
208}
209static inline void
210bset_case_fold_search (struct buffer *b, Lisp_Object val)
211{
212 b->INTERNAL_FIELD (case_fold_search) = val;
213}
214static inline void
215bset_ctl_arrow (struct buffer *b, Lisp_Object val)
216{
217 b->INTERNAL_FIELD (ctl_arrow) = val;
218}
219static inline void
220bset_cursor_in_non_selected_windows (struct buffer *b, Lisp_Object val)
221{
222 b->INTERNAL_FIELD (cursor_in_non_selected_windows) = val;
223}
224static inline void
225bset_cursor_type (struct buffer *b, Lisp_Object val)
226{
227 b->INTERNAL_FIELD (cursor_type) = val;
228}
229static inline void
230bset_display_table (struct buffer *b, Lisp_Object val)
231{
232 b->INTERNAL_FIELD (display_table) = val;
233}
234static inline void
235bset_extra_line_spacing (struct buffer *b, Lisp_Object val)
236{
237 b->INTERNAL_FIELD (extra_line_spacing) = val;
238}
239static inline void
240bset_file_format (struct buffer *b, Lisp_Object val)
241{
242 b->INTERNAL_FIELD (file_format) = val;
243}
244static inline void
245bset_file_truename (struct buffer *b, Lisp_Object val)
246{
247 b->INTERNAL_FIELD (file_truename) = val;
248}
249static inline void
250bset_fringe_cursor_alist (struct buffer *b, Lisp_Object val)
251{
252 b->INTERNAL_FIELD (fringe_cursor_alist) = val;
253}
254static inline void
255bset_fringe_indicator_alist (struct buffer *b, Lisp_Object val)
256{
257 b->INTERNAL_FIELD (fringe_indicator_alist) = val;
258}
259static inline void
260bset_fringes_outside_margins (struct buffer *b, Lisp_Object val)
261{
262 b->INTERNAL_FIELD (fringes_outside_margins) = val;
263}
264static inline void
265bset_header_line_format (struct buffer *b, Lisp_Object val)
266{
267 b->INTERNAL_FIELD (header_line_format) = val;
268}
269static inline void
270bset_indicate_buffer_boundaries (struct buffer *b, Lisp_Object val)
271{
272 b->INTERNAL_FIELD (indicate_buffer_boundaries) = val;
273}
274static inline void
275bset_indicate_empty_lines (struct buffer *b, Lisp_Object val)
276{
277 b->INTERNAL_FIELD (indicate_empty_lines) = val;
278}
279static inline void
280bset_invisibility_spec (struct buffer *b, Lisp_Object val)
281{
282 b->INTERNAL_FIELD (invisibility_spec) = val;
283}
284static inline void
285bset_left_fringe_width (struct buffer *b, Lisp_Object val)
286{
287 b->INTERNAL_FIELD (left_fringe_width) = val;
288}
289static inline void
290bset_major_mode (struct buffer *b, Lisp_Object val)
291{
292 b->INTERNAL_FIELD (major_mode) = val;
293}
294static inline void
295bset_mark (struct buffer *b, Lisp_Object val)
296{
297 b->INTERNAL_FIELD (mark) = val;
298}
299static inline void
300bset_minor_modes (struct buffer *b, Lisp_Object val)
301{
302 b->INTERNAL_FIELD (minor_modes) = val;
303}
304static inline void
305bset_mode_line_format (struct buffer *b, Lisp_Object val)
306{
307 b->INTERNAL_FIELD (mode_line_format) = val;
308}
309static inline void
310bset_mode_name (struct buffer *b, Lisp_Object val)
311{
312 b->INTERNAL_FIELD (mode_name) = val;
313}
314static inline void
315bset_name (struct buffer *b, Lisp_Object val)
316{
317 b->INTERNAL_FIELD (name) = val;
318}
319static inline void
320bset_overwrite_mode (struct buffer *b, Lisp_Object val)
321{
322 b->INTERNAL_FIELD (overwrite_mode) = val;
323}
324static inline void
325bset_pt_marker (struct buffer *b, Lisp_Object val)
326{
327 b->INTERNAL_FIELD (pt_marker) = val;
328}
329static inline void
330bset_right_fringe_width (struct buffer *b, Lisp_Object val)
331{
332 b->INTERNAL_FIELD (right_fringe_width) = val;
333}
334static inline void
335bset_save_length (struct buffer *b, Lisp_Object val)
336{
337 b->INTERNAL_FIELD (save_length) = val;
338}
339static inline void
340bset_scroll_bar_width (struct buffer *b, Lisp_Object val)
341{
342 b->INTERNAL_FIELD (scroll_bar_width) = val;
343}
344static inline void
345bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val)
346{
347 b->INTERNAL_FIELD (scroll_down_aggressively) = val;
348}
349static inline void
350bset_scroll_up_aggressively (struct buffer *b, Lisp_Object val)
351{
352 b->INTERNAL_FIELD (scroll_up_aggressively) = val;
353}
354static inline void
355bset_selective_display (struct buffer *b, Lisp_Object val)
356{
357 b->INTERNAL_FIELD (selective_display) = val;
358}
359static inline void
360bset_selective_display_ellipses (struct buffer *b, Lisp_Object val)
361{
362 b->INTERNAL_FIELD (selective_display_ellipses) = val;
363}
364static inline void
365bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val)
366{
367 b->INTERNAL_FIELD (vertical_scroll_bar_type) = val;
368}
369static inline void
370bset_word_wrap (struct buffer *b, Lisp_Object val)
371{
372 b->INTERNAL_FIELD (word_wrap) = val;
373}
374static inline void
375bset_zv_marker (struct buffer *b, Lisp_Object val)
376{
377 b->INTERNAL_FIELD (zv_marker) = val;
378}
379
158/* For debugging; temporary. See set_buffer_internal. */ 380/* For debugging; temporary. See set_buffer_internal. */
159/* Lisp_Object Qlisp_mode, Vcheck_symbol; */ 381/* Lisp_Object Qlisp_mode, Vcheck_symbol; */
160 382
@@ -358,7 +580,7 @@ even if it is dead. The return value is never nil. */)
358 BUF_CHARS_MODIFF (b) = 1; 580 BUF_CHARS_MODIFF (b) = 1;
359 BUF_OVERLAY_MODIFF (b) = 1; 581 BUF_OVERLAY_MODIFF (b) = 1;
360 BUF_SAVE_MODIFF (b) = 1; 582 BUF_SAVE_MODIFF (b) = 1;
361 buffer_set_intervals (b, NULL); 583 set_buffer_intervals (b, NULL);
362 BUF_UNCHANGED_MODIFIED (b) = 1; 584 BUF_UNCHANGED_MODIFIED (b) = 1;
363 BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; 585 BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1;
364 BUF_END_UNCHANGED (b) = 0; 586 BUF_END_UNCHANGED (b) = 0;
@@ -368,7 +590,7 @@ even if it is dead. The return value is never nil. */)
368 590
369 b->newline_cache = 0; 591 b->newline_cache = 0;
370 b->width_run_cache = 0; 592 b->width_run_cache = 0;
371 BSET (b, width_table, Qnil); 593 bset_width_table (b, Qnil);
372 b->prevent_redisplay_optimizations_p = 1; 594 b->prevent_redisplay_optimizations_p = 1;
373 595
374 /* Put this on the chain of all buffers including killed ones. */ 596 /* Put this on the chain of all buffers including killed ones. */
@@ -377,20 +599,20 @@ even if it is dead. The return value is never nil. */)
377 599
378 /* An ordinary buffer normally doesn't need markers 600 /* An ordinary buffer normally doesn't need markers
379 to handle BEGV and ZV. */ 601 to handle BEGV and ZV. */
380 BSET (b, pt_marker, Qnil); 602 bset_pt_marker (b, Qnil);
381 BSET (b, begv_marker, Qnil); 603 bset_begv_marker (b, Qnil);
382 BSET (b, zv_marker, Qnil); 604 bset_zv_marker (b, Qnil);
383 605
384 name = Fcopy_sequence (buffer_or_name); 606 name = Fcopy_sequence (buffer_or_name);
385 string_set_intervals (name, NULL); 607 set_string_intervals (name, NULL);
386 BSET (b, name, name); 608 bset_name (b, name);
387 609
388 BSET (b, undo_list, (SREF (name, 0) != ' ') ? Qnil : Qt); 610 bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt);
389 611
390 reset_buffer (b); 612 reset_buffer (b);
391 reset_buffer_local_variables (b, 1); 613 reset_buffer_local_variables (b, 1);
392 614
393 BSET (b, mark, Fmake_marker ()); 615 bset_mark (b, Fmake_marker ());
394 BUF_MARKERS (b) = NULL; 616 BUF_MARKERS (b) = NULL;
395 617
396 /* Put this in the alist of all live buffers. */ 618 /* Put this in the alist of all live buffers. */
@@ -437,6 +659,19 @@ copy_overlays (struct buffer *b, struct Lisp_Overlay *list)
437 return result; 659 return result;
438} 660}
439 661
662/* Set an appropriate overlay of B. */
663
664static inline void
665set_buffer_overlays_before (struct buffer *b, struct Lisp_Overlay *o)
666{
667 b->overlays_before = o;
668}
669
670static inline void
671set_buffer_overlays_after (struct buffer *b, struct Lisp_Overlay *o)
672{
673 b->overlays_after = o;
674}
440 675
441/* Clone per-buffer values of buffer FROM. 676/* Clone per-buffer values of buffer FROM.
442 677
@@ -458,7 +693,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
458 if (offset == PER_BUFFER_VAR_OFFSET (name)) 693 if (offset == PER_BUFFER_VAR_OFFSET (name))
459 continue; 694 continue;
460 695
461 obj = PER_BUFFER_VALUE (from, offset); 696 obj = per_buffer_value (from, offset);
462 if (MARKERP (obj) && XMARKER (obj)->buffer == from) 697 if (MARKERP (obj) && XMARKER (obj)->buffer == from)
463 { 698 {
464 struct Lisp_Marker *m = XMARKER (obj); 699 struct Lisp_Marker *m = XMARKER (obj);
@@ -467,17 +702,17 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
467 XMARKER (obj)->insertion_type = m->insertion_type; 702 XMARKER (obj)->insertion_type = m->insertion_type;
468 } 703 }
469 704
470 PER_BUFFER_VALUE (to, offset) = obj; 705 set_per_buffer_value (to, offset, obj);
471 } 706 }
472 707
473 memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); 708 memcpy (to->local_flags, from->local_flags, sizeof to->local_flags);
474 709
475 buffer_set_overlays_before (to, copy_overlays (to, from->overlays_before)); 710 set_buffer_overlays_before (to, copy_overlays (to, from->overlays_before));
476 buffer_set_overlays_after (to, copy_overlays (to, from->overlays_after)); 711 set_buffer_overlays_after (to, copy_overlays (to, from->overlays_after));
477 712
478 /* Get (a copy of) the alist of Lisp-level local variables of FROM 713 /* Get (a copy of) the alist of Lisp-level local variables of FROM
479 and install that in TO. */ 714 and install that in TO. */
480 BSET (to, local_var_alist, buffer_lisp_local_variables (from, 1)); 715 bset_local_var_alist (to, buffer_lisp_local_variables (from, 1));
481} 716}
482 717
483 718
@@ -580,15 +815,15 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
580 815
581 b->newline_cache = 0; 816 b->newline_cache = 0;
582 b->width_run_cache = 0; 817 b->width_run_cache = 0;
583 BSET (b, width_table, Qnil); 818 bset_width_table (b, Qnil);
584 819
585 /* Put this on the chain of all buffers including killed ones. */ 820 /* Put this on the chain of all buffers including killed ones. */
586 b->header.next.buffer = all_buffers; 821 b->header.next.buffer = all_buffers;
587 all_buffers = b; 822 all_buffers = b;
588 823
589 name = Fcopy_sequence (name); 824 name = Fcopy_sequence (name);
590 string_set_intervals (name, NULL); 825 set_string_intervals (name, NULL);
591 BSET (b, name, name); 826 bset_name (b, name);
592 827
593 reset_buffer (b); 828 reset_buffer (b);
594 reset_buffer_local_variables (b, 1); 829 reset_buffer_local_variables (b, 1);
@@ -597,10 +832,11 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
597 XSETBUFFER (buf, b); 832 XSETBUFFER (buf, b);
598 Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); 833 Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
599 834
600 BSET (b, mark, Fmake_marker ()); 835 bset_mark (b, Fmake_marker ());
601 836
602 /* The multibyte status belongs to the base buffer. */ 837 /* The multibyte status belongs to the base buffer. */
603 BSET (b, enable_multibyte_characters, BVAR (b->base_buffer, enable_multibyte_characters)); 838 bset_enable_multibyte_characters
839 (b, BVAR (b->base_buffer, enable_multibyte_characters));
604 840
605 /* Make sure the base buffer has markers for its narrowing. */ 841 /* Make sure the base buffer has markers for its narrowing. */
606 if (NILP (BVAR (b->base_buffer, pt_marker))) 842 if (NILP (BVAR (b->base_buffer, pt_marker)))
@@ -608,14 +844,17 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
608 eassert (NILP (BVAR (b->base_buffer, begv_marker))); 844 eassert (NILP (BVAR (b->base_buffer, begv_marker)));
609 eassert (NILP (BVAR (b->base_buffer, zv_marker))); 845 eassert (NILP (BVAR (b->base_buffer, zv_marker)));
610 846
611 BSET (b->base_buffer, pt_marker, 847 bset_pt_marker (b->base_buffer,
612 build_marker (b->base_buffer, b->base_buffer->pt, b->base_buffer->pt_byte)); 848 build_marker (b->base_buffer, b->base_buffer->pt,
849 b->base_buffer->pt_byte));
613 850
614 BSET (b->base_buffer, begv_marker, 851 bset_begv_marker (b->base_buffer,
615 build_marker (b->base_buffer, b->base_buffer->begv, b->base_buffer->begv_byte)); 852 build_marker (b->base_buffer, b->base_buffer->begv,
853 b->base_buffer->begv_byte));
616 854
617 BSET (b->base_buffer, zv_marker, 855 bset_zv_marker (b->base_buffer,
618 build_marker (b->base_buffer, b->base_buffer->zv, b->base_buffer->zv_byte)); 856 build_marker (b->base_buffer, b->base_buffer->zv,
857 b->base_buffer->zv_byte));
619 858
620 XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1; 859 XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1;
621 } 860 }
@@ -623,9 +862,9 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
623 if (NILP (clone)) 862 if (NILP (clone))
624 { 863 {
625 /* Give the indirect buffer markers for its narrowing. */ 864 /* Give the indirect buffer markers for its narrowing. */
626 BSET (b, pt_marker, build_marker (b, b->pt, b->pt_byte)); 865 bset_pt_marker (b, build_marker (b, b->pt, b->pt_byte));
627 BSET (b, begv_marker, build_marker (b, b->begv, b->begv_byte)); 866 bset_begv_marker (b, build_marker (b, b->begv, b->begv_byte));
628 BSET (b, zv_marker, build_marker (b, b->zv, b->zv_byte)); 867 bset_zv_marker (b, build_marker (b, b->zv, b->zv_byte));
629 XMARKER (BVAR (b, zv_marker))->insertion_type = 1; 868 XMARKER (BVAR (b, zv_marker))->insertion_type = 1;
630 } 869 }
631 else 870 else
@@ -633,11 +872,11 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
633 struct buffer *old_b = current_buffer; 872 struct buffer *old_b = current_buffer;
634 873
635 clone_per_buffer_values (b->base_buffer, b); 874 clone_per_buffer_values (b->base_buffer, b);
636 BSET (b, filename, Qnil); 875 bset_filename (b, Qnil);
637 BSET (b, file_truename, Qnil); 876 bset_file_truename (b, Qnil);
638 BSET (b, display_count, make_number (0)); 877 bset_display_count (b, make_number (0));
639 BSET (b, backed_up, Qnil); 878 bset_backed_up (b, Qnil);
640 BSET (b, auto_save_file_name, Qnil); 879 bset_auto_save_file_name (b, Qnil);
641 set_buffer_internal_1 (b); 880 set_buffer_internal_1 (b);
642 Fset (intern ("buffer-save-without-query"), Qnil); 881 Fset (intern ("buffer-save-without-query"), Qnil);
643 Fset (intern ("buffer-file-number"), Qnil); 882 Fset (intern ("buffer-file-number"), Qnil);
@@ -686,8 +925,8 @@ delete_all_overlays (struct buffer *b)
686 ov->next = NULL; 925 ov->next = NULL;
687 } 926 }
688 927
689 buffer_set_overlays_before (b, NULL); 928 set_buffer_overlays_before (b, NULL);
690 buffer_set_overlays_after (b, NULL); 929 set_buffer_overlays_after (b, NULL);
691} 930}
692 931
693/* Reinitialize everything about a buffer except its name and contents 932/* Reinitialize everything about a buffer except its name and contents
@@ -700,10 +939,9 @@ delete_all_overlays (struct buffer *b)
700void 939void
701reset_buffer (register struct buffer *b) 940reset_buffer (register struct buffer *b)
702{ 941{
703 BSET (b, filename, Qnil); 942 bset_filename (b, Qnil);
704 BSET (b, file_truename, Qnil); 943 bset_file_truename (b, Qnil);
705 BSET (b, directory, 944 bset_directory (b, current_buffer ? BVAR (current_buffer, directory) : Qnil);
706 (current_buffer) ? BVAR (current_buffer, directory) : Qnil);
707 b->modtime = make_emacs_time (0, UNKNOWN_MODTIME_NSECS); 945 b->modtime = make_emacs_time (0, UNKNOWN_MODTIME_NSECS);
708 b->modtime_size = -1; 946 b->modtime_size = -1;
709 XSETFASTINT (BVAR (b, save_length), 0); 947 XSETFASTINT (BVAR (b, save_length), 0);
@@ -711,25 +949,25 @@ reset_buffer (register struct buffer *b)
711 /* It is more conservative to start out "changed" than "unchanged". */ 949 /* It is more conservative to start out "changed" than "unchanged". */
712 b->clip_changed = 0; 950 b->clip_changed = 0;
713 b->prevent_redisplay_optimizations_p = 1; 951 b->prevent_redisplay_optimizations_p = 1;
714 BSET (b, backed_up, Qnil); 952 bset_backed_up (b, Qnil);
715 BUF_AUTOSAVE_MODIFF (b) = 0; 953 BUF_AUTOSAVE_MODIFF (b) = 0;
716 b->auto_save_failure_time = 0; 954 b->auto_save_failure_time = 0;
717 BSET (b, auto_save_file_name, Qnil); 955 bset_auto_save_file_name (b, Qnil);
718 BSET (b, read_only, Qnil); 956 bset_read_only (b, Qnil);
719 buffer_set_overlays_before (b, NULL); 957 set_buffer_overlays_before (b, NULL);
720 buffer_set_overlays_after (b, NULL); 958 set_buffer_overlays_after (b, NULL);
721 b->overlay_center = BEG; 959 b->overlay_center = BEG;
722 BSET (b, mark_active, Qnil); 960 bset_mark_active (b, Qnil);
723 BSET (b, point_before_scroll, Qnil); 961 bset_point_before_scroll (b, Qnil);
724 BSET (b, file_format, Qnil); 962 bset_file_format (b, Qnil);
725 BSET (b, auto_save_file_format, Qt); 963 bset_auto_save_file_format (b, Qt);
726 BSET (b, last_selected_window, Qnil); 964 bset_last_selected_window (b, Qnil);
727 BSET (b, display_count, make_number (0)); 965 bset_display_count (b, make_number (0));
728 BSET (b, display_time, Qnil); 966 bset_display_time (b, Qnil);
729 BSET (b, enable_multibyte_characters, 967 bset_enable_multibyte_characters
730 BVAR (&buffer_defaults, enable_multibyte_characters)); 968 (b, BVAR (&buffer_defaults, enable_multibyte_characters));
731 BSET (b, cursor_type, BVAR (&buffer_defaults, cursor_type)); 969 bset_cursor_type (b, BVAR (&buffer_defaults, cursor_type));
732 BSET (b, extra_line_spacing, BVAR (&buffer_defaults, extra_line_spacing)); 970 bset_extra_line_spacing (b, BVAR (&buffer_defaults, extra_line_spacing));
733 971
734 b->display_error_modiff = 0; 972 b->display_error_modiff = 0;
735} 973}
@@ -753,10 +991,10 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
753 things that depend on the major mode. 991 things that depend on the major mode.
754 default-major-mode is handled at a higher level. 992 default-major-mode is handled at a higher level.
755 We ignore it here. */ 993 We ignore it here. */
756 BSET (b, major_mode, Qfundamental_mode); 994 bset_major_mode (b, Qfundamental_mode);
757 BSET (b, keymap, Qnil); 995 bset_keymap (b, Qnil);
758 BSET (b, mode_name, QSFundamental); 996 bset_mode_name (b, QSFundamental);
759 BSET (b, minor_modes, Qnil); 997 bset_minor_modes (b, Qnil);
760 998
761 /* If the standard case table has been altered and invalidated, 999 /* If the standard case table has been altered and invalidated,
762 fix up its insides first. */ 1000 fix up its insides first. */
@@ -765,15 +1003,15 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
765 && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2]))) 1003 && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2])))
766 Fset_standard_case_table (Vascii_downcase_table); 1004 Fset_standard_case_table (Vascii_downcase_table);
767 1005
768 BSET (b, downcase_table, Vascii_downcase_table); 1006 bset_downcase_table (b, Vascii_downcase_table);
769 BSET (b, upcase_table, XCHAR_TABLE (Vascii_downcase_table)->extras[0]); 1007 bset_upcase_table (b, XCHAR_TABLE (Vascii_downcase_table)->extras[0]);
770 BSET (b, case_canon_table, XCHAR_TABLE (Vascii_downcase_table)->extras[1]); 1008 bset_case_canon_table (b, XCHAR_TABLE (Vascii_downcase_table)->extras[1]);
771 BSET (b, case_eqv_table, XCHAR_TABLE (Vascii_downcase_table)->extras[2]); 1009 bset_case_eqv_table (b, XCHAR_TABLE (Vascii_downcase_table)->extras[2]);
772 BSET (b, invisibility_spec, Qt); 1010 bset_invisibility_spec (b, Qt);
773 1011
774 /* Reset all (or most) per-buffer variables to their defaults. */ 1012 /* Reset all (or most) per-buffer variables to their defaults. */
775 if (permanent_too) 1013 if (permanent_too)
776 BSET (b, local_var_alist, Qnil); 1014 bset_local_var_alist (b, Qnil);
777 else 1015 else
778 { 1016 {
779 Lisp_Object tmp, prop, last = Qnil; 1017 Lisp_Object tmp, prop, last = Qnil;
@@ -807,7 +1045,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
807 } 1045 }
808 /* Delete this local variable. */ 1046 /* Delete this local variable. */
809 else if (NILP (last)) 1047 else if (NILP (last))
810 BSET (b, local_var_alist, XCDR (tmp)); 1048 bset_local_var_alist (b, XCDR (tmp));
811 else 1049 else
812 XSETCDR (last, XCDR (tmp)); 1050 XSETCDR (last, XCDR (tmp));
813 } 1051 }
@@ -823,7 +1061,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
823 if ((idx > 0 1061 if ((idx > 0
824 && (permanent_too 1062 && (permanent_too
825 || buffer_permanent_local_flags[idx] == 0))) 1063 || buffer_permanent_local_flags[idx] == 0)))
826 PER_BUFFER_VALUE (b, offset) = PER_BUFFER_DEFAULT (offset); 1064 set_per_buffer_value (b, offset, per_buffer_default (offset));
827 } 1065 }
828} 1066}
829 1067
@@ -999,7 +1237,7 @@ buffer_local_value_1 (Lisp_Object variable, Lisp_Object buffer)
999 { 1237 {
1000 union Lisp_Fwd *fwd = SYMBOL_FWD (sym); 1238 union Lisp_Fwd *fwd = SYMBOL_FWD (sym);
1001 if (BUFFER_OBJFWDP (fwd)) 1239 if (BUFFER_OBJFWDP (fwd))
1002 result = PER_BUFFER_VALUE (buf, XBUFFER_OBJFWD (fwd)->offset); 1240 result = per_buffer_value (buf, XBUFFER_OBJFWD (fwd)->offset);
1003 else 1241 else
1004 result = Fdefault_value (variable); 1242 result = Fdefault_value (variable);
1005 break; 1243 break;
@@ -1079,7 +1317,7 @@ No argument or nil as argument means use current buffer as BUFFER. */)
1079 && SYMBOLP (PER_BUFFER_SYMBOL (offset))) 1317 && SYMBOLP (PER_BUFFER_SYMBOL (offset)))
1080 { 1318 {
1081 Lisp_Object sym = PER_BUFFER_SYMBOL (offset); 1319 Lisp_Object sym = PER_BUFFER_SYMBOL (offset);
1082 Lisp_Object val = PER_BUFFER_VALUE (buf, offset); 1320 Lisp_Object val = per_buffer_value (buf, offset);
1083 result = Fcons (EQ (val, Qunbound) ? sym : Fcons (sym, val), 1321 result = Fcons (EQ (val, Qunbound) ? sym : Fcons (sym, val),
1084 result); 1322 result);
1085 } 1323 }
@@ -1284,7 +1522,7 @@ This does not change the name of the visited file (if any). */)
1284 error ("Buffer name `%s' is in use", SDATA (newname)); 1522 error ("Buffer name `%s' is in use", SDATA (newname));
1285 } 1523 }
1286 1524
1287 BSET (current_buffer, name, newname); 1525 bset_name (current_buffer, newname);
1288 1526
1289 /* Catch redisplay's attention. Unless we do this, the mode lines for 1527 /* Catch redisplay's attention. Unless we do this, the mode lines for
1290 any windows displaying current_buffer will stay unchanged. */ 1528 any windows displaying current_buffer will stay unchanged. */
@@ -1429,7 +1667,7 @@ No argument or nil as argument means do this for the current buffer. */)
1429 } 1667 }
1430 1668
1431 if (EQ (BVAR (XBUFFER (real_buffer), undo_list), Qt)) 1669 if (EQ (BVAR (XBUFFER (real_buffer), undo_list), Qt))
1432 BSET (XBUFFER (real_buffer), undo_list, Qnil); 1670 bset_undo_list (XBUFFER (real_buffer), Qnil);
1433 1671
1434 return Qnil; 1672 return Qnil;
1435} 1673}
@@ -1689,7 +1927,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1689 m = next; 1927 m = next;
1690 } 1928 }
1691 BUF_MARKERS (b) = NULL; 1929 BUF_MARKERS (b) = NULL;
1692 buffer_set_intervals (b, NULL); 1930 set_buffer_intervals (b, NULL);
1693 1931
1694 /* Perhaps we should explicitly free the interval tree here... */ 1932 /* Perhaps we should explicitly free the interval tree here... */
1695 } 1933 }
@@ -1701,7 +1939,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1701 swap_out_buffer_local_variables (b); 1939 swap_out_buffer_local_variables (b);
1702 reset_buffer_local_variables (b, 1); 1940 reset_buffer_local_variables (b, 1);
1703 1941
1704 BSET (b, name, Qnil); 1942 bset_name (b, Qnil);
1705 1943
1706 BLOCK_INPUT; 1944 BLOCK_INPUT;
1707 if (b->base_buffer) 1945 if (b->base_buffer)
@@ -1725,9 +1963,9 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1725 free_region_cache (b->width_run_cache); 1963 free_region_cache (b->width_run_cache);
1726 b->width_run_cache = 0; 1964 b->width_run_cache = 0;
1727 } 1965 }
1728 BSET (b, width_table, Qnil); 1966 bset_width_table (b, Qnil);
1729 UNBLOCK_INPUT; 1967 UNBLOCK_INPUT;
1730 BSET (b, undo_list, Qnil); 1968 bset_undo_list (b, Qnil);
1731 1969
1732 /* Run buffer-list-update-hook. */ 1970 /* Run buffer-list-update-hook. */
1733 if (!NILP (Vrun_hooks)) 1971 if (!NILP (Vrun_hooks))
@@ -1768,8 +2006,8 @@ record_buffer (Lisp_Object buffer)
1768 Vinhibit_quit = tem; 2006 Vinhibit_quit = tem;
1769 2007
1770 /* Update buffer list of selected frame. */ 2008 /* Update buffer list of selected frame. */
1771 FSET (f, buffer_list, Fcons (buffer, Fdelq (buffer, f->buffer_list))); 2009 fset_buffer_list (f, Fcons (buffer, Fdelq (buffer, f->buffer_list)));
1772 FSET (f, buried_buffer_list, Fdelq (buffer, f->buried_buffer_list)); 2010 fset_buried_buffer_list (f, Fdelq (buffer, f->buried_buffer_list));
1773 2011
1774 /* Run buffer-list-update-hook. */ 2012 /* Run buffer-list-update-hook. */
1775 if (!NILP (Vrun_hooks)) 2013 if (!NILP (Vrun_hooks))
@@ -1806,9 +2044,9 @@ DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal,
1806 Vinhibit_quit = tem; 2044 Vinhibit_quit = tem;
1807 2045
1808 /* Update buffer lists of selected frame. */ 2046 /* Update buffer lists of selected frame. */
1809 FSET (f, buffer_list, Fdelq (buffer, f->buffer_list)); 2047 fset_buffer_list (f, Fdelq (buffer, f->buffer_list));
1810 FSET (f, buried_buffer_list, 2048 fset_buried_buffer_list
1811 Fcons (buffer, Fdelq (buffer, f->buried_buffer_list))); 2049 (f, Fcons (buffer, Fdelq (buffer, f->buried_buffer_list)));
1812 2050
1813 /* Run buffer-list-update-hook. */ 2051 /* Run buffer-list-update-hook. */
1814 if (!NILP (Vrun_hooks)) 2052 if (!NILP (Vrun_hooks))
@@ -1908,7 +2146,7 @@ set_buffer_internal_1 (register struct buffer *b)
1908 /* Put the undo list back in the base buffer, so that it appears 2146 /* Put the undo list back in the base buffer, so that it appears
1909 that an indirect buffer shares the undo list of its base. */ 2147 that an indirect buffer shares the undo list of its base. */
1910 if (old_buf->base_buffer) 2148 if (old_buf->base_buffer)
1911 BSET (old_buf->base_buffer, undo_list, BVAR (old_buf, undo_list)); 2149 bset_undo_list (old_buf->base_buffer, BVAR (old_buf, undo_list));
1912 2150
1913 /* If the old current buffer has markers to record PT, BEGV and ZV 2151 /* If the old current buffer has markers to record PT, BEGV and ZV
1914 when it is not current, update them now. */ 2152 when it is not current, update them now. */
@@ -1918,7 +2156,7 @@ set_buffer_internal_1 (register struct buffer *b)
1918 /* Get the undo list from the base buffer, so that it appears 2156 /* Get the undo list from the base buffer, so that it appears
1919 that an indirect buffer shares the undo list of its base. */ 2157 that an indirect buffer shares the undo list of its base. */
1920 if (b->base_buffer) 2158 if (b->base_buffer)
1921 BSET (b, undo_list, BVAR (b->base_buffer, undo_list)); 2159 bset_undo_list (b, BVAR (b->base_buffer, undo_list));
1922 2160
1923 /* If the new current buffer has markers to record PT, BEGV and ZV 2161 /* If the new current buffer has markers to record PT, BEGV and ZV
1924 when it is not current, fetch them now. */ 2162 when it is not current, fetch them now. */
@@ -2116,8 +2354,8 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2116#define swapfield_(field, type) \ 2354#define swapfield_(field, type) \
2117 do { \ 2355 do { \
2118 type tmp##field = BVAR (other_buffer, field); \ 2356 type tmp##field = BVAR (other_buffer, field); \
2119 BSET (other_buffer, field, BVAR (current_buffer, field)); \ 2357 bset_##field (other_buffer, BVAR (current_buffer, field)); \
2120 BSET (current_buffer, field, tmp##field); \ 2358 bset_##field (current_buffer, tmp##field); \
2121 } while (0) 2359 } while (0)
2122 2360
2123 swapfield (own_text, struct buffer_text); 2361 swapfield (own_text, struct buffer_text);
@@ -2157,8 +2395,8 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2157 swapfield_ (pt_marker, Lisp_Object); 2395 swapfield_ (pt_marker, Lisp_Object);
2158 swapfield_ (begv_marker, Lisp_Object); 2396 swapfield_ (begv_marker, Lisp_Object);
2159 swapfield_ (zv_marker, Lisp_Object); 2397 swapfield_ (zv_marker, Lisp_Object);
2160 BSET (current_buffer, point_before_scroll, Qnil); 2398 bset_point_before_scroll (current_buffer, Qnil);
2161 BSET (other_buffer, point_before_scroll, Qnil); 2399 bset_point_before_scroll (other_buffer, Qnil);
2162 2400
2163 current_buffer->text->modiff++; other_buffer->text->modiff++; 2401 current_buffer->text->modiff++; other_buffer->text->modiff++;
2164 current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++; 2402 current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++;
@@ -2247,7 +2485,7 @@ current buffer is cleared. */)
2247 2485
2248 /* Don't record these buffer changes. We will put a special undo entry 2486 /* Don't record these buffer changes. We will put a special undo entry
2249 instead. */ 2487 instead. */
2250 BSET (current_buffer, undo_list, Qt); 2488 bset_undo_list (current_buffer, Qt);
2251 2489
2252 /* If the cached position is for this buffer, clear it out. */ 2490 /* If the cached position is for this buffer, clear it out. */
2253 clear_charpos_cache (current_buffer); 2491 clear_charpos_cache (current_buffer);
@@ -2269,7 +2507,7 @@ current buffer is cleared. */)
2269 to calculate the old correspondences. */ 2507 to calculate the old correspondences. */
2270 set_intervals_multibyte (0); 2508 set_intervals_multibyte (0);
2271 2509
2272 BSET (current_buffer, enable_multibyte_characters, Qnil); 2510 bset_enable_multibyte_characters (current_buffer, Qnil);
2273 2511
2274 Z = Z_BYTE; 2512 Z = Z_BYTE;
2275 BEGV = BEGV_BYTE; 2513 BEGV = BEGV_BYTE;
@@ -2407,7 +2645,7 @@ current buffer is cleared. */)
2407 2645
2408 /* Do this first, so that chars_in_text asks the right question. 2646 /* Do this first, so that chars_in_text asks the right question.
2409 set_intervals_multibyte needs it too. */ 2647 set_intervals_multibyte needs it too. */
2410 BSET (current_buffer, enable_multibyte_characters, Qt); 2648 bset_enable_multibyte_characters (current_buffer, Qt);
2411 2649
2412 GPT_BYTE = advance_to_char_boundary (GPT_BYTE); 2650 GPT_BYTE = advance_to_char_boundary (GPT_BYTE);
2413 GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG; 2651 GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG;
@@ -2465,11 +2703,11 @@ current buffer is cleared. */)
2465 if (!EQ (old_undo, Qt)) 2703 if (!EQ (old_undo, Qt))
2466 { 2704 {
2467 /* Represent all the above changes by a special undo entry. */ 2705 /* Represent all the above changes by a special undo entry. */
2468 BSET (current_buffer, undo_list, 2706 bset_undo_list (current_buffer,
2469 Fcons (list3 (Qapply, 2707 Fcons (list3 (Qapply,
2470 intern ("set-buffer-multibyte"), 2708 intern ("set-buffer-multibyte"),
2471 NILP (flag) ? Qt : Qnil), 2709 NILP (flag) ? Qt : Qnil),
2472 old_undo)); 2710 old_undo));
2473 } 2711 }
2474 2712
2475 UNGCPRO; 2713 UNGCPRO;
@@ -3236,7 +3474,7 @@ recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos)
3236 if (prev) 3474 if (prev)
3237 prev->next = next; 3475 prev->next = next;
3238 else 3476 else
3239 buffer_set_overlays_before (buf, next); 3477 set_buffer_overlays_before (buf, next);
3240 3478
3241 /* Search thru overlays_after for where to put it. */ 3479 /* Search thru overlays_after for where to put it. */
3242 other_prev = NULL; 3480 other_prev = NULL;
@@ -3258,7 +3496,7 @@ recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos)
3258 if (other_prev) 3496 if (other_prev)
3259 other_prev->next = tail; 3497 other_prev->next = tail;
3260 else 3498 else
3261 buffer_set_overlays_after (buf, tail); 3499 set_buffer_overlays_after (buf, tail);
3262 tail = prev; 3500 tail = prev;
3263 } 3501 }
3264 else 3502 else
@@ -3294,7 +3532,7 @@ recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos)
3294 if (prev) 3532 if (prev)
3295 prev->next = next; 3533 prev->next = next;
3296 else 3534 else
3297 buffer_set_overlays_after (buf, next); 3535 set_buffer_overlays_after (buf, next);
3298 3536
3299 /* Search thru overlays_before for where to put it. */ 3537 /* Search thru overlays_before for where to put it. */
3300 other_prev = NULL; 3538 other_prev = NULL;
@@ -3316,7 +3554,7 @@ recenter_overlay_lists (struct buffer *buf, ptrdiff_t pos)
3316 if (other_prev) 3554 if (other_prev)
3317 other_prev->next = tail; 3555 other_prev->next = tail;
3318 else 3556 else
3319 buffer_set_overlays_before (buf, tail); 3557 set_buffer_overlays_before (buf, tail);
3320 tail = prev; 3558 tail = prev;
3321 } 3559 }
3322 } 3560 }
@@ -3421,7 +3659,7 @@ fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end)
3421 beforep = tail; 3659 beforep = tail;
3422 } 3660 }
3423 if (!parent) 3661 if (!parent)
3424 buffer_set_overlays_before (current_buffer, tail->next); 3662 set_buffer_overlays_before (current_buffer, tail->next);
3425 else 3663 else
3426 parent->next = tail->next; 3664 parent->next = tail->next;
3427 tail = tail->next; 3665 tail = tail->next;
@@ -3467,7 +3705,7 @@ fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end)
3467 beforep = tail; 3705 beforep = tail;
3468 } 3706 }
3469 if (!parent) 3707 if (!parent)
3470 buffer_set_overlays_after (current_buffer, tail->next); 3708 set_buffer_overlays_after (current_buffer, tail->next);
3471 else 3709 else
3472 parent->next = tail->next; 3710 parent->next = tail->next;
3473 tail = tail->next; 3711 tail = tail->next;
@@ -3481,14 +3719,14 @@ fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end)
3481 if (beforep) 3719 if (beforep)
3482 { 3720 {
3483 beforep->next = current_buffer->overlays_before; 3721 beforep->next = current_buffer->overlays_before;
3484 buffer_set_overlays_before (current_buffer, before_list); 3722 set_buffer_overlays_before (current_buffer, before_list);
3485 } 3723 }
3486 recenter_overlay_lists (current_buffer, current_buffer->overlay_center); 3724 recenter_overlay_lists (current_buffer, current_buffer->overlay_center);
3487 3725
3488 if (afterp) 3726 if (afterp)
3489 { 3727 {
3490 afterp->next = current_buffer->overlays_after; 3728 afterp->next = current_buffer->overlays_after;
3491 buffer_set_overlays_after (current_buffer, after_list); 3729 set_buffer_overlays_after (current_buffer, after_list);
3492 } 3730 }
3493 recenter_overlay_lists (current_buffer, current_buffer->overlay_center); 3731 recenter_overlay_lists (current_buffer, current_buffer->overlay_center);
3494} 3732}
@@ -3565,7 +3803,7 @@ fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos)
3565 if (!right_pair) 3803 if (!right_pair)
3566 { 3804 {
3567 found->next = bp->overlays_before; 3805 found->next = bp->overlays_before;
3568 buffer_set_overlays_before (bp, found); 3806 set_buffer_overlays_before (bp, found);
3569 } 3807 }
3570 else 3808 else
3571 { 3809 {
@@ -3643,13 +3881,13 @@ for the rear of the overlay advance when text is inserted there
3643 { 3881 {
3644 if (b->overlays_after) 3882 if (b->overlays_after)
3645 XOVERLAY (overlay)->next = b->overlays_after; 3883 XOVERLAY (overlay)->next = b->overlays_after;
3646 buffer_set_overlays_after (b, XOVERLAY (overlay)); 3884 set_buffer_overlays_after (b, XOVERLAY (overlay));
3647 } 3885 }
3648 else 3886 else
3649 { 3887 {
3650 if (b->overlays_before) 3888 if (b->overlays_before)
3651 XOVERLAY (overlay)->next = b->overlays_before; 3889 XOVERLAY (overlay)->next = b->overlays_before;
3652 buffer_set_overlays_before (b, XOVERLAY (overlay)); 3890 set_buffer_overlays_before (b, XOVERLAY (overlay));
3653 } 3891 }
3654 3892
3655 /* This puts it in the right list, and in the right order. */ 3893 /* This puts it in the right list, and in the right order. */
@@ -3714,8 +3952,8 @@ unchain_both (struct buffer *b, Lisp_Object overlay)
3714{ 3952{
3715 struct Lisp_Overlay *ov = XOVERLAY (overlay); 3953 struct Lisp_Overlay *ov = XOVERLAY (overlay);
3716 3954
3717 buffer_set_overlays_before (b, unchain_overlay (b->overlays_before, ov)); 3955 set_buffer_overlays_before (b, unchain_overlay (b->overlays_before, ov));
3718 buffer_set_overlays_after (b, unchain_overlay (b->overlays_after, ov)); 3956 set_buffer_overlays_after (b, unchain_overlay (b->overlays_after, ov));
3719 eassert (XOVERLAY (overlay)->next == NULL); 3957 eassert (XOVERLAY (overlay)->next == NULL);
3720} 3958}
3721 3959
@@ -3810,12 +4048,12 @@ buffer. */)
3810 if (n_end < b->overlay_center) 4048 if (n_end < b->overlay_center)
3811 { 4049 {
3812 XOVERLAY (overlay)->next = b->overlays_after; 4050 XOVERLAY (overlay)->next = b->overlays_after;
3813 buffer_set_overlays_after (b, XOVERLAY (overlay)); 4051 set_buffer_overlays_after (b, XOVERLAY (overlay));
3814 } 4052 }
3815 else 4053 else
3816 { 4054 {
3817 XOVERLAY (overlay)->next = b->overlays_before; 4055 XOVERLAY (overlay)->next = b->overlays_before;
3818 buffer_set_overlays_before (b, XOVERLAY (overlay)); 4056 set_buffer_overlays_before (b, XOVERLAY (overlay));
3819 } 4057 }
3820 4058
3821 /* This puts it in the right list, and in the right order. */ 4059 /* This puts it in the right list, and in the right order. */
@@ -4911,8 +5149,8 @@ init_buffer_once (void)
4911 /* No one will share the text with these buffers, but let's play it safe. */ 5149 /* No one will share the text with these buffers, but let's play it safe. */
4912 buffer_defaults.indirections = 0; 5150 buffer_defaults.indirections = 0;
4913 buffer_local_symbols.indirections = 0; 5151 buffer_local_symbols.indirections = 0;
4914 buffer_set_intervals (&buffer_defaults, NULL); 5152 set_buffer_intervals (&buffer_defaults, NULL);
4915 buffer_set_intervals (&buffer_local_symbols, NULL); 5153 set_buffer_intervals (&buffer_local_symbols, NULL);
4916 XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); 5154 XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize);
4917 XSETBUFFER (Vbuffer_defaults, &buffer_defaults); 5155 XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
4918 XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize); 5156 XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize);
@@ -4922,55 +5160,55 @@ init_buffer_once (void)
4922 /* Must do these before making the first buffer! */ 5160 /* Must do these before making the first buffer! */
4923 5161
4924 /* real setup is done in bindings.el */ 5162 /* real setup is done in bindings.el */
4925 BSET (&buffer_defaults, mode_line_format, build_pure_c_string ("%-")); 5163 bset_mode_line_format (&buffer_defaults, build_pure_c_string ("%-"));
4926 BSET (&buffer_defaults, header_line_format, Qnil); 5164 bset_header_line_format (&buffer_defaults, Qnil);
4927 BSET (&buffer_defaults, abbrev_mode, Qnil); 5165 bset_abbrev_mode (&buffer_defaults, Qnil);
4928 BSET (&buffer_defaults, overwrite_mode, Qnil); 5166 bset_overwrite_mode (&buffer_defaults, Qnil);
4929 BSET (&buffer_defaults, case_fold_search, Qt); 5167 bset_case_fold_search (&buffer_defaults, Qt);
4930 BSET (&buffer_defaults, auto_fill_function, Qnil); 5168 bset_auto_fill_function (&buffer_defaults, Qnil);
4931 BSET (&buffer_defaults, selective_display, Qnil); 5169 bset_selective_display (&buffer_defaults, Qnil);
4932 BSET (&buffer_defaults, selective_display_ellipses, Qt); 5170 bset_selective_display_ellipses (&buffer_defaults, Qt);
4933 BSET (&buffer_defaults, abbrev_table, Qnil); 5171 bset_abbrev_table (&buffer_defaults, Qnil);
4934 BSET (&buffer_defaults, display_table, Qnil); 5172 bset_display_table (&buffer_defaults, Qnil);
4935 BSET (&buffer_defaults, undo_list, Qnil); 5173 bset_undo_list (&buffer_defaults, Qnil);
4936 BSET (&buffer_defaults, mark_active, Qnil); 5174 bset_mark_active (&buffer_defaults, Qnil);
4937 BSET (&buffer_defaults, file_format, Qnil); 5175 bset_file_format (&buffer_defaults, Qnil);
4938 BSET (&buffer_defaults, auto_save_file_format, Qt); 5176 bset_auto_save_file_format (&buffer_defaults, Qt);
4939 buffer_set_overlays_before (&buffer_defaults, NULL); 5177 set_buffer_overlays_before (&buffer_defaults, NULL);
4940 buffer_set_overlays_after (&buffer_defaults, NULL); 5178 set_buffer_overlays_after (&buffer_defaults, NULL);
4941 buffer_defaults.overlay_center = BEG; 5179 buffer_defaults.overlay_center = BEG;
4942 5180
4943 XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8); 5181 XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8);
4944 BSET (&buffer_defaults, truncate_lines, Qnil); 5182 bset_truncate_lines (&buffer_defaults, Qnil);
4945 BSET (&buffer_defaults, word_wrap, Qnil); 5183 bset_word_wrap (&buffer_defaults, Qnil);
4946 BSET (&buffer_defaults, ctl_arrow, Qt); 5184 bset_ctl_arrow (&buffer_defaults, Qt);
4947 BSET (&buffer_defaults, bidi_display_reordering, Qt); 5185 bset_bidi_display_reordering (&buffer_defaults, Qt);
4948 BSET (&buffer_defaults, bidi_paragraph_direction, Qnil); 5186 bset_bidi_paragraph_direction (&buffer_defaults, Qnil);
4949 BSET (&buffer_defaults, cursor_type, Qt); 5187 bset_cursor_type (&buffer_defaults, Qt);
4950 BSET (&buffer_defaults, extra_line_spacing, Qnil); 5188 bset_extra_line_spacing (&buffer_defaults, Qnil);
4951 BSET (&buffer_defaults, cursor_in_non_selected_windows, Qt); 5189 bset_cursor_in_non_selected_windows (&buffer_defaults, Qt);
4952 5190
4953 BSET (&buffer_defaults, enable_multibyte_characters, Qt); 5191 bset_enable_multibyte_characters (&buffer_defaults, Qt);
4954 BSET (&buffer_defaults, buffer_file_coding_system, Qnil); 5192 bset_buffer_file_coding_system (&buffer_defaults, Qnil);
4955 XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70); 5193 XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70);
4956 XSETFASTINT (BVAR (&buffer_defaults, left_margin), 0); 5194 XSETFASTINT (BVAR (&buffer_defaults, left_margin), 0);
4957 BSET (&buffer_defaults, cache_long_line_scans, Qnil); 5195 bset_cache_long_line_scans (&buffer_defaults, Qnil);
4958 BSET (&buffer_defaults, file_truename, Qnil); 5196 bset_file_truename (&buffer_defaults, Qnil);
4959 XSETFASTINT (BVAR (&buffer_defaults, display_count), 0); 5197 XSETFASTINT (BVAR (&buffer_defaults, display_count), 0);
4960 XSETFASTINT (BVAR (&buffer_defaults, left_margin_cols), 0); 5198 XSETFASTINT (BVAR (&buffer_defaults, left_margin_cols), 0);
4961 XSETFASTINT (BVAR (&buffer_defaults, right_margin_cols), 0); 5199 XSETFASTINT (BVAR (&buffer_defaults, right_margin_cols), 0);
4962 BSET (&buffer_defaults, left_fringe_width, Qnil); 5200 bset_left_fringe_width (&buffer_defaults, Qnil);
4963 BSET (&buffer_defaults, right_fringe_width, Qnil); 5201 bset_right_fringe_width (&buffer_defaults, Qnil);
4964 BSET (&buffer_defaults, fringes_outside_margins, Qnil); 5202 bset_fringes_outside_margins (&buffer_defaults, Qnil);
4965 BSET (&buffer_defaults, scroll_bar_width, Qnil); 5203 bset_scroll_bar_width (&buffer_defaults, Qnil);
4966 BSET (&buffer_defaults, vertical_scroll_bar_type, Qt); 5204 bset_vertical_scroll_bar_type (&buffer_defaults, Qt);
4967 BSET (&buffer_defaults, indicate_empty_lines, Qnil); 5205 bset_indicate_empty_lines (&buffer_defaults, Qnil);
4968 BSET (&buffer_defaults, indicate_buffer_boundaries, Qnil); 5206 bset_indicate_buffer_boundaries (&buffer_defaults, Qnil);
4969 BSET (&buffer_defaults, fringe_indicator_alist, Qnil); 5207 bset_fringe_indicator_alist (&buffer_defaults, Qnil);
4970 BSET (&buffer_defaults, fringe_cursor_alist, Qnil); 5208 bset_fringe_cursor_alist (&buffer_defaults, Qnil);
4971 BSET (&buffer_defaults, scroll_up_aggressively, Qnil); 5209 bset_scroll_up_aggressively (&buffer_defaults, Qnil);
4972 BSET (&buffer_defaults, scroll_down_aggressively, Qnil); 5210 bset_scroll_down_aggressively (&buffer_defaults, Qnil);
4973 BSET (&buffer_defaults, display_time, Qnil); 5211 bset_display_time (&buffer_defaults, Qnil);
4974 5212
4975 /* Assign the local-flags to the slots that have default values. 5213 /* Assign the local-flags to the slots that have default values.
4976 The local flag is a bit that is used in the buffer 5214 The local flag is a bit that is used in the buffer
@@ -4982,24 +5220,24 @@ init_buffer_once (void)
4982 5220
4983 /* 0 means not a lisp var, -1 means always local, else mask */ 5221 /* 0 means not a lisp var, -1 means always local, else mask */
4984 memset (&buffer_local_flags, 0, sizeof buffer_local_flags); 5222 memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
4985 BSET (&buffer_local_flags, filename, make_number (-1)); 5223 bset_filename (&buffer_local_flags, make_number (-1));
4986 BSET (&buffer_local_flags, directory, make_number (-1)); 5224 bset_directory (&buffer_local_flags, make_number (-1));
4987 BSET (&buffer_local_flags, backed_up, make_number (-1)); 5225 bset_backed_up (&buffer_local_flags, make_number (-1));
4988 BSET (&buffer_local_flags, save_length, make_number (-1)); 5226 bset_save_length (&buffer_local_flags, make_number (-1));
4989 BSET (&buffer_local_flags, auto_save_file_name, make_number (-1)); 5227 bset_auto_save_file_name (&buffer_local_flags, make_number (-1));
4990 BSET (&buffer_local_flags, read_only, make_number (-1)); 5228 bset_read_only (&buffer_local_flags, make_number (-1));
4991 BSET (&buffer_local_flags, major_mode, make_number (-1)); 5229 bset_major_mode (&buffer_local_flags, make_number (-1));
4992 BSET (&buffer_local_flags, mode_name, make_number (-1)); 5230 bset_mode_name (&buffer_local_flags, make_number (-1));
4993 BSET (&buffer_local_flags, undo_list, make_number (-1)); 5231 bset_undo_list (&buffer_local_flags, make_number (-1));
4994 BSET (&buffer_local_flags, mark_active, make_number (-1)); 5232 bset_mark_active (&buffer_local_flags, make_number (-1));
4995 BSET (&buffer_local_flags, point_before_scroll, make_number (-1)); 5233 bset_point_before_scroll (&buffer_local_flags, make_number (-1));
4996 BSET (&buffer_local_flags, file_truename, make_number (-1)); 5234 bset_file_truename (&buffer_local_flags, make_number (-1));
4997 BSET (&buffer_local_flags, invisibility_spec, make_number (-1)); 5235 bset_invisibility_spec (&buffer_local_flags, make_number (-1));
4998 BSET (&buffer_local_flags, file_format, make_number (-1)); 5236 bset_file_format (&buffer_local_flags, make_number (-1));
4999 BSET (&buffer_local_flags, auto_save_file_format, make_number (-1)); 5237 bset_auto_save_file_format (&buffer_local_flags, make_number (-1));
5000 BSET (&buffer_local_flags, display_count, make_number (-1)); 5238 bset_display_count (&buffer_local_flags, make_number (-1));
5001 BSET (&buffer_local_flags, display_time, make_number (-1)); 5239 bset_display_time (&buffer_local_flags, make_number (-1));
5002 BSET (&buffer_local_flags, enable_multibyte_characters, make_number (-1)); 5240 bset_enable_multibyte_characters (&buffer_local_flags, make_number (-1));
5003 5241
5004 idx = 1; 5242 idx = 1;
5005 XSETFASTINT (BVAR (&buffer_local_flags, mode_line_format), idx); ++idx; 5243 XSETFASTINT (BVAR (&buffer_local_flags, mode_line_format), idx); ++idx;
@@ -5055,7 +5293,7 @@ init_buffer_once (void)
5055 QSFundamental = build_pure_c_string ("Fundamental"); 5293 QSFundamental = build_pure_c_string ("Fundamental");
5056 5294
5057 Qfundamental_mode = intern_c_string ("fundamental-mode"); 5295 Qfundamental_mode = intern_c_string ("fundamental-mode");
5058 BSET (&buffer_defaults, major_mode, Qfundamental_mode); 5296 bset_major_mode (&buffer_defaults, Qfundamental_mode);
5059 5297
5060 Qmode_class = intern_c_string ("mode-class"); 5298 Qmode_class = intern_c_string ("mode-class");
5061 5299
@@ -5118,13 +5356,13 @@ init_buffer (void)
5118 len++; 5356 len++;
5119 } 5357 }
5120 5358
5121 BSET (current_buffer, directory, make_unibyte_string (pwd, len)); 5359 bset_directory (current_buffer, make_unibyte_string (pwd, len));
5122 if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) 5360 if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
5123 /* At this moment, we still don't know how to decode the 5361 /* At this moment, we still don't know how to decode the
5124 directory name. So, we keep the bytes in multibyte form so 5362 directory name. So, we keep the bytes in multibyte form so
5125 that ENCODE_FILE correctly gets the original bytes. */ 5363 that ENCODE_FILE correctly gets the original bytes. */
5126 BSET (current_buffer, directory, 5364 bset_directory
5127 string_to_multibyte (BVAR (current_buffer, directory))); 5365 (current_buffer, string_to_multibyte (BVAR (current_buffer, directory)));
5128 5366
5129 /* Add /: to the front of the name 5367 /* Add /: to the front of the name
5130 if it would otherwise be treated as magic. */ 5368 if it would otherwise be treated as magic. */
@@ -5135,11 +5373,12 @@ init_buffer (void)
5135 However, it is not necessary to turn / into /:/. 5373 However, it is not necessary to turn / into /:/.
5136 So avoid doing that. */ 5374 So avoid doing that. */
5137 && strcmp ("/", SSDATA (BVAR (current_buffer, directory)))) 5375 && strcmp ("/", SSDATA (BVAR (current_buffer, directory))))
5138 BSET (current_buffer, directory, 5376 bset_directory
5139 concat2 (build_string ("/:"), BVAR (current_buffer, directory))); 5377 (current_buffer,
5378 concat2 (build_string ("/:"), BVAR (current_buffer, directory)));
5140 5379
5141 temp = get_minibuffer (0); 5380 temp = get_minibuffer (0);
5142 BSET (XBUFFER (temp), directory, BVAR (current_buffer, directory)); 5381 bset_directory (XBUFFER (temp), BVAR (current_buffer, directory));
5143 5382
5144 free (pwd); 5383 free (pwd);
5145} 5384}