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