aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog296
-rw-r--r--src/alloc.c10
-rw-r--r--src/buffer.c692
-rw-r--r--src/buffer.h14
-rw-r--r--src/bytecode.c21
-rw-r--r--src/callint.c22
-rw-r--r--src/callproc.c21
-rw-r--r--src/casefiddle.c12
-rw-r--r--src/casetab.c10
-rw-r--r--src/category.c8
-rw-r--r--src/category.h2
-rw-r--r--src/character.c4
-rw-r--r--src/character.h12
-rw-r--r--src/charset.c2
-rw-r--r--src/cmds.c24
-rw-r--r--src/coding.c34
-rw-r--r--src/composite.c8
-rw-r--r--src/data.c24
-rw-r--r--src/dired.c2
-rw-r--r--src/dispextern.h6
-rw-r--r--src/dispnew.c8
-rw-r--r--src/doc.c2
-rw-r--r--src/editfns.c74
-rw-r--r--src/fileio.c202
-rw-r--r--src/filelock.c14
-rw-r--r--src/fns.c12
-rw-r--r--src/font.c2
-rw-r--r--src/frame.c18
-rw-r--r--src/fringe.c18
-rw-r--r--src/indent.c62
-rw-r--r--src/insdel.c62
-rw-r--r--src/intervals.c4
-rw-r--r--src/intervals.h4
-rw-r--r--src/keyboard.c250
-rw-r--r--src/keyboard.h43
-rw-r--r--src/keymap.c40
-rw-r--r--src/lisp.h15
-rw-r--r--src/lread.c16
-rw-r--r--src/macros.c42
-rw-r--r--src/marker.c12
-rw-r--r--src/minibuf.c22
-rw-r--r--src/msdos.c8
-rw-r--r--src/nsfns.m12
-rw-r--r--src/nsterm.m2
-rw-r--r--src/print.c40
-rw-r--r--src/process.c58
-rw-r--r--src/s/ms-w32.h4
-rw-r--r--src/search.c48
-rw-r--r--src/syntax.c16
-rw-r--r--src/syntax.h6
-rw-r--r--src/term.c23
-rw-r--r--src/undo.c62
-rw-r--r--src/w32fns.c12
-rw-r--r--src/w32term.c2
-rw-r--r--src/window.c68
-rw-r--r--src/xdisp.c211
-rw-r--r--src/xfaces.c2
-rw-r--r--src/xfns.c10
-rw-r--r--src/xterm.c6
59 files changed, 1474 insertions, 1262 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 87649d3db20..356637b0709 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,241 @@
12011-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lisp.h (BYTE_MARK_STACK): New macro.
4 (mark_byte_stack): Only declare if BYTE_MARK_STACK is set.
5
6 * bytecode.c (BYTE_MAINTAIN_TOP): New macros.
7 (struct byte_stack): Only define `top' and `bottom' if used.
8 (mark_byte_stack): Only define if used.
9 (BEFORE_POTENTIAL_GC, AFTER_POTENTIAL_GC): Nullify if BYTE_MAINTAIN_TOP
10 is not set.
11 (Fbyte_code): Don't set `bottom' unless BYTE_MAINTAIN_TOP is set.
12
13 * term.c (OUTPUT_IF): Use OUTPUT.
14
15 * alloc.c (Fgarbage_collect): When using stack scanning, don't
16 redundantly scan byte-code stacks, catchlist, and handlerlist.
17
182011-02-17 Jan Djärv <jan.h.d@swipnet.se>
19
20 * nsfns.m (Fx_create_frame, ns_set_name_as_filename)
21 (Fns_read_file_name): Replace B_ with BVAR.
22
23 * nsterm.m (ns_term_init): Use KVAR.
24
252011-02-16 Eli Zaretskii <eliz@gnu.org>
26
27 * msdos.c (internal_terminal_init): Use KVAR.
28
29 * w32fns.c (Fx_create_frame): Use KVAR.
30
31 * w32term.c (w32_create_terminal): Use KVAR.
32
33 * s/ms-w32.h (MODE_LINE_BINARY_TEXT): Remove.
34 (getloadavg): Declare prototype which was removed from lisp.h.
35
36 * xdisp.c (decode_mode_spec): Don't use MODE_LINE_BINARY_TEXT.
37
38 * fileio.c (Finsert_file_contents, Fwrite_region):
39 Remove references to buffer_file_type.
40 (syms_of_fileio): Don't intern and staticpro
41 find-buffer-file-type.
42
43 * callproc.c (syms_of_callproc): Remove references to
44 buffer_file_type.
45
46 * buffer.c (reset_buffer_local_variables): Don't set
47 buffer_file_type.
48 (init_buffer_once): Likewise.
49 (syms_of_buffer): Don't define buffer-file-type.
50
51 * buffer.h (struct buffer): Remove buffer_file_type.
52
532011-02-16 Tom Tromey <tromey@parfait>
54
55 * callint.c (Fcall_interactively): Update for change to field names.
56 * doc.c (Fsubstitute_command_keys): Update for change to field names.
57 * cmds.c (Fself_insert_command): Update for change to field names.
58 * keymap.c (Fcurrent_active_maps, Fkey_binding)
59 (Fdescribe_buffer_bindings): Update for change to field names.
60 * macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
61 (store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
62 Update for change to field names.
63 * keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
64 (echo_length, echo_truncate, cmd_error, command_loop_1)
65 (read_char, kbd_buffer_store_event_hold, make_lispy_event)
66 (menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
67 (read_key_sequence, Fcommand_execute, Fexecute_extended_command)
68 (Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
69 Update for change to field names.
70 * xfns.c (Fx_create_frame): Update for change to field names.
71 * xterm.c (x_connection_closed, x_term_init): Update for change to
72 field names.
73 * term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
74 Update for change to field names.
75 * window.c (window_scroll_pixel_based, window_scroll_line_based):
76 Update for change to field names.
77 * frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
78 (delete_frame): Update for change to field names.
79 * lisp.h (DEFVAR_KBOARD): Update for change to field names.
80 * keyboard.h (struct kboard): Rename all Lisp_Object fields.
81 (KBOARD_INTERNAL_FIELD, KVAR): New macros.
82
832011-02-16 Tom Tromey <tromey@redhat.com>
84
85 * lisp.h (DEFVAR_BUFFER_DEFAULTS): Use BVAR.
86
872011-02-16 Tom Tromey <tromey@parfait>
88
89 * xfns.c (x_create_tip_frame, Fx_show_tip): Replace B_ with BVAR.
90 * xfaces.c (compute_char_face): Replace B_ with BVAR.
91 * xdisp.c (pos_visible_p, init_iterator, reseat_1)
92 (message_dolog, update_echo_area, ensure_echo_area_buffers)
93 (with_echo_area_buffer, setup_echo_area_for_printing)
94 (set_message_1, update_menu_bar, update_tool_bar)
95 (text_outside_line_unchanged_p, redisplay_internal)
96 (try_scrolling, try_cursor_movement, redisplay_window)
97 (try_window_reusing_current_matrix, row_containing_pos)
98 (try_window_id, get_overlay_arrow_glyph_row, display_line)
99 (Fcurrent_bidi_paragraph_direction, display_mode_lines)
100 (decode_mode_spec_coding, decode_mode_spec, display_count_lines)
101 (get_window_cursor_type, note_mouse_highlight): Replace B_ with
102 BVAR.
103 * window.c (window_display_table, unshow_buffer, window_loop)
104 (window_min_size_2, set_window_buffer, Fset_window_buffer)
105 (select_window, Fforce_window_update, temp_output_buffer_show)
106 (Fset_window_configuration, save_window_save): Replace B_ with
107 BVAR.
108 * w32fns.c (x_create_tip_frame, Fx_show_tip, Fw32_shell_execute):
109 Replace B_ with BVAR.
110 * undo.c (record_point, record_insert, record_delete)
111 (record_marker_adjustment, record_first_change)
112 (record_property_change, Fundo_boundary, truncate_undo_list)
113 (Fprimitive_undo): Replace B_ with BVAR.
114 * syntax.h (Vstandard_syntax_table, CURRENT_SYNTAX_TABLE)
115 (SETUP_BUFFER_SYNTAX_TABLE): Replace B_ with BVAR.
116 * syntax.c (update_syntax_table, dec_bytepos, Fsyntax_table)
117 (Fset_syntax_table, Fmodify_syntax_entry, skip_chars)
118 (skip_syntaxes, scan_lists): Replace B_ with BVAR.
119 * search.c (compile_pattern_1, compile_pattern, looking_at_1)
120 (string_match_1, fast_looking_at, newline_cache_on_off)
121 (search_command, search_buffer, simple_search, boyer_moore)
122 (Freplace_match): Replace B_ with BVAR.
123 * process.c (get_process, list_processes_1, Fstart_process)
124 (Fmake_serial_process, Fmake_network_process)
125 (read_process_output, send_process, exec_sentinel)
126 (status_notify, setup_process_coding_systems): Replace B_ with
127 BVAR.
128 * print.c (PRINTDECLARE, PRINTPREPARE, PRINTFINISH, printchar)
129 (strout, print_string, temp_output_buffer_setup, print_object):
130 Replace B_ with BVAR.
131 * msdos.c (IT_frame_up_to_date): Replace B_ with BVAR.
132 * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer):
133 Replace B_ with BVAR.
134 * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted)
135 (set_marker_both, set_marker_restricted_both, unchain_marker):
136 Replace B_ with BVAR.
137 * lread.c (readchar, unreadchar, openp, readevalloop)
138 (Feval_buffer, Feval_region): Replace B_ with BVAR.
139 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE): Replace B_ with BVAR.
140 * keymap.c (Flocal_key_binding, Fuse_local_map)
141 (Fcurrent_local_map, push_key_description)
142 (Fdescribe_buffer_bindings): Replace B_ with BVAR.
143 * keyboard.c (command_loop_1, read_char_minibuf_menu_prompt)
144 (read_key_sequence): Replace B_ with BVAR.
145 * intervals.h (TEXT_PROP_MEANS_INVISIBLE): Replace B_ with BVAR.
146 * intervals.c (set_point_both, get_local_map): Replace B_ with
147 BVAR.
148 * insdel.c (check_markers, insert_char, insert_1_both)
149 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
150 (adjust_after_replace, replace_range, del_range_2)
151 (modify_region, prepare_to_modify_buffer)
152 (Fcombine_after_change_execute): Replace B_ with BVAR.
153 * indent.c (buffer_display_table, recompute_width_table)
154 (width_run_cache_on_off, current_column, scan_for_column)
155 (Findent_to, position_indentation, compute_motion, vmotion):
156 Replace B_ with BVAR.
157 * fringe.c (get_logical_cursor_bitmap)
158 (get_logical_fringe_bitmap, update_window_fringes): Replace B_
159 with BVAR.
160 * frame.c (make_frame_visible_1): Replace B_ with BVAR.
161 * font.c (font_at): Replace B_ with BVAR.
162 * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5):
163 Replace B_ with BVAR.
164 * filelock.c (unlock_all_files, Flock_buffer, Funlock_buffer)
165 (unlock_buffer): Replace B_ with BVAR.
166 * fileio.c (Fexpand_file_name, Ffile_directory_p)
167 (Ffile_regular_p, Ffile_selinux_context)
168 (Fset_file_selinux_context, Ffile_modes, Fset_file_modes)
169 (Fset_file_times, Ffile_newer_than_file_p, decide_coding_unwind)
170 (Finsert_file_contents, choose_write_coding_system)
171 (Fwrite_region, build_annotations, Fverify_visited_file_modtime)
172 (Fset_visited_file_modtime, auto_save_error, auto_save_1)
173 (Fdo_auto_save, Fset_buffer_auto_saved): Replace B_ with BVAR.
174 * editfns.c (region_limit, Fmark_marker, save_excursion_save)
175 (save_excursion_restore, Fprevious_char, Fchar_before)
176 (general_insert_function, Finsert_char, Finsert_byte)
177 (make_buffer_string_both, Finsert_buffer_substring)
178 (Fcompare_buffer_substrings, subst_char_in_region_unwind)
179 (subst_char_in_region_unwind_1, Fsubst_char_in_region)
180 (Ftranslate_region_internal, save_restriction_restore)
181 (Fchar_equal): Replace B_ with BVAR.
182 * dispnew.c (Fframe_or_buffer_changed_p): Replace B_ with BVAR.
183 * dispextern.h (WINDOW_WANTS_MODELINE_P)
184 (WINDOW_WANTS_HEADER_LINE_P): Replace B_ with BVAR.
185 * dired.c (directory_files_internal): Replace B_ with BVAR.
186 * data.c (swap_in_symval_forwarding, set_internal)
187 (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p):
188 Replace B_ with BVAR.
189 * composite.c (fill_gstring_header)
190 (composition_compute_stop_pos, composition_adjust_point)
191 (Ffind_composition_internal): Replace B_ with BVAR.
192 * coding.c (decode_coding, encode_coding)
193 (make_conversion_work_buffer, decode_coding_gap)
194 (decode_coding_object, encode_coding_object)
195 (Fdetect_coding_region, Ffind_coding_systems_region_internal)
196 (Funencodable_char_position, Fcheck_coding_systems_region):
197 Replace B_ with BVAR.
198 * cmds.c (Fself_insert_command, internal_self_insert): Replace B_
199 with BVAR.
200 * charset.c (Ffind_charset_region): Replace B_ with BVAR.
201 * character.h (FETCH_CHAR_ADVANCE, INC_BOTH, DEC_BOTH)
202 (ASCII_CHAR_WIDTH): Replace B_ with BVAR.
203 * character.c (chars_in_text, Fget_byte): Replace B_ with BVAR.
204 * category.h (Vstandard_category_table): Replace B_ with BVAR.
205 * category.c (check_category_table, Fcategory_table)
206 (Fset_category_table, char_category_set): Replace B_ with BVAR.
207 * casetab.c (Fcurrent_case_table, set_case_table): Replace B_ with
208 BVAR.
209 * casefiddle.c (casify_object, casify_region): Replace B_ with
210 BVAR.
211 * callproc.c (Fcall_process, Fcall_process_region): Replace B_
212 with BVAR.
213 * callint.c (check_mark, Fcall_interactively): Replace B_ with
214 BVAR.
215 * bytecode.c (Fbyte_code): Replace B_ with BVAR.
216 * buffer.h (FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE, BVAR): Replace B_
217 with BVAR.
218 * buffer.c (Fbuffer_live_p, Fget_file_buffer)
219 (get_truename_buffer, Fget_buffer_create)
220 (clone_per_buffer_values, Fmake_indirect_buffer, reset_buffer)
221 (reset_buffer_local_variables, Fbuffer_name, Fbuffer_file_name)
222 (Fbuffer_local_value, buffer_lisp_local_variables)
223 (Fset_buffer_modified_p, Frestore_buffer_modified_p)
224 (Frename_buffer, Fother_buffer, Fbuffer_enable_undo)
225 (Fkill_buffer, Fset_buffer_major_mode, set_buffer_internal_1)
226 (set_buffer_temp, Fset_buffer, set_buffer_if_live)
227 (Fbarf_if_buffer_read_only, Fbury_buffer, Ferase_buffer)
228 (Fbuffer_swap_text, swapfield_, Fbuffer_swap_text)
229 (Fset_buffer_multibyte, swap_out_buffer_local_variables)
230 (record_overlay_string, overlay_strings, init_buffer_once)
231 (init_buffer, syms_of_buffer): Replace B_ with BVAR.
232
2332011-02-16 Eli Zaretskii <eliz@gnu.org>
234
235 * xdisp.c (redisplay_internal): Resynchronize `w' if the selected
236 window is changed inside calls to do_pending_window_change.
237 (Bug#8020)
238
12011-02-16 Paul Eggert <eggert@cs.ucla.edu> 2392011-02-16 Paul Eggert <eggert@cs.ucla.edu>
2 240
3 Remove no-longer needed getloadavg symbols. 241 Remove no-longer needed getloadavg symbols.
@@ -54,8 +292,8 @@
54 * xmenu.c (apply_systemfont_to_dialog): Apply to *dialog.font. 292 * xmenu.c (apply_systemfont_to_dialog): Apply to *dialog.font.
55 (apply_systemfont_to_menu): Set resources *menubar*font and 293 (apply_systemfont_to_menu): Set resources *menubar*font and
56 *popup*font. Remove defflt. 294 *popup*font. Remove defflt.
57 (set_frame_menubar, create_and_show_popup_menu): Call 295 (set_frame_menubar, create_and_show_popup_menu):
58 apply_systemfont_to_menu before lw_create_widget. 296 Call apply_systemfont_to_menu before lw_create_widget.
59 297
602011-02-14 Tom Tromey <tromey@redhat.com> 2982011-02-14 Tom Tromey <tromey@redhat.com>
61 299
@@ -84,8 +322,8 @@
84 (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup) 322 (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup)
85 (print_object): Use B_. 323 (print_object): Use B_.
86 * font.c (font_at): Use B_. 324 * font.c (font_at): Use B_.
87 * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use 325 * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5):
88 B_. 326 Use B_.
89 * callint.c (check_mark, Fcall_interactively): Use B_. 327 * callint.c (check_mark, Fcall_interactively): Use B_.
90 * editfns.c (region_limit, Fmark_marker, save_excursion_save) 328 * editfns.c (region_limit, Fmark_marker, save_excursion_save)
91 (save_excursion_restore, Fprevious_char, Fchar_before) 329 (save_excursion_restore, Fprevious_char, Fchar_before)
@@ -108,8 +346,8 @@
108 (Freplace_match): Use B_. 346 (Freplace_match): Use B_.
109 * indent.c (buffer_display_table, recompute_width_table) 347 * indent.c (buffer_display_table, recompute_width_table)
110 (width_run_cache_on_off, current_column, scan_for_column) 348 (width_run_cache_on_off, current_column, scan_for_column)
111 (Findent_to, position_indentation, compute_motion, vmotion): Use 349 (Findent_to, position_indentation, compute_motion, vmotion):
112 B_. 350 Use B_.
113 * casefiddle.c (casify_object, casify_region): Use B_. 351 * casefiddle.c (casify_object, casify_region): Use B_.
114 * casetab.c (Fcurrent_case_table, set_case_table): Use B_. 352 * casetab.c (Fcurrent_case_table, set_case_table): Use B_.
115 * cmds.c (Fself_insert_command, internal_self_insert): Use B_. 353 * cmds.c (Fself_insert_command, internal_self_insert): Use B_.
@@ -123,8 +361,8 @@
123 (Fdo_auto_save, Fset_buffer_auto_saved): Use B_. 361 (Fdo_auto_save, Fset_buffer_auto_saved): Use B_.
124 * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_. 362 * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_.
125 * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) 363 * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted)
126 (set_marker_both, set_marker_restricted_both, unchain_marker): Use 364 (set_marker_both, set_marker_restricted_both, unchain_marker):
127 B_. 365 Use B_.
128 * insdel.c (check_markers, insert_char, insert_1_both) 366 * insdel.c (check_markers, insert_char, insert_1_both)
129 (insert_from_string_1, insert_from_gap, insert_from_buffer_1) 367 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
130 (adjust_after_replace, replace_range, del_range_2) 368 (adjust_after_replace, replace_range, del_range_2)
@@ -148,8 +386,8 @@
148 (make_conversion_work_buffer, decode_coding_gap) 386 (make_conversion_work_buffer, decode_coding_gap)
149 (decode_coding_object, encode_coding_object) 387 (decode_coding_object, encode_coding_object)
150 (Fdetect_coding_region, Ffind_coding_systems_region_internal) 388 (Fdetect_coding_region, Ffind_coding_systems_region_internal)
151 (Funencodable_char_position, Fcheck_coding_systems_region): Use 389 (Funencodable_char_position, Fcheck_coding_systems_region):
152 B_. 390 Use B_.
153 * charset.c (Ffind_charset_region): Use B_. 391 * charset.c (Ffind_charset_region): Use B_.
154 * window.c (window_display_table, unshow_buffer, window_loop) 392 * window.c (window_display_table, unshow_buffer, window_loop)
155 (window_min_size_2, set_window_buffer, Fset_window_buffer) 393 (window_min_size_2, set_window_buffer, Fset_window_buffer)
@@ -406,8 +644,8 @@
406 callers changed. 644 callers changed.
407 * editfns.c (general_insert_function): Change signature to 645 * editfns.c (general_insert_function): Change signature to
408 match changes to insert functions' signatures. 646 match changes to insert functions' signatures.
409 * keymap.c (map_keymap_char_table_item, map_keymap_internal): Use 647 * keymap.c (map_keymap_char_table_item, map_keymap_internal):
410 explicit cast when converting between void * and function pointer 648 Use explicit cast when converting between void * and function pointer
411 types, as C89 requires this. 649 types, as C89 requires this.
412 650
4132011-02-05 Paul Eggert <eggert@cs.ucla.edu> 6512011-02-05 Paul Eggert <eggert@cs.ucla.edu>
@@ -527,7 +765,7 @@
5272011-02-01 Paul Eggert <eggert@cs.ucla.edu> 7652011-02-01 Paul Eggert <eggert@cs.ucla.edu>
528 766
529 format-time-string now supports subsecond time stamp resolution 767 format-time-string now supports subsecond time stamp resolution
530 * editfns.c (emacs_nmemftime): Renamed from emacs_memftimeu, 768 * editfns.c (emacs_nmemftime): Rename from emacs_memftimeu,
531 for consistency with its new argument and with gnulib nstrftime. 769 for consistency with its new argument and with gnulib nstrftime.
532 All callers changed. New argument NS. 770 All callers changed. New argument NS.
533 (Fformat_time_string): Check that the time argument's microseconds 771 (Fformat_time_string): Check that the time argument's microseconds
@@ -857,11 +1095,11 @@
857 (history_delete_duplicates, inhibit_x_resources) 1095 (history_delete_duplicates, inhibit_x_resources)
858 (last_nonmenu_event, load_in_progress, max_specpdl_size) 1096 (last_nonmenu_event, load_in_progress, max_specpdl_size)
859 (minibuffer_auto_raise, print_escape_newlines, scroll_margin) 1097 (minibuffer_auto_raise, print_escape_newlines, scroll_margin)
860 (use_dialog_box, use_file_dialog): Remove declaration. Include 1098 (use_dialog_box, use_file_dialog): Remove declaration.
861 globals.h. 1099 Include globals.h.
862 * keymap.h (Voverriding_local_map) 1100 * keymap.h (Voverriding_local_map)
863 (Voverriding_local_map_menu_flag, meta_prefix_char): Remove 1101 (Voverriding_local_map_menu_flag, meta_prefix_char):
864 declaration. 1102 Remove declaration.
865 * keyboard.h (Vdouble_click_time, Vfunction_key_map) 1103 * keyboard.h (Vdouble_click_time, Vfunction_key_map)
866 (Vinput_method_function, Vkey_translation_map) 1104 (Vinput_method_function, Vkey_translation_map)
867 (Vlucid_menu_bar_dirty_flag, Vthis_original_command) 1105 (Vlucid_menu_bar_dirty_flag, Vthis_original_command)
@@ -879,16 +1117,16 @@
879 (focus_follows_mouse): Remove declaration. 1117 (focus_follows_mouse): Remove declaration.
880 * fontset.h (Valternate_fontname_alist, Vfontset_alias_alist) 1118 * fontset.h (Valternate_fontname_alist, Vfontset_alias_alist)
881 (Vignore_relative_composition, Votf_script_alist) 1119 (Vignore_relative_composition, Votf_script_alist)
882 (Vuse_default_ascent, Vvertical_centering_font_regexp): Remove 1120 (Vuse_default_ascent, Vvertical_centering_font_regexp):
883 declaration. 1121 Remove declaration.
884 * font.h (Vfont_log): Remove declaration. 1122 * font.h (Vfont_log): Remove declaration.
885 * dosfns.h (Vdos_display_scancodes, Vdos_version) 1123 * dosfns.h (Vdos_display_scancodes, Vdos_version)
886 (Vdos_windows_version, dos_codepage, dos_country_code) 1124 (Vdos_windows_version, dos_codepage, dos_country_code)
887 (dos_decimal_point, dos_hyper_key, dos_keyboard_layout) 1125 (dos_decimal_point, dos_hyper_key, dos_keyboard_layout)
888 (dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove 1126 (dos_keypad_mode, dos_super_key, dos_timezone_offset):
889 declaration. 1127 Remove declaration.
890 * disptab.h (Vglyph_table, Vstandard_display_table): Remove 1128 * disptab.h (Vglyph_table, Vstandard_display_table):
891 declaration. 1129 Remove declaration.
892 * dispextern.h (Vface_remapping_alist, Vglyphless_char_display) 1130 * dispextern.h (Vface_remapping_alist, Vglyphless_char_display)
893 (Vmouse_autoselect_window, Voverflow_newline_into_fringe) 1131 (Vmouse_autoselect_window, Voverflow_newline_into_fringe)
894 (Vshow_trailing_whitespace, Vtool_bar_button_margin) 1132 (Vshow_trailing_whitespace, Vtool_bar_button_margin)
@@ -916,10 +1154,10 @@
916 (Vselect_safe_coding_system_function) 1154 (Vselect_safe_coding_system_function)
917 (Vtranslation_table_for_input, coding_system_require_warning) 1155 (Vtranslation_table_for_input, coding_system_require_warning)
918 (eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided) 1156 (eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
919 (eol_mnemonic_unix, inherit_process_coding_system): Remove 1157 (eol_mnemonic_unix, inherit_process_coding_system):
920 declaration. 1158 Remove declaration.
921 * charset.h (Vcharset_list, Vcurrent_iso639_language): Remove 1159 * charset.h (Vcharset_list, Vcurrent_iso639_language):
922 declaration. 1160 Remove declaration.
923 * character.h (Vauto_fill_chars, Vchar_direction_table) 1161 * character.h (Vauto_fill_chars, Vchar_direction_table)
924 (Vchar_script_table, Vchar_width_table, Vprintable_chars) 1162 (Vchar_script_table, Vchar_width_table, Vprintable_chars)
925 (Vscript_representative_chars, Vtranslation_table_vector) 1163 (Vscript_representative_chars, Vtranslation_table_vector)
@@ -1034,8 +1272,8 @@
1034 (w32_strict_fontnames, w32_strict_painting): Remove. 1272 (w32_strict_fontnames, w32_strict_painting): Remove.
1035 (Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode) 1273 (Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode)
1036 (Vw32_recognize_altgr, Vwindow_system_version) 1274 (Vw32_recognize_altgr, Vwindow_system_version)
1037 (w32_num_mouse_buttons, w32_use_visible_system_caret): Remove 1275 (w32_num_mouse_buttons, w32_use_visible_system_caret):
1038 declaration. 1276 Remove declaration.
1039 * w32console.c (syms_of_ntterm): Update. 1277 * w32console.c (syms_of_ntterm): Update.
1040 (w32_use_full_screen_buffer): Remove. 1278 (w32_use_full_screen_buffer): Remove.
1041 (Vtty_defined_color_alist): Remove declaration. 1279 (Vtty_defined_color_alist): Remove declaration.
diff --git a/src/alloc.c b/src/alloc.c
index 566c6fe00b9..e8b8f45e9b1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4842,8 +4842,6 @@ returns nil, because real GC can't be done. */)
4842 (void) 4842 (void)
4843{ 4843{
4844 register struct specbinding *bind; 4844 register struct specbinding *bind;
4845 struct catchtag *catch;
4846 struct handler *handler;
4847 char stack_top_variable; 4845 char stack_top_variable;
4848 register int i; 4846 register int i;
4849 int message_p; 4847 int message_p;
@@ -4972,9 +4970,11 @@ returns nil, because real GC can't be done. */)
4972 for (i = 0; i < tail->nvars; i++) 4970 for (i = 0; i < tail->nvars; i++)
4973 mark_object (tail->var[i]); 4971 mark_object (tail->var[i]);
4974 } 4972 }
4975#endif
4976
4977 mark_byte_stack (); 4973 mark_byte_stack ();
4974 {
4975 struct catchtag *catch;
4976 struct handler *handler;
4977
4978 for (catch = catchlist; catch; catch = catch->next) 4978 for (catch = catchlist; catch; catch = catch->next)
4979 { 4979 {
4980 mark_object (catch->tag); 4980 mark_object (catch->tag);
@@ -4985,7 +4985,9 @@ returns nil, because real GC can't be done. */)
4985 mark_object (handler->handler); 4985 mark_object (handler->handler);
4986 mark_object (handler->var); 4986 mark_object (handler->var);
4987 } 4987 }
4988 }
4988 mark_backtrace (); 4989 mark_backtrace ();
4990#endif
4989 4991
4990#ifdef HAVE_WINDOW_SYSTEM 4992#ifdef HAVE_WINDOW_SYSTEM
4991 mark_fringe_data (); 4993 mark_fringe_data ();
diff --git a/src/buffer.c b/src/buffer.c
index 49ae4bbede2..c95fbb5f516 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -162,7 +162,7 @@ DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0,
162Value is nil if OBJECT is not a buffer or if it has been killed. */) 162Value is nil if OBJECT is not a buffer or if it has been killed. */)
163 (Lisp_Object object) 163 (Lisp_Object object)
164{ 164{
165 return ((BUFFERP (object) && ! NILP (B_ (XBUFFER (object), name))) 165 return ((BUFFERP (object) && ! NILP (BVAR (XBUFFER (object), name)))
166 ? Qt : Qnil); 166 ? Qt : Qnil);
167} 167}
168 168
@@ -266,8 +266,8 @@ See also `find-buffer-visiting'. */)
266 { 266 {
267 buf = Fcdr (XCAR (tail)); 267 buf = Fcdr (XCAR (tail));
268 if (!BUFFERP (buf)) continue; 268 if (!BUFFERP (buf)) continue;
269 if (!STRINGP (B_ (XBUFFER (buf), filename))) continue; 269 if (!STRINGP (BVAR (XBUFFER (buf), filename))) continue;
270 tem = Fstring_equal (B_ (XBUFFER (buf), filename), filename); 270 tem = Fstring_equal (BVAR (XBUFFER (buf), filename), filename);
271 if (!NILP (tem)) 271 if (!NILP (tem))
272 return buf; 272 return buf;
273 } 273 }
@@ -283,8 +283,8 @@ get_truename_buffer (register Lisp_Object filename)
283 { 283 {
284 buf = Fcdr (XCAR (tail)); 284 buf = Fcdr (XCAR (tail));
285 if (!BUFFERP (buf)) continue; 285 if (!BUFFERP (buf)) continue;
286 if (!STRINGP (B_ (XBUFFER (buf), file_truename))) continue; 286 if (!STRINGP (BVAR (XBUFFER (buf), file_truename))) continue;
287 tem = Fstring_equal (B_ (XBUFFER (buf), file_truename), filename); 287 tem = Fstring_equal (BVAR (XBUFFER (buf), file_truename), filename);
288 if (!NILP (tem)) 288 if (!NILP (tem))
289 return buf; 289 return buf;
290 } 290 }
@@ -353,7 +353,7 @@ even if it is dead. The return value is never nil. */)
353 353
354 b->newline_cache = 0; 354 b->newline_cache = 0;
355 b->width_run_cache = 0; 355 b->width_run_cache = 0;
356 B_ (b, width_table) = Qnil; 356 BVAR (b, width_table) = Qnil;
357 b->prevent_redisplay_optimizations_p = 1; 357 b->prevent_redisplay_optimizations_p = 1;
358 358
359 /* Put this on the chain of all buffers including killed ones. */ 359 /* Put this on the chain of all buffers including killed ones. */
@@ -362,22 +362,22 @@ even if it is dead. The return value is never nil. */)
362 362
363 /* An ordinary buffer normally doesn't need markers 363 /* An ordinary buffer normally doesn't need markers
364 to handle BEGV and ZV. */ 364 to handle BEGV and ZV. */
365 B_ (b, pt_marker) = Qnil; 365 BVAR (b, pt_marker) = Qnil;
366 B_ (b, begv_marker) = Qnil; 366 BVAR (b, begv_marker) = Qnil;
367 B_ (b, zv_marker) = Qnil; 367 BVAR (b, zv_marker) = Qnil;
368 368
369 name = Fcopy_sequence (buffer_or_name); 369 name = Fcopy_sequence (buffer_or_name);
370 STRING_SET_INTERVALS (name, NULL_INTERVAL); 370 STRING_SET_INTERVALS (name, NULL_INTERVAL);
371 B_ (b, name) = name; 371 BVAR (b, name) = name;
372 372
373 B_ (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt; 373 BVAR (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt;
374 374
375 reset_buffer (b); 375 reset_buffer (b);
376 reset_buffer_local_variables (b, 1); 376 reset_buffer_local_variables (b, 1);
377 377
378 B_ (b, mark) = Fmake_marker (); 378 BVAR (b, mark) = Fmake_marker ();
379 BUF_MARKERS (b) = NULL; 379 BUF_MARKERS (b) = NULL;
380 B_ (b, name) = name; 380 BVAR (b, name) = name;
381 381
382 /* Put this in the alist of all live buffers. */ 382 /* Put this in the alist of all live buffers. */
383 XSETBUFFER (buffer, b); 383 XSETBUFFER (buffer, b);
@@ -486,7 +486,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
486 486
487 /* Get (a copy of) the alist of Lisp-level local variables of FROM 487 /* Get (a copy of) the alist of Lisp-level local variables of FROM
488 and install that in TO. */ 488 and install that in TO. */
489 B_ (to, local_var_alist) = buffer_lisp_local_variables (from); 489 BVAR (to, local_var_alist) = buffer_lisp_local_variables (from);
490} 490}
491 491
492DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, 492DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
@@ -512,7 +512,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
512 base_buffer = Fget_buffer (base_buffer); 512 base_buffer = Fget_buffer (base_buffer);
513 if (NILP (base_buffer)) 513 if (NILP (base_buffer))
514 error ("No such buffer: `%s'", SDATA (tem)); 514 error ("No such buffer: `%s'", SDATA (tem));
515 if (NILP (B_ (XBUFFER (base_buffer), name))) 515 if (NILP (BVAR (XBUFFER (base_buffer), name)))
516 error ("Base buffer has been killed"); 516 error ("Base buffer has been killed");
517 517
518 if (SCHARS (name) == 0) 518 if (SCHARS (name) == 0)
@@ -536,7 +536,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
536 536
537 b->newline_cache = 0; 537 b->newline_cache = 0;
538 b->width_run_cache = 0; 538 b->width_run_cache = 0;
539 B_ (b, width_table) = Qnil; 539 BVAR (b, width_table) = Qnil;
540 540
541 /* Put this on the chain of all buffers including killed ones. */ 541 /* Put this on the chain of all buffers including killed ones. */
542 b->next = all_buffers; 542 b->next = all_buffers;
@@ -544,7 +544,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
544 544
545 name = Fcopy_sequence (name); 545 name = Fcopy_sequence (name);
546 STRING_SET_INTERVALS (name, NULL_INTERVAL); 546 STRING_SET_INTERVALS (name, NULL_INTERVAL);
547 B_ (b, name) = name; 547 BVAR (b, name) = name;
548 548
549 reset_buffer (b); 549 reset_buffer (b);
550 reset_buffer_local_variables (b, 1); 550 reset_buffer_local_variables (b, 1);
@@ -553,57 +553,57 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
553 XSETBUFFER (buf, b); 553 XSETBUFFER (buf, b);
554 Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); 554 Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
555 555
556 B_ (b, mark) = Fmake_marker (); 556 BVAR (b, mark) = Fmake_marker ();
557 B_ (b, name) = name; 557 BVAR (b, name) = name;
558 558
559 /* The multibyte status belongs to the base buffer. */ 559 /* The multibyte status belongs to the base buffer. */
560 B_ (b, enable_multibyte_characters) = B_ (b->base_buffer, enable_multibyte_characters); 560 BVAR (b, enable_multibyte_characters) = BVAR (b->base_buffer, enable_multibyte_characters);
561 561
562 /* Make sure the base buffer has markers for its narrowing. */ 562 /* Make sure the base buffer has markers for its narrowing. */
563 if (NILP (B_ (b->base_buffer, pt_marker))) 563 if (NILP (BVAR (b->base_buffer, pt_marker)))
564 { 564 {
565 B_ (b->base_buffer, pt_marker) = Fmake_marker (); 565 BVAR (b->base_buffer, pt_marker) = Fmake_marker ();
566 set_marker_both (B_ (b->base_buffer, pt_marker), base_buffer, 566 set_marker_both (BVAR (b->base_buffer, pt_marker), base_buffer,
567 BUF_PT (b->base_buffer), 567 BUF_PT (b->base_buffer),
568 BUF_PT_BYTE (b->base_buffer)); 568 BUF_PT_BYTE (b->base_buffer));
569 } 569 }
570 if (NILP (B_ (b->base_buffer, begv_marker))) 570 if (NILP (BVAR (b->base_buffer, begv_marker)))
571 { 571 {
572 B_ (b->base_buffer, begv_marker) = Fmake_marker (); 572 BVAR (b->base_buffer, begv_marker) = Fmake_marker ();
573 set_marker_both (B_ (b->base_buffer, begv_marker), base_buffer, 573 set_marker_both (BVAR (b->base_buffer, begv_marker), base_buffer,
574 BUF_BEGV (b->base_buffer), 574 BUF_BEGV (b->base_buffer),
575 BUF_BEGV_BYTE (b->base_buffer)); 575 BUF_BEGV_BYTE (b->base_buffer));
576 } 576 }
577 if (NILP (B_ (b->base_buffer, zv_marker))) 577 if (NILP (BVAR (b->base_buffer, zv_marker)))
578 { 578 {
579 B_ (b->base_buffer, zv_marker) = Fmake_marker (); 579 BVAR (b->base_buffer, zv_marker) = Fmake_marker ();
580 set_marker_both (B_ (b->base_buffer, zv_marker), base_buffer, 580 set_marker_both (BVAR (b->base_buffer, zv_marker), base_buffer,
581 BUF_ZV (b->base_buffer), 581 BUF_ZV (b->base_buffer),
582 BUF_ZV_BYTE (b->base_buffer)); 582 BUF_ZV_BYTE (b->base_buffer));
583 XMARKER (B_ (b->base_buffer, zv_marker))->insertion_type = 1; 583 XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1;
584 } 584 }
585 585
586 if (NILP (clone)) 586 if (NILP (clone))
587 { 587 {
588 /* Give the indirect buffer markers for its narrowing. */ 588 /* Give the indirect buffer markers for its narrowing. */
589 B_ (b, pt_marker) = Fmake_marker (); 589 BVAR (b, pt_marker) = Fmake_marker ();
590 set_marker_both (B_ (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b)); 590 set_marker_both (BVAR (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b));
591 B_ (b, begv_marker) = Fmake_marker (); 591 BVAR (b, begv_marker) = Fmake_marker ();
592 set_marker_both (B_ (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b)); 592 set_marker_both (BVAR (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b));
593 B_ (b, zv_marker) = Fmake_marker (); 593 BVAR (b, zv_marker) = Fmake_marker ();
594 set_marker_both (B_ (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b)); 594 set_marker_both (BVAR (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b));
595 XMARKER (B_ (b, zv_marker))->insertion_type = 1; 595 XMARKER (BVAR (b, zv_marker))->insertion_type = 1;
596 } 596 }
597 else 597 else
598 { 598 {
599 struct buffer *old_b = current_buffer; 599 struct buffer *old_b = current_buffer;
600 600
601 clone_per_buffer_values (b->base_buffer, b); 601 clone_per_buffer_values (b->base_buffer, b);
602 B_ (b, filename) = Qnil; 602 BVAR (b, filename) = Qnil;
603 B_ (b, file_truename) = Qnil; 603 BVAR (b, file_truename) = Qnil;
604 B_ (b, display_count) = make_number (0); 604 BVAR (b, display_count) = make_number (0);
605 B_ (b, backed_up) = Qnil; 605 BVAR (b, backed_up) = Qnil;
606 B_ (b, auto_save_file_name) = Qnil; 606 BVAR (b, auto_save_file_name) = Qnil;
607 set_buffer_internal_1 (b); 607 set_buffer_internal_1 (b);
608 Fset (intern ("buffer-save-without-query"), Qnil); 608 Fset (intern ("buffer-save-without-query"), Qnil);
609 Fset (intern ("buffer-file-number"), Qnil); 609 Fset (intern ("buffer-file-number"), Qnil);
@@ -647,34 +647,34 @@ delete_all_overlays (struct buffer *b)
647void 647void
648reset_buffer (register struct buffer *b) 648reset_buffer (register struct buffer *b)
649{ 649{
650 B_ (b, filename) = Qnil; 650 BVAR (b, filename) = Qnil;
651 B_ (b, file_truename) = Qnil; 651 BVAR (b, file_truename) = Qnil;
652 B_ (b, directory) = (current_buffer) ? B_ (current_buffer, directory) : Qnil; 652 BVAR (b, directory) = (current_buffer) ? BVAR (current_buffer, directory) : Qnil;
653 b->modtime = 0; 653 b->modtime = 0;
654 b->modtime_size = -1; 654 b->modtime_size = -1;
655 XSETFASTINT (B_ (b, save_length), 0); 655 XSETFASTINT (BVAR (b, save_length), 0);
656 b->last_window_start = 1; 656 b->last_window_start = 1;
657 /* It is more conservative to start out "changed" than "unchanged". */ 657 /* It is more conservative to start out "changed" than "unchanged". */
658 b->clip_changed = 0; 658 b->clip_changed = 0;
659 b->prevent_redisplay_optimizations_p = 1; 659 b->prevent_redisplay_optimizations_p = 1;
660 B_ (b, backed_up) = Qnil; 660 BVAR (b, backed_up) = Qnil;
661 BUF_AUTOSAVE_MODIFF (b) = 0; 661 BUF_AUTOSAVE_MODIFF (b) = 0;
662 b->auto_save_failure_time = -1; 662 b->auto_save_failure_time = -1;
663 B_ (b, auto_save_file_name) = Qnil; 663 BVAR (b, auto_save_file_name) = Qnil;
664 B_ (b, read_only) = Qnil; 664 BVAR (b, read_only) = Qnil;
665 b->overlays_before = NULL; 665 b->overlays_before = NULL;
666 b->overlays_after = NULL; 666 b->overlays_after = NULL;
667 b->overlay_center = BEG; 667 b->overlay_center = BEG;
668 B_ (b, mark_active) = Qnil; 668 BVAR (b, mark_active) = Qnil;
669 B_ (b, point_before_scroll) = Qnil; 669 BVAR (b, point_before_scroll) = Qnil;
670 B_ (b, file_format) = Qnil; 670 BVAR (b, file_format) = Qnil;
671 B_ (b, auto_save_file_format) = Qt; 671 BVAR (b, auto_save_file_format) = Qt;
672 B_ (b, last_selected_window) = Qnil; 672 BVAR (b, last_selected_window) = Qnil;
673 XSETINT (B_ (b, display_count), 0); 673 XSETINT (BVAR (b, display_count), 0);
674 B_ (b, display_time) = Qnil; 674 BVAR (b, display_time) = Qnil;
675 B_ (b, enable_multibyte_characters) = B_ (&buffer_defaults, enable_multibyte_characters); 675 BVAR (b, enable_multibyte_characters) = BVAR (&buffer_defaults, enable_multibyte_characters);
676 B_ (b, cursor_type) = B_ (&buffer_defaults, cursor_type); 676 BVAR (b, cursor_type) = BVAR (&buffer_defaults, cursor_type);
677 B_ (b, extra_line_spacing) = B_ (&buffer_defaults, extra_line_spacing); 677 BVAR (b, extra_line_spacing) = BVAR (&buffer_defaults, extra_line_spacing);
678 678
679 b->display_error_modiff = 0; 679 b->display_error_modiff = 0;
680} 680}
@@ -698,10 +698,10 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
698 things that depend on the major mode. 698 things that depend on the major mode.
699 default-major-mode is handled at a higher level. 699 default-major-mode is handled at a higher level.
700 We ignore it here. */ 700 We ignore it here. */
701 B_ (b, major_mode) = Qfundamental_mode; 701 BVAR (b, major_mode) = Qfundamental_mode;
702 B_ (b, keymap) = Qnil; 702 BVAR (b, keymap) = Qnil;
703 B_ (b, mode_name) = QSFundamental; 703 BVAR (b, mode_name) = QSFundamental;
704 B_ (b, minor_modes) = Qnil; 704 BVAR (b, minor_modes) = Qnil;
705 705
706 /* If the standard case table has been altered and invalidated, 706 /* If the standard case table has been altered and invalidated,
707 fix up its insides first. */ 707 fix up its insides first. */
@@ -710,22 +710,19 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
710 && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2]))) 710 && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2])))
711 Fset_standard_case_table (Vascii_downcase_table); 711 Fset_standard_case_table (Vascii_downcase_table);
712 712
713 B_ (b, downcase_table) = Vascii_downcase_table; 713 BVAR (b, downcase_table) = Vascii_downcase_table;
714 B_ (b, upcase_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[0]; 714 BVAR (b, upcase_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[0];
715 B_ (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1]; 715 BVAR (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
716 B_ (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2]; 716 BVAR (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2];
717 B_ (b, invisibility_spec) = Qt; 717 BVAR (b, invisibility_spec) = Qt;
718#ifndef DOS_NT
719 B_ (b, buffer_file_type) = Qnil;
720#endif
721 718
722 /* Reset all (or most) per-buffer variables to their defaults. */ 719 /* Reset all (or most) per-buffer variables to their defaults. */
723 if (permanent_too) 720 if (permanent_too)
724 B_ (b, local_var_alist) = Qnil; 721 BVAR (b, local_var_alist) = Qnil;
725 else 722 else
726 { 723 {
727 Lisp_Object tmp, prop, last = Qnil; 724 Lisp_Object tmp, prop, last = Qnil;
728 for (tmp = B_ (b, local_var_alist); CONSP (tmp); tmp = XCDR (tmp)) 725 for (tmp = BVAR (b, local_var_alist); CONSP (tmp); tmp = XCDR (tmp))
729 if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local))) 726 if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local)))
730 { 727 {
731 /* If permanent-local, keep it. */ 728 /* If permanent-local, keep it. */
@@ -755,7 +752,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
755 } 752 }
756 /* Delete this local variable. */ 753 /* Delete this local variable. */
757 else if (NILP (last)) 754 else if (NILP (last))
758 B_ (b, local_var_alist) = XCDR (tmp); 755 BVAR (b, local_var_alist) = XCDR (tmp);
759 else 756 else
760 XSETCDR (last, XCDR (tmp)); 757 XSETCDR (last, XCDR (tmp));
761 } 758 }
@@ -830,9 +827,9 @@ Return nil if BUFFER has been killed. */)
830 (register Lisp_Object buffer) 827 (register Lisp_Object buffer)
831{ 828{
832 if (NILP (buffer)) 829 if (NILP (buffer))
833 return B_ (current_buffer, name); 830 return BVAR (current_buffer, name);
834 CHECK_BUFFER (buffer); 831 CHECK_BUFFER (buffer);
835 return B_ (XBUFFER (buffer), name); 832 return BVAR (XBUFFER (buffer), name);
836} 833}
837 834
838DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0, 835DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0,
@@ -841,9 +838,9 @@ No argument or nil as argument means use the current buffer. */)
841 (register Lisp_Object buffer) 838 (register Lisp_Object buffer)
842{ 839{
843 if (NILP (buffer)) 840 if (NILP (buffer))
844 return B_ (current_buffer, filename); 841 return BVAR (current_buffer, filename);
845 CHECK_BUFFER (buffer); 842 CHECK_BUFFER (buffer);
846 return B_ (XBUFFER (buffer), filename); 843 return BVAR (XBUFFER (buffer), filename);
847} 844}
848 845
849DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer, 846DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer,
@@ -895,7 +892,7 @@ is the default binding of the variable. */)
895 { /* Look in local_var_alist. */ 892 { /* Look in local_var_alist. */
896 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); 893 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
897 XSETSYMBOL (variable, sym); /* Update In case of aliasing. */ 894 XSETSYMBOL (variable, sym); /* Update In case of aliasing. */
898 result = Fassoc (variable, B_ (buf, local_var_alist)); 895 result = Fassoc (variable, BVAR (buf, local_var_alist));
899 if (!NILP (result)) 896 if (!NILP (result))
900 { 897 {
901 if (blv->fwd) 898 if (blv->fwd)
@@ -944,7 +941,7 @@ buffer_lisp_local_variables (struct buffer *buf)
944{ 941{
945 Lisp_Object result = Qnil; 942 Lisp_Object result = Qnil;
946 register Lisp_Object tail; 943 register Lisp_Object tail;
947 for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) 944 for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
948 { 945 {
949 Lisp_Object val, elt; 946 Lisp_Object val, elt;
950 947
@@ -1043,9 +1040,9 @@ A non-nil FLAG means mark the buffer modified. */)
1043 /* If buffer becoming modified, lock the file. 1040 /* If buffer becoming modified, lock the file.
1044 If buffer becoming unmodified, unlock the file. */ 1041 If buffer becoming unmodified, unlock the file. */
1045 1042
1046 fn = B_ (current_buffer, file_truename); 1043 fn = BVAR (current_buffer, file_truename);
1047 /* Test buffer-file-name so that binding it to nil is effective. */ 1044 /* Test buffer-file-name so that binding it to nil is effective. */
1048 if (!NILP (fn) && ! NILP (B_ (current_buffer, filename))) 1045 if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename)))
1049 { 1046 {
1050 already = SAVE_MODIFF < MODIFF; 1047 already = SAVE_MODIFF < MODIFF;
1051 if (!already && !NILP (flag)) 1048 if (!already && !NILP (flag))
@@ -1110,9 +1107,9 @@ state of the current buffer. Use with care. */)
1110 /* If buffer becoming modified, lock the file. 1107 /* If buffer becoming modified, lock the file.
1111 If buffer becoming unmodified, unlock the file. */ 1108 If buffer becoming unmodified, unlock the file. */
1112 1109
1113 fn = B_ (current_buffer, file_truename); 1110 fn = BVAR (current_buffer, file_truename);
1114 /* Test buffer-file-name so that binding it to nil is effective. */ 1111 /* Test buffer-file-name so that binding it to nil is effective. */
1115 if (!NILP (fn) && ! NILP (B_ (current_buffer, filename))) 1112 if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename)))
1116 { 1113 {
1117 int already = SAVE_MODIFF < MODIFF; 1114 int already = SAVE_MODIFF < MODIFF;
1118 if (!already && !NILP (flag)) 1115 if (!already && !NILP (flag))
@@ -1199,14 +1196,14 @@ This does not change the name of the visited file (if any). */)
1199 with the original name. It makes UNIQUE equivalent to 1196 with the original name. It makes UNIQUE equivalent to
1200 (rename-buffer (generate-new-buffer-name NEWNAME)). */ 1197 (rename-buffer (generate-new-buffer-name NEWNAME)). */
1201 if (NILP (unique) && XBUFFER (tem) == current_buffer) 1198 if (NILP (unique) && XBUFFER (tem) == current_buffer)
1202 return B_ (current_buffer, name); 1199 return BVAR (current_buffer, name);
1203 if (!NILP (unique)) 1200 if (!NILP (unique))
1204 newname = Fgenerate_new_buffer_name (newname, B_ (current_buffer, name)); 1201 newname = Fgenerate_new_buffer_name (newname, BVAR (current_buffer, name));
1205 else 1202 else
1206 error ("Buffer name `%s' is in use", SDATA (newname)); 1203 error ("Buffer name `%s' is in use", SDATA (newname));
1207 } 1204 }
1208 1205
1209 B_ (current_buffer, name) = newname; 1206 BVAR (current_buffer, name) = newname;
1210 1207
1211 /* Catch redisplay's attention. Unless we do this, the mode lines for 1208 /* Catch redisplay's attention. Unless we do this, the mode lines for
1212 any windows displaying current_buffer will stay unchanged. */ 1209 any windows displaying current_buffer will stay unchanged. */
@@ -1214,11 +1211,11 @@ This does not change the name of the visited file (if any). */)
1214 1211
1215 XSETBUFFER (buf, current_buffer); 1212 XSETBUFFER (buf, current_buffer);
1216 Fsetcar (Frassq (buf, Vbuffer_alist), newname); 1213 Fsetcar (Frassq (buf, Vbuffer_alist), newname);
1217 if (NILP (B_ (current_buffer, filename)) 1214 if (NILP (BVAR (current_buffer, filename))
1218 && !NILP (B_ (current_buffer, auto_save_file_name))) 1215 && !NILP (BVAR (current_buffer, auto_save_file_name)))
1219 call0 (intern ("rename-auto-save-file")); 1216 call0 (intern ("rename-auto-save-file"));
1220 /* Refetch since that last call may have done GC. */ 1217 /* Refetch since that last call may have done GC. */
1221 return B_ (current_buffer, name); 1218 return BVAR (current_buffer, name);
1222} 1219}
1223 1220
1224DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0, 1221DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0,
@@ -1263,9 +1260,9 @@ If BUFFER is omitted or nil, some interesting buffer is returned. */)
1263 continue; 1260 continue;
1264 if (NILP (buf)) 1261 if (NILP (buf))
1265 continue; 1262 continue;
1266 if (NILP (B_ (XBUFFER (buf), name))) 1263 if (NILP (BVAR (XBUFFER (buf), name)))
1267 continue; 1264 continue;
1268 if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') 1265 if (SREF (BVAR (XBUFFER (buf), name), 0) == ' ')
1269 continue; 1266 continue;
1270 /* If the selected frame has a buffer_predicate, 1267 /* If the selected frame has a buffer_predicate,
1271 disregard buffers that don't fit the predicate. */ 1268 disregard buffers that don't fit the predicate. */
@@ -1313,8 +1310,8 @@ No argument or nil as argument means do this for the current buffer. */)
1313 nsberror (buffer); 1310 nsberror (buffer);
1314 } 1311 }
1315 1312
1316 if (EQ (B_ (XBUFFER (real_buffer), undo_list), Qt)) 1313 if (EQ (BVAR (XBUFFER (real_buffer), undo_list), Qt))
1317 B_ (XBUFFER (real_buffer), undo_list) = Qnil; 1314 BVAR (XBUFFER (real_buffer), undo_list) = Qnil;
1318 1315
1319 return Qnil; 1316 return Qnil;
1320} 1317}
@@ -1359,16 +1356,16 @@ with SIGHUP. */)
1359 b = XBUFFER (buffer); 1356 b = XBUFFER (buffer);
1360 1357
1361 /* Avoid trouble for buffer already dead. */ 1358 /* Avoid trouble for buffer already dead. */
1362 if (NILP (B_ (b, name))) 1359 if (NILP (BVAR (b, name)))
1363 return Qnil; 1360 return Qnil;
1364 1361
1365 /* Query if the buffer is still modified. */ 1362 /* Query if the buffer is still modified. */
1366 if (INTERACTIVE && !NILP (B_ (b, filename)) 1363 if (INTERACTIVE && !NILP (BVAR (b, filename))
1367 && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) 1364 && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
1368 { 1365 {
1369 GCPRO1 (buffer); 1366 GCPRO1 (buffer);
1370 tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ", 1367 tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
1371 B_ (b, name), make_number (0))); 1368 BVAR (b, name), make_number (0)));
1372 UNGCPRO; 1369 UNGCPRO;
1373 if (NILP (tem)) 1370 if (NILP (tem))
1374 return Qnil; 1371 return Qnil;
@@ -1402,7 +1399,7 @@ with SIGHUP. */)
1402 if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) 1399 if (EQ (buffer, XWINDOW (minibuf_window)->buffer))
1403 return Qnil; 1400 return Qnil;
1404 1401
1405 if (NILP (B_ (b, name))) 1402 if (NILP (BVAR (b, name)))
1406 return Qnil; 1403 return Qnil;
1407 1404
1408 /* When we kill a base buffer, kill all its indirect buffers. 1405 /* When we kill a base buffer, kill all its indirect buffers.
@@ -1417,7 +1414,7 @@ with SIGHUP. */)
1417 for (other = all_buffers; other; other = other->next) 1414 for (other = all_buffers; other; other = other->next)
1418 /* all_buffers contains dead buffers too; 1415 /* all_buffers contains dead buffers too;
1419 don't re-kill them. */ 1416 don't re-kill them. */
1420 if (other->base_buffer == b && !NILP (B_ (other, name))) 1417 if (other->base_buffer == b && !NILP (BVAR (other, name)))
1421 { 1418 {
1422 Lisp_Object buffer; 1419 Lisp_Object buffer;
1423 XSETBUFFER (buffer, other); 1420 XSETBUFFER (buffer, other);
@@ -1462,7 +1459,7 @@ with SIGHUP. */)
1462 /* Killing buffer processes may run sentinels which may 1459 /* Killing buffer processes may run sentinels which may
1463 have called kill-buffer. */ 1460 have called kill-buffer. */
1464 1461
1465 if (NILP (B_ (b, name))) 1462 if (NILP (BVAR (b, name)))
1466 return Qnil; 1463 return Qnil;
1467 1464
1468 clear_charpos_cache (b); 1465 clear_charpos_cache (b);
@@ -1476,7 +1473,7 @@ with SIGHUP. */)
1476 1473
1477 /* Delete any auto-save file, if we saved it in this session. 1474 /* Delete any auto-save file, if we saved it in this session.
1478 But not if the buffer is modified. */ 1475 But not if the buffer is modified. */
1479 if (STRINGP (B_ (b, auto_save_file_name)) 1476 if (STRINGP (BVAR (b, auto_save_file_name))
1480 && BUF_AUTOSAVE_MODIFF (b) != 0 1477 && BUF_AUTOSAVE_MODIFF (b) != 0
1481 && BUF_SAVE_MODIFF (b) < BUF_AUTOSAVE_MODIFF (b) 1478 && BUF_SAVE_MODIFF (b) < BUF_AUTOSAVE_MODIFF (b)
1482 && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) 1479 && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
@@ -1485,7 +1482,7 @@ with SIGHUP. */)
1485 Lisp_Object tem; 1482 Lisp_Object tem;
1486 tem = Fsymbol_value (intern ("delete-auto-save-files")); 1483 tem = Fsymbol_value (intern ("delete-auto-save-files"));
1487 if (! NILP (tem)) 1484 if (! NILP (tem))
1488 internal_delete_file (B_ (b, auto_save_file_name)); 1485 internal_delete_file (BVAR (b, auto_save_file_name));
1489 } 1486 }
1490 1487
1491 if (b->base_buffer) 1488 if (b->base_buffer)
@@ -1525,7 +1522,7 @@ with SIGHUP. */)
1525 swap_out_buffer_local_variables (b); 1522 swap_out_buffer_local_variables (b);
1526 reset_buffer_local_variables (b, 1); 1523 reset_buffer_local_variables (b, 1);
1527 1524
1528 B_ (b, name) = Qnil; 1525 BVAR (b, name) = Qnil;
1529 1526
1530 BLOCK_INPUT; 1527 BLOCK_INPUT;
1531 if (! b->base_buffer) 1528 if (! b->base_buffer)
@@ -1541,9 +1538,9 @@ with SIGHUP. */)
1541 free_region_cache (b->width_run_cache); 1538 free_region_cache (b->width_run_cache);
1542 b->width_run_cache = 0; 1539 b->width_run_cache = 0;
1543 } 1540 }
1544 B_ (b, width_table) = Qnil; 1541 BVAR (b, width_table) = Qnil;
1545 UNBLOCK_INPUT; 1542 UNBLOCK_INPUT;
1546 B_ (b, undo_list) = Qnil; 1543 BVAR (b, undo_list) = Qnil;
1547 1544
1548 return Qt; 1545 return Qt;
1549} 1546}
@@ -1637,15 +1634,15 @@ the current buffer's major mode. */)
1637 1634
1638 CHECK_BUFFER (buffer); 1635 CHECK_BUFFER (buffer);
1639 1636
1640 if (STRINGP (B_ (XBUFFER (buffer), name)) 1637 if (STRINGP (BVAR (XBUFFER (buffer), name))
1641 && strcmp (SSDATA (B_ (XBUFFER (buffer), name)), "*scratch*") == 0) 1638 && strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0)
1642 function = find_symbol_value (intern ("initial-major-mode")); 1639 function = find_symbol_value (intern ("initial-major-mode"));
1643 else 1640 else
1644 { 1641 {
1645 function = B_ (&buffer_defaults, major_mode); 1642 function = BVAR (&buffer_defaults, major_mode);
1646 if (NILP (function) 1643 if (NILP (function)
1647 && NILP (Fget (B_ (current_buffer, major_mode), Qmode_class))) 1644 && NILP (Fget (BVAR (current_buffer, major_mode), Qmode_class)))
1648 function = B_ (current_buffer, major_mode); 1645 function = BVAR (current_buffer, major_mode);
1649 } 1646 }
1650 1647
1651 if (NILP (function) || EQ (function, Qfundamental_mode)) 1648 if (NILP (function) || EQ (function, Qfundamental_mode))
@@ -1795,29 +1792,29 @@ set_buffer_internal_1 (register struct buffer *b)
1795 /* Put the undo list back in the base buffer, so that it appears 1792 /* Put the undo list back in the base buffer, so that it appears
1796 that an indirect buffer shares the undo list of its base. */ 1793 that an indirect buffer shares the undo list of its base. */
1797 if (old_buf->base_buffer) 1794 if (old_buf->base_buffer)
1798 B_ (old_buf->base_buffer, undo_list) = B_ (old_buf, undo_list); 1795 BVAR (old_buf->base_buffer, undo_list) = BVAR (old_buf, undo_list);
1799 1796
1800 /* If the old current buffer has markers to record PT, BEGV and ZV 1797 /* If the old current buffer has markers to record PT, BEGV and ZV
1801 when it is not current, update them now. */ 1798 when it is not current, update them now. */
1802 if (! NILP (B_ (old_buf, pt_marker))) 1799 if (! NILP (BVAR (old_buf, pt_marker)))
1803 { 1800 {
1804 Lisp_Object obuf; 1801 Lisp_Object obuf;
1805 XSETBUFFER (obuf, old_buf); 1802 XSETBUFFER (obuf, old_buf);
1806 set_marker_both (B_ (old_buf, pt_marker), obuf, 1803 set_marker_both (BVAR (old_buf, pt_marker), obuf,
1807 BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); 1804 BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
1808 } 1805 }
1809 if (! NILP (B_ (old_buf, begv_marker))) 1806 if (! NILP (BVAR (old_buf, begv_marker)))
1810 { 1807 {
1811 Lisp_Object obuf; 1808 Lisp_Object obuf;
1812 XSETBUFFER (obuf, old_buf); 1809 XSETBUFFER (obuf, old_buf);
1813 set_marker_both (B_ (old_buf, begv_marker), obuf, 1810 set_marker_both (BVAR (old_buf, begv_marker), obuf,
1814 BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); 1811 BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
1815 } 1812 }
1816 if (! NILP (B_ (old_buf, zv_marker))) 1813 if (! NILP (BVAR (old_buf, zv_marker)))
1817 { 1814 {
1818 Lisp_Object obuf; 1815 Lisp_Object obuf;
1819 XSETBUFFER (obuf, old_buf); 1816 XSETBUFFER (obuf, old_buf);
1820 set_marker_both (B_ (old_buf, zv_marker), obuf, 1817 set_marker_both (BVAR (old_buf, zv_marker), obuf,
1821 BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); 1818 BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
1822 } 1819 }
1823 } 1820 }
@@ -1825,24 +1822,24 @@ set_buffer_internal_1 (register struct buffer *b)
1825 /* Get the undo list from the base buffer, so that it appears 1822 /* Get the undo list from the base buffer, so that it appears
1826 that an indirect buffer shares the undo list of its base. */ 1823 that an indirect buffer shares the undo list of its base. */
1827 if (b->base_buffer) 1824 if (b->base_buffer)
1828 B_ (b, undo_list) = B_ (b->base_buffer, undo_list); 1825 BVAR (b, undo_list) = BVAR (b->base_buffer, undo_list);
1829 1826
1830 /* If the new current buffer has markers to record PT, BEGV and ZV 1827 /* If the new current buffer has markers to record PT, BEGV and ZV
1831 when it is not current, fetch them now. */ 1828 when it is not current, fetch them now. */
1832 if (! NILP (B_ (b, pt_marker))) 1829 if (! NILP (BVAR (b, pt_marker)))
1833 { 1830 {
1834 BUF_PT (b) = marker_position (B_ (b, pt_marker)); 1831 BUF_PT (b) = marker_position (BVAR (b, pt_marker));
1835 BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker)); 1832 BUF_PT_BYTE (b) = marker_byte_position (BVAR (b, pt_marker));
1836 } 1833 }
1837 if (! NILP (B_ (b, begv_marker))) 1834 if (! NILP (BVAR (b, begv_marker)))
1838 { 1835 {
1839 BUF_BEGV (b) = marker_position (B_ (b, begv_marker)); 1836 BUF_BEGV (b) = marker_position (BVAR (b, begv_marker));
1840 BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker)); 1837 BUF_BEGV_BYTE (b) = marker_byte_position (BVAR (b, begv_marker));
1841 } 1838 }
1842 if (! NILP (B_ (b, zv_marker))) 1839 if (! NILP (BVAR (b, zv_marker)))
1843 { 1840 {
1844 BUF_ZV (b) = marker_position (B_ (b, zv_marker)); 1841 BUF_ZV (b) = marker_position (BVAR (b, zv_marker));
1845 BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker)); 1842 BUF_ZV_BYTE (b) = marker_byte_position (BVAR (b, zv_marker));
1846 } 1843 }
1847 1844
1848 /* Look down buffer's list of local Lisp variables 1845 /* Look down buffer's list of local Lisp variables
@@ -1850,7 +1847,7 @@ set_buffer_internal_1 (register struct buffer *b)
1850 1847
1851 do 1848 do
1852 { 1849 {
1853 for (tail = B_ (b, local_var_alist); CONSP (tail); tail = XCDR (tail)) 1850 for (tail = BVAR (b, local_var_alist); CONSP (tail); tail = XCDR (tail))
1854 { 1851 {
1855 Lisp_Object var = XCAR (XCAR (tail)); 1852 Lisp_Object var = XCAR (XCAR (tail));
1856 struct Lisp_Symbol *sym = XSYMBOL (var); 1853 struct Lisp_Symbol *sym = XSYMBOL (var);
@@ -1883,45 +1880,45 @@ set_buffer_temp (struct buffer *b)
1883 { 1880 {
1884 /* If the old current buffer has markers to record PT, BEGV and ZV 1881 /* If the old current buffer has markers to record PT, BEGV and ZV
1885 when it is not current, update them now. */ 1882 when it is not current, update them now. */
1886 if (! NILP (B_ (old_buf, pt_marker))) 1883 if (! NILP (BVAR (old_buf, pt_marker)))
1887 { 1884 {
1888 Lisp_Object obuf; 1885 Lisp_Object obuf;
1889 XSETBUFFER (obuf, old_buf); 1886 XSETBUFFER (obuf, old_buf);
1890 set_marker_both (B_ (old_buf, pt_marker), obuf, 1887 set_marker_both (BVAR (old_buf, pt_marker), obuf,
1891 BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); 1888 BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
1892 } 1889 }
1893 if (! NILP (B_ (old_buf, begv_marker))) 1890 if (! NILP (BVAR (old_buf, begv_marker)))
1894 { 1891 {
1895 Lisp_Object obuf; 1892 Lisp_Object obuf;
1896 XSETBUFFER (obuf, old_buf); 1893 XSETBUFFER (obuf, old_buf);
1897 set_marker_both (B_ (old_buf, begv_marker), obuf, 1894 set_marker_both (BVAR (old_buf, begv_marker), obuf,
1898 BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); 1895 BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
1899 } 1896 }
1900 if (! NILP (B_ (old_buf, zv_marker))) 1897 if (! NILP (BVAR (old_buf, zv_marker)))
1901 { 1898 {
1902 Lisp_Object obuf; 1899 Lisp_Object obuf;
1903 XSETBUFFER (obuf, old_buf); 1900 XSETBUFFER (obuf, old_buf);
1904 set_marker_both (B_ (old_buf, zv_marker), obuf, 1901 set_marker_both (BVAR (old_buf, zv_marker), obuf,
1905 BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); 1902 BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
1906 } 1903 }
1907 } 1904 }
1908 1905
1909 /* If the new current buffer has markers to record PT, BEGV and ZV 1906 /* If the new current buffer has markers to record PT, BEGV and ZV
1910 when it is not current, fetch them now. */ 1907 when it is not current, fetch them now. */
1911 if (! NILP (B_ (b, pt_marker))) 1908 if (! NILP (BVAR (b, pt_marker)))
1912 { 1909 {
1913 BUF_PT (b) = marker_position (B_ (b, pt_marker)); 1910 BUF_PT (b) = marker_position (BVAR (b, pt_marker));
1914 BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker)); 1911 BUF_PT_BYTE (b) = marker_byte_position (BVAR (b, pt_marker));
1915 } 1912 }
1916 if (! NILP (B_ (b, begv_marker))) 1913 if (! NILP (BVAR (b, begv_marker)))
1917 { 1914 {
1918 BUF_BEGV (b) = marker_position (B_ (b, begv_marker)); 1915 BUF_BEGV (b) = marker_position (BVAR (b, begv_marker));
1919 BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker)); 1916 BUF_BEGV_BYTE (b) = marker_byte_position (BVAR (b, begv_marker));
1920 } 1917 }
1921 if (! NILP (B_ (b, zv_marker))) 1918 if (! NILP (BVAR (b, zv_marker)))
1922 { 1919 {
1923 BUF_ZV (b) = marker_position (B_ (b, zv_marker)); 1920 BUF_ZV (b) = marker_position (BVAR (b, zv_marker));
1924 BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker)); 1921 BUF_ZV_BYTE (b) = marker_byte_position (BVAR (b, zv_marker));
1925 } 1922 }
1926} 1923}
1927 1924
@@ -1938,7 +1935,7 @@ ends when the current command terminates. Use `switch-to-buffer' or
1938 buffer = Fget_buffer (buffer_or_name); 1935 buffer = Fget_buffer (buffer_or_name);
1939 if (NILP (buffer)) 1936 if (NILP (buffer))
1940 nsberror (buffer_or_name); 1937 nsberror (buffer_or_name);
1941 if (NILP (B_ (XBUFFER (buffer), name))) 1938 if (NILP (BVAR (XBUFFER (buffer), name)))
1942 error ("Selecting deleted buffer"); 1939 error ("Selecting deleted buffer");
1943 set_buffer_internal (XBUFFER (buffer)); 1940 set_buffer_internal (XBUFFER (buffer));
1944 return buffer; 1941 return buffer;
@@ -1949,7 +1946,7 @@ ends when the current command terminates. Use `switch-to-buffer' or
1949Lisp_Object 1946Lisp_Object
1950set_buffer_if_live (Lisp_Object buffer) 1947set_buffer_if_live (Lisp_Object buffer)
1951{ 1948{
1952 if (! NILP (B_ (XBUFFER (buffer), name))) 1949 if (! NILP (BVAR (XBUFFER (buffer), name)))
1953 Fset_buffer (buffer); 1950 Fset_buffer (buffer);
1954 return Qnil; 1951 return Qnil;
1955} 1952}
@@ -1959,7 +1956,7 @@ DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only,
1959 doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) 1956 doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */)
1960 (void) 1957 (void)
1961{ 1958{
1962 if (!NILP (B_ (current_buffer, read_only)) 1959 if (!NILP (BVAR (current_buffer, read_only))
1963 && NILP (Vinhibit_read_only)) 1960 && NILP (Vinhibit_read_only))
1964 xsignal1 (Qbuffer_read_only, Fcurrent_buffer ()); 1961 xsignal1 (Qbuffer_read_only, Fcurrent_buffer ());
1965 return Qnil; 1962 return Qnil;
@@ -2008,7 +2005,7 @@ its frame, iconify that frame. */)
2008 2005
2009 /* Move buffer to the end of the buffer list. Do nothing if the 2006 /* Move buffer to the end of the buffer list. Do nothing if the
2010 buffer is killed. */ 2007 buffer is killed. */
2011 if (!NILP (B_ (XBUFFER (buffer), name))) 2008 if (!NILP (BVAR (XBUFFER (buffer), name)))
2012 { 2009 {
2013 Lisp_Object aelt, link; 2010 Lisp_Object aelt, link;
2014 2011
@@ -2041,7 +2038,7 @@ so the buffer is truly empty after this. */)
2041 /* Prevent warnings, or suspension of auto saving, that would happen 2038 /* Prevent warnings, or suspension of auto saving, that would happen
2042 if future size is less than past size. Use of erase-buffer 2039 if future size is less than past size. Use of erase-buffer
2043 implies that the future text is not really related to the past text. */ 2040 implies that the future text is not really related to the past text. */
2044 XSETFASTINT (B_ (current_buffer, save_length), 0); 2041 XSETFASTINT (BVAR (current_buffer, save_length), 0);
2045 return Qnil; 2042 return Qnil;
2046} 2043}
2047 2044
@@ -2111,7 +2108,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2111 CHECK_BUFFER (buffer); 2108 CHECK_BUFFER (buffer);
2112 other_buffer = XBUFFER (buffer); 2109 other_buffer = XBUFFER (buffer);
2113 2110
2114 if (NILP (B_ (other_buffer, name))) 2111 if (NILP (BVAR (other_buffer, name)))
2115 error ("Cannot swap a dead buffer's text"); 2112 error ("Cannot swap a dead buffer's text");
2116 2113
2117 /* Actually, it probably works just fine. 2114 /* Actually, it probably works just fine.
@@ -2140,9 +2137,9 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2140 } while (0) 2137 } while (0)
2141#define swapfield_(field, type) \ 2138#define swapfield_(field, type) \
2142 do { \ 2139 do { \
2143 type tmp##field = B_ (other_buffer, field); \ 2140 type tmp##field = BVAR (other_buffer, field); \
2144 B_ (other_buffer, field) = B_ (current_buffer, field); \ 2141 BVAR (other_buffer, field) = BVAR (current_buffer, field); \
2145 B_ (current_buffer, field) = tmp##field; \ 2142 BVAR (current_buffer, field) = tmp##field; \
2146 } while (0) 2143 } while (0)
2147 2144
2148 swapfield (own_text, struct buffer_text); 2145 swapfield (own_text, struct buffer_text);
@@ -2181,8 +2178,8 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2181 swapfield_ (pt_marker, Lisp_Object); 2178 swapfield_ (pt_marker, Lisp_Object);
2182 swapfield_ (begv_marker, Lisp_Object); 2179 swapfield_ (begv_marker, Lisp_Object);
2183 swapfield_ (zv_marker, Lisp_Object); 2180 swapfield_ (zv_marker, Lisp_Object);
2184 B_ (current_buffer, point_before_scroll) = Qnil; 2181 BVAR (current_buffer, point_before_scroll) = Qnil;
2185 B_ (other_buffer, point_before_scroll) = Qnil; 2182 BVAR (other_buffer, point_before_scroll) = Qnil;
2186 2183
2187 current_buffer->text->modiff++; other_buffer->text->modiff++; 2184 current_buffer->text->modiff++; other_buffer->text->modiff++;
2188 current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++; 2185 current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++;
@@ -2256,21 +2253,21 @@ current buffer is cleared. */)
2256 EMACS_INT begv, zv; 2253 EMACS_INT begv, zv;
2257 int narrowed = (BEG != BEGV || Z != ZV); 2254 int narrowed = (BEG != BEGV || Z != ZV);
2258 int modified_p = !NILP (Fbuffer_modified_p (Qnil)); 2255 int modified_p = !NILP (Fbuffer_modified_p (Qnil));
2259 Lisp_Object old_undo = B_ (current_buffer, undo_list); 2256 Lisp_Object old_undo = BVAR (current_buffer, undo_list);
2260 struct gcpro gcpro1; 2257 struct gcpro gcpro1;
2261 2258
2262 if (current_buffer->base_buffer) 2259 if (current_buffer->base_buffer)
2263 error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); 2260 error ("Cannot do `set-buffer-multibyte' on an indirect buffer");
2264 2261
2265 /* Do nothing if nothing actually changes. */ 2262 /* Do nothing if nothing actually changes. */
2266 if (NILP (flag) == NILP (B_ (current_buffer, enable_multibyte_characters))) 2263 if (NILP (flag) == NILP (BVAR (current_buffer, enable_multibyte_characters)))
2267 return flag; 2264 return flag;
2268 2265
2269 GCPRO1 (old_undo); 2266 GCPRO1 (old_undo);
2270 2267
2271 /* Don't record these buffer changes. We will put a special undo entry 2268 /* Don't record these buffer changes. We will put a special undo entry
2272 instead. */ 2269 instead. */
2273 B_ (current_buffer, undo_list) = Qt; 2270 BVAR (current_buffer, undo_list) = Qt;
2274 2271
2275 /* If the cached position is for this buffer, clear it out. */ 2272 /* If the cached position is for this buffer, clear it out. */
2276 clear_charpos_cache (current_buffer); 2273 clear_charpos_cache (current_buffer);
@@ -2292,7 +2289,7 @@ current buffer is cleared. */)
2292 to calculate the old correspondences. */ 2289 to calculate the old correspondences. */
2293 set_intervals_multibyte (0); 2290 set_intervals_multibyte (0);
2294 2291
2295 B_ (current_buffer, enable_multibyte_characters) = Qnil; 2292 BVAR (current_buffer, enable_multibyte_characters) = Qnil;
2296 2293
2297 Z = Z_BYTE; 2294 Z = Z_BYTE;
2298 BEGV = BEGV_BYTE; 2295 BEGV = BEGV_BYTE;
@@ -2430,7 +2427,7 @@ current buffer is cleared. */)
2430 2427
2431 /* Do this first, so that chars_in_text asks the right question. 2428 /* Do this first, so that chars_in_text asks the right question.
2432 set_intervals_multibyte needs it too. */ 2429 set_intervals_multibyte needs it too. */
2433 B_ (current_buffer, enable_multibyte_characters) = Qt; 2430 BVAR (current_buffer, enable_multibyte_characters) = Qt;
2434 2431
2435 GPT_BYTE = advance_to_char_boundary (GPT_BYTE); 2432 GPT_BYTE = advance_to_char_boundary (GPT_BYTE);
2436 GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG; 2433 GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG;
@@ -2488,7 +2485,7 @@ current buffer is cleared. */)
2488 if (!EQ (old_undo, Qt)) 2485 if (!EQ (old_undo, Qt))
2489 { 2486 {
2490 /* Represent all the above changes by a special undo entry. */ 2487 /* Represent all the above changes by a special undo entry. */
2491 B_ (current_buffer, undo_list) = Fcons (list3 (Qapply, 2488 BVAR (current_buffer, undo_list) = Fcons (list3 (Qapply,
2492 intern ("set-buffer-multibyte"), 2489 intern ("set-buffer-multibyte"),
2493 NILP (flag) ? Qt : Qnil), 2490 NILP (flag) ? Qt : Qnil),
2494 old_undo); 2491 old_undo);
@@ -2504,10 +2501,10 @@ current buffer is cleared. */)
2504 /* Copy this buffer's new multibyte status 2501 /* Copy this buffer's new multibyte status
2505 into all of its indirect buffers. */ 2502 into all of its indirect buffers. */
2506 for (other = all_buffers; other; other = other->next) 2503 for (other = all_buffers; other; other = other->next)
2507 if (other->base_buffer == current_buffer && !NILP (B_ (other, name))) 2504 if (other->base_buffer == current_buffer && !NILP (BVAR (other, name)))
2508 { 2505 {
2509 B_ (other, enable_multibyte_characters) 2506 BVAR (other, enable_multibyte_characters)
2510 = B_ (current_buffer, enable_multibyte_characters); 2507 = BVAR (current_buffer, enable_multibyte_characters);
2511 other->prevent_redisplay_optimizations_p = 1; 2508 other->prevent_redisplay_optimizations_p = 1;
2512 } 2509 }
2513 2510
@@ -2574,7 +2571,7 @@ swap_out_buffer_local_variables (struct buffer *b)
2574 Lisp_Object oalist, alist, buffer; 2571 Lisp_Object oalist, alist, buffer;
2575 2572
2576 XSETBUFFER (buffer, b); 2573 XSETBUFFER (buffer, b);
2577 oalist = B_ (b, local_var_alist); 2574 oalist = BVAR (b, local_var_alist);
2578 2575
2579 for (alist = oalist; CONSP (alist); alist = XCDR (alist)) 2576 for (alist = oalist; CONSP (alist); alist = XCDR (alist))
2580 { 2577 {
@@ -3078,7 +3075,7 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str
3078 ssl->buf[ssl->used].priority = (INTEGERP (pri) ? XINT (pri) : 0); 3075 ssl->buf[ssl->used].priority = (INTEGERP (pri) ? XINT (pri) : 0);
3079 ssl->used++; 3076 ssl->used++;
3080 3077
3081 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 3078 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
3082 nbytes = SCHARS (str); 3079 nbytes = SCHARS (str);
3083 else if (! STRING_MULTIBYTE (str)) 3080 else if (! STRING_MULTIBYTE (str))
3084 nbytes = count_size_as_multibyte (SDATA (str), 3081 nbytes = count_size_as_multibyte (SDATA (str),
@@ -3090,7 +3087,7 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str
3090 3087
3091 if (STRINGP (str2)) 3088 if (STRINGP (str2))
3092 { 3089 {
3093 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 3090 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
3094 nbytes = SCHARS (str2); 3091 nbytes = SCHARS (str2);
3095 else if (! STRING_MULTIBYTE (str2)) 3092 else if (! STRING_MULTIBYTE (str2))
3096 nbytes = count_size_as_multibyte (SDATA (str2), 3093 nbytes = count_size_as_multibyte (SDATA (str2),
@@ -3120,7 +3117,7 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
3120 Lisp_Object overlay, window, str; 3117 Lisp_Object overlay, window, str;
3121 struct Lisp_Overlay *ov; 3118 struct Lisp_Overlay *ov;
3122 EMACS_INT startpos, endpos; 3119 EMACS_INT startpos, endpos;
3123 int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 3120 int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
3124 3121
3125 overlay_heads.used = overlay_heads.bytes = 0; 3122 overlay_heads.used = overlay_heads.bytes = 0;
3126 overlay_tails.used = overlay_tails.bytes = 0; 3123 overlay_tails.used = overlay_tails.bytes = 0;
@@ -4991,9 +4988,9 @@ init_buffer_once (void)
4991 /* Make sure all markable slots in buffer_defaults 4988 /* Make sure all markable slots in buffer_defaults
4992 are initialized reasonably, so mark_buffer won't choke. */ 4989 are initialized reasonably, so mark_buffer won't choke. */
4993 reset_buffer (&buffer_defaults); 4990 reset_buffer (&buffer_defaults);
4994 eassert (EQ (B_ (&buffer_defaults, name), make_number (0))); 4991 eassert (EQ (BVAR (&buffer_defaults, name), make_number (0)));
4995 reset_buffer_local_variables (&buffer_defaults, 1); 4992 reset_buffer_local_variables (&buffer_defaults, 1);
4996 eassert (EQ (B_ (&buffer_local_symbols, name), make_number (0))); 4993 eassert (EQ (BVAR (&buffer_local_symbols, name), make_number (0)));
4997 reset_buffer (&buffer_local_symbols); 4994 reset_buffer (&buffer_local_symbols);
4998 reset_buffer_local_variables (&buffer_local_symbols, 1); 4995 reset_buffer_local_variables (&buffer_local_symbols, 1);
4999 /* Prevent GC from getting confused. */ 4996 /* Prevent GC from getting confused. */
@@ -5010,60 +5007,57 @@ init_buffer_once (void)
5010 /* Must do these before making the first buffer! */ 5007 /* Must do these before making the first buffer! */
5011 5008
5012 /* real setup is done in bindings.el */ 5009 /* real setup is done in bindings.el */
5013 B_ (&buffer_defaults, mode_line_format) = make_pure_c_string ("%-"); 5010 BVAR (&buffer_defaults, mode_line_format) = make_pure_c_string ("%-");
5014 B_ (&buffer_defaults, header_line_format) = Qnil; 5011 BVAR (&buffer_defaults, header_line_format) = Qnil;
5015 B_ (&buffer_defaults, abbrev_mode) = Qnil; 5012 BVAR (&buffer_defaults, abbrev_mode) = Qnil;
5016 B_ (&buffer_defaults, overwrite_mode) = Qnil; 5013 BVAR (&buffer_defaults, overwrite_mode) = Qnil;
5017 B_ (&buffer_defaults, case_fold_search) = Qt; 5014 BVAR (&buffer_defaults, case_fold_search) = Qt;
5018 B_ (&buffer_defaults, auto_fill_function) = Qnil; 5015 BVAR (&buffer_defaults, auto_fill_function) = Qnil;
5019 B_ (&buffer_defaults, selective_display) = Qnil; 5016 BVAR (&buffer_defaults, selective_display) = Qnil;
5020#ifndef old 5017#ifndef old
5021 B_ (&buffer_defaults, selective_display_ellipses) = Qt; 5018 BVAR (&buffer_defaults, selective_display_ellipses) = Qt;
5022#endif 5019#endif
5023 B_ (&buffer_defaults, abbrev_table) = Qnil; 5020 BVAR (&buffer_defaults, abbrev_table) = Qnil;
5024 B_ (&buffer_defaults, display_table) = Qnil; 5021 BVAR (&buffer_defaults, display_table) = Qnil;
5025 B_ (&buffer_defaults, undo_list) = Qnil; 5022 BVAR (&buffer_defaults, undo_list) = Qnil;
5026 B_ (&buffer_defaults, mark_active) = Qnil; 5023 BVAR (&buffer_defaults, mark_active) = Qnil;
5027 B_ (&buffer_defaults, file_format) = Qnil; 5024 BVAR (&buffer_defaults, file_format) = Qnil;
5028 B_ (&buffer_defaults, auto_save_file_format) = Qt; 5025 BVAR (&buffer_defaults, auto_save_file_format) = Qt;
5029 buffer_defaults.overlays_before = NULL; 5026 buffer_defaults.overlays_before = NULL;
5030 buffer_defaults.overlays_after = NULL; 5027 buffer_defaults.overlays_after = NULL;
5031 buffer_defaults.overlay_center = BEG; 5028 buffer_defaults.overlay_center = BEG;
5032 5029
5033 XSETFASTINT (B_ (&buffer_defaults, tab_width), 8); 5030 XSETFASTINT (BVAR (&buffer_defaults, tab_width), 8);
5034 B_ (&buffer_defaults, truncate_lines) = Qnil; 5031 BVAR (&buffer_defaults, truncate_lines) = Qnil;
5035 B_ (&buffer_defaults, word_wrap) = Qnil; 5032 BVAR (&buffer_defaults, word_wrap) = Qnil;
5036 B_ (&buffer_defaults, ctl_arrow) = Qt; 5033 BVAR (&buffer_defaults, ctl_arrow) = Qt;
5037 B_ (&buffer_defaults, bidi_display_reordering) = Qnil; 5034 BVAR (&buffer_defaults, bidi_display_reordering) = Qnil;
5038 B_ (&buffer_defaults, bidi_paragraph_direction) = Qnil; 5035 BVAR (&buffer_defaults, bidi_paragraph_direction) = Qnil;
5039 B_ (&buffer_defaults, cursor_type) = Qt; 5036 BVAR (&buffer_defaults, cursor_type) = Qt;
5040 B_ (&buffer_defaults, extra_line_spacing) = Qnil; 5037 BVAR (&buffer_defaults, extra_line_spacing) = Qnil;
5041 B_ (&buffer_defaults, cursor_in_non_selected_windows) = Qt; 5038 BVAR (&buffer_defaults, cursor_in_non_selected_windows) = Qt;
5042 5039
5043#ifdef DOS_NT 5040 BVAR (&buffer_defaults, enable_multibyte_characters) = Qt;
5044 B_ (&buffer_defaults, buffer_file_type) = Qnil; /* TEXT */ 5041 BVAR (&buffer_defaults, buffer_file_coding_system) = Qnil;
5045#endif 5042 XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70);
5046 B_ (&buffer_defaults, enable_multibyte_characters) = Qt; 5043 XSETFASTINT (BVAR (&buffer_defaults, left_margin), 0);
5047 B_ (&buffer_defaults, buffer_file_coding_system) = Qnil; 5044 BVAR (&buffer_defaults, cache_long_line_scans) = Qnil;
5048 XSETFASTINT (B_ (&buffer_defaults, fill_column), 70); 5045 BVAR (&buffer_defaults, file_truename) = Qnil;
5049 XSETFASTINT (B_ (&buffer_defaults, left_margin), 0); 5046 XSETFASTINT (BVAR (&buffer_defaults, display_count), 0);
5050 B_ (&buffer_defaults, cache_long_line_scans) = Qnil; 5047 XSETFASTINT (BVAR (&buffer_defaults, left_margin_cols), 0);
5051 B_ (&buffer_defaults, file_truename) = Qnil; 5048 XSETFASTINT (BVAR (&buffer_defaults, right_margin_cols), 0);
5052 XSETFASTINT (B_ (&buffer_defaults, display_count), 0); 5049 BVAR (&buffer_defaults, left_fringe_width) = Qnil;
5053 XSETFASTINT (B_ (&buffer_defaults, left_margin_cols), 0); 5050 BVAR (&buffer_defaults, right_fringe_width) = Qnil;
5054 XSETFASTINT (B_ (&buffer_defaults, right_margin_cols), 0); 5051 BVAR (&buffer_defaults, fringes_outside_margins) = Qnil;
5055 B_ (&buffer_defaults, left_fringe_width) = Qnil; 5052 BVAR (&buffer_defaults, scroll_bar_width) = Qnil;
5056 B_ (&buffer_defaults, right_fringe_width) = Qnil; 5053 BVAR (&buffer_defaults, vertical_scroll_bar_type) = Qt;
5057 B_ (&buffer_defaults, fringes_outside_margins) = Qnil; 5054 BVAR (&buffer_defaults, indicate_empty_lines) = Qnil;
5058 B_ (&buffer_defaults, scroll_bar_width) = Qnil; 5055 BVAR (&buffer_defaults, indicate_buffer_boundaries) = Qnil;
5059 B_ (&buffer_defaults, vertical_scroll_bar_type) = Qt; 5056 BVAR (&buffer_defaults, fringe_indicator_alist) = Qnil;
5060 B_ (&buffer_defaults, indicate_empty_lines) = Qnil; 5057 BVAR (&buffer_defaults, fringe_cursor_alist) = Qnil;
5061 B_ (&buffer_defaults, indicate_buffer_boundaries) = Qnil; 5058 BVAR (&buffer_defaults, scroll_up_aggressively) = Qnil;
5062 B_ (&buffer_defaults, fringe_indicator_alist) = Qnil; 5059 BVAR (&buffer_defaults, scroll_down_aggressively) = Qnil;
5063 B_ (&buffer_defaults, fringe_cursor_alist) = Qnil; 5060 BVAR (&buffer_defaults, display_time) = Qnil;
5064 B_ (&buffer_defaults, scroll_up_aggressively) = Qnil;
5065 B_ (&buffer_defaults, scroll_down_aggressively) = Qnil;
5066 B_ (&buffer_defaults, display_time) = Qnil;
5067 5061
5068 /* Assign the local-flags to the slots that have default values. 5062 /* Assign the local-flags to the slots that have default values.
5069 The local flag is a bit that is used in the buffer 5063 The local flag is a bit that is used in the buffer
@@ -5075,73 +5069,68 @@ init_buffer_once (void)
5075 5069
5076 /* 0 means not a lisp var, -1 means always local, else mask */ 5070 /* 0 means not a lisp var, -1 means always local, else mask */
5077 memset (&buffer_local_flags, 0, sizeof buffer_local_flags); 5071 memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
5078 XSETINT (B_ (&buffer_local_flags, filename), -1); 5072 XSETINT (BVAR (&buffer_local_flags, filename), -1);
5079 XSETINT (B_ (&buffer_local_flags, directory), -1); 5073 XSETINT (BVAR (&buffer_local_flags, directory), -1);
5080 XSETINT (B_ (&buffer_local_flags, backed_up), -1); 5074 XSETINT (BVAR (&buffer_local_flags, backed_up), -1);
5081 XSETINT (B_ (&buffer_local_flags, save_length), -1); 5075 XSETINT (BVAR (&buffer_local_flags, save_length), -1);
5082 XSETINT (B_ (&buffer_local_flags, auto_save_file_name), -1); 5076 XSETINT (BVAR (&buffer_local_flags, auto_save_file_name), -1);
5083 XSETINT (B_ (&buffer_local_flags, read_only), -1); 5077 XSETINT (BVAR (&buffer_local_flags, read_only), -1);
5084 XSETINT (B_ (&buffer_local_flags, major_mode), -1); 5078 XSETINT (BVAR (&buffer_local_flags, major_mode), -1);
5085 XSETINT (B_ (&buffer_local_flags, mode_name), -1); 5079 XSETINT (BVAR (&buffer_local_flags, mode_name), -1);
5086 XSETINT (B_ (&buffer_local_flags, undo_list), -1); 5080 XSETINT (BVAR (&buffer_local_flags, undo_list), -1);
5087 XSETINT (B_ (&buffer_local_flags, mark_active), -1); 5081 XSETINT (BVAR (&buffer_local_flags, mark_active), -1);
5088 XSETINT (B_ (&buffer_local_flags, point_before_scroll), -1); 5082 XSETINT (BVAR (&buffer_local_flags, point_before_scroll), -1);
5089 XSETINT (B_ (&buffer_local_flags, file_truename), -1); 5083 XSETINT (BVAR (&buffer_local_flags, file_truename), -1);
5090 XSETINT (B_ (&buffer_local_flags, invisibility_spec), -1); 5084 XSETINT (BVAR (&buffer_local_flags, invisibility_spec), -1);
5091 XSETINT (B_ (&buffer_local_flags, file_format), -1); 5085 XSETINT (BVAR (&buffer_local_flags, file_format), -1);
5092 XSETINT (B_ (&buffer_local_flags, auto_save_file_format), -1); 5086 XSETINT (BVAR (&buffer_local_flags, auto_save_file_format), -1);
5093 XSETINT (B_ (&buffer_local_flags, display_count), -1); 5087 XSETINT (BVAR (&buffer_local_flags, display_count), -1);
5094 XSETINT (B_ (&buffer_local_flags, display_time), -1); 5088 XSETINT (BVAR (&buffer_local_flags, display_time), -1);
5095 XSETINT (B_ (&buffer_local_flags, enable_multibyte_characters), -1); 5089 XSETINT (BVAR (&buffer_local_flags, enable_multibyte_characters), -1);
5096 5090
5097 idx = 1; 5091 idx = 1;
5098 XSETFASTINT (B_ (&buffer_local_flags, mode_line_format), idx); ++idx; 5092 XSETFASTINT (BVAR (&buffer_local_flags, mode_line_format), idx); ++idx;
5099 XSETFASTINT (B_ (&buffer_local_flags, abbrev_mode), idx); ++idx; 5093 XSETFASTINT (BVAR (&buffer_local_flags, abbrev_mode), idx); ++idx;
5100 XSETFASTINT (B_ (&buffer_local_flags, overwrite_mode), idx); ++idx; 5094 XSETFASTINT (BVAR (&buffer_local_flags, overwrite_mode), idx); ++idx;
5101 XSETFASTINT (B_ (&buffer_local_flags, case_fold_search), idx); ++idx; 5095 XSETFASTINT (BVAR (&buffer_local_flags, case_fold_search), idx); ++idx;
5102 XSETFASTINT (B_ (&buffer_local_flags, auto_fill_function), idx); ++idx; 5096 XSETFASTINT (BVAR (&buffer_local_flags, auto_fill_function), idx); ++idx;
5103 XSETFASTINT (B_ (&buffer_local_flags, selective_display), idx); ++idx; 5097 XSETFASTINT (BVAR (&buffer_local_flags, selective_display), idx); ++idx;
5104#ifndef old 5098#ifndef old
5105 XSETFASTINT (B_ (&buffer_local_flags, selective_display_ellipses), idx); ++idx; 5099 XSETFASTINT (BVAR (&buffer_local_flags, selective_display_ellipses), idx); ++idx;
5106#endif
5107 XSETFASTINT (B_ (&buffer_local_flags, tab_width), idx); ++idx;
5108 XSETFASTINT (B_ (&buffer_local_flags, truncate_lines), idx); ++idx;
5109 XSETFASTINT (B_ (&buffer_local_flags, word_wrap), idx); ++idx;
5110 XSETFASTINT (B_ (&buffer_local_flags, ctl_arrow), idx); ++idx;
5111 XSETFASTINT (B_ (&buffer_local_flags, fill_column), idx); ++idx;
5112 XSETFASTINT (B_ (&buffer_local_flags, left_margin), idx); ++idx;
5113 XSETFASTINT (B_ (&buffer_local_flags, abbrev_table), idx); ++idx;
5114 XSETFASTINT (B_ (&buffer_local_flags, display_table), idx); ++idx;
5115#ifdef DOS_NT
5116 XSETFASTINT (B_ (&buffer_local_flags, buffer_file_type), idx);
5117 /* Make this one a permanent local. */
5118 buffer_permanent_local_flags[idx++] = 1;
5119#endif 5100#endif
5120 XSETFASTINT (B_ (&buffer_local_flags, syntax_table), idx); ++idx; 5101 XSETFASTINT (BVAR (&buffer_local_flags, tab_width), idx); ++idx;
5121 XSETFASTINT (B_ (&buffer_local_flags, cache_long_line_scans), idx); ++idx; 5102 XSETFASTINT (BVAR (&buffer_local_flags, truncate_lines), idx); ++idx;
5122 XSETFASTINT (B_ (&buffer_local_flags, category_table), idx); ++idx; 5103 XSETFASTINT (BVAR (&buffer_local_flags, word_wrap), idx); ++idx;
5123 XSETFASTINT (B_ (&buffer_local_flags, bidi_display_reordering), idx); ++idx; 5104 XSETFASTINT (BVAR (&buffer_local_flags, ctl_arrow), idx); ++idx;
5124 XSETFASTINT (B_ (&buffer_local_flags, bidi_paragraph_direction), idx); ++idx; 5105 XSETFASTINT (BVAR (&buffer_local_flags, fill_column), idx); ++idx;
5125 XSETFASTINT (B_ (&buffer_local_flags, buffer_file_coding_system), idx); 5106 XSETFASTINT (BVAR (&buffer_local_flags, left_margin), idx); ++idx;
5107 XSETFASTINT (BVAR (&buffer_local_flags, abbrev_table), idx); ++idx;
5108 XSETFASTINT (BVAR (&buffer_local_flags, display_table), idx); ++idx;
5109 XSETFASTINT (BVAR (&buffer_local_flags, syntax_table), idx); ++idx;
5110 XSETFASTINT (BVAR (&buffer_local_flags, cache_long_line_scans), idx); ++idx;
5111 XSETFASTINT (BVAR (&buffer_local_flags, category_table), idx); ++idx;
5112 XSETFASTINT (BVAR (&buffer_local_flags, bidi_display_reordering), idx); ++idx;
5113 XSETFASTINT (BVAR (&buffer_local_flags, bidi_paragraph_direction), idx); ++idx;
5114 XSETFASTINT (BVAR (&buffer_local_flags, buffer_file_coding_system), idx);
5126 /* Make this one a permanent local. */ 5115 /* Make this one a permanent local. */
5127 buffer_permanent_local_flags[idx++] = 1; 5116 buffer_permanent_local_flags[idx++] = 1;
5128 XSETFASTINT (B_ (&buffer_local_flags, left_margin_cols), idx); ++idx; 5117 XSETFASTINT (BVAR (&buffer_local_flags, left_margin_cols), idx); ++idx;
5129 XSETFASTINT (B_ (&buffer_local_flags, right_margin_cols), idx); ++idx; 5118 XSETFASTINT (BVAR (&buffer_local_flags, right_margin_cols), idx); ++idx;
5130 XSETFASTINT (B_ (&buffer_local_flags, left_fringe_width), idx); ++idx; 5119 XSETFASTINT (BVAR (&buffer_local_flags, left_fringe_width), idx); ++idx;
5131 XSETFASTINT (B_ (&buffer_local_flags, right_fringe_width), idx); ++idx; 5120 XSETFASTINT (BVAR (&buffer_local_flags, right_fringe_width), idx); ++idx;
5132 XSETFASTINT (B_ (&buffer_local_flags, fringes_outside_margins), idx); ++idx; 5121 XSETFASTINT (BVAR (&buffer_local_flags, fringes_outside_margins), idx); ++idx;
5133 XSETFASTINT (B_ (&buffer_local_flags, scroll_bar_width), idx); ++idx; 5122 XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_width), idx); ++idx;
5134 XSETFASTINT (B_ (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx; 5123 XSETFASTINT (BVAR (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx;
5135 XSETFASTINT (B_ (&buffer_local_flags, indicate_empty_lines), idx); ++idx; 5124 XSETFASTINT (BVAR (&buffer_local_flags, indicate_empty_lines), idx); ++idx;
5136 XSETFASTINT (B_ (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx; 5125 XSETFASTINT (BVAR (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx;
5137 XSETFASTINT (B_ (&buffer_local_flags, fringe_indicator_alist), idx); ++idx; 5126 XSETFASTINT (BVAR (&buffer_local_flags, fringe_indicator_alist), idx); ++idx;
5138 XSETFASTINT (B_ (&buffer_local_flags, fringe_cursor_alist), idx); ++idx; 5127 XSETFASTINT (BVAR (&buffer_local_flags, fringe_cursor_alist), idx); ++idx;
5139 XSETFASTINT (B_ (&buffer_local_flags, scroll_up_aggressively), idx); ++idx; 5128 XSETFASTINT (BVAR (&buffer_local_flags, scroll_up_aggressively), idx); ++idx;
5140 XSETFASTINT (B_ (&buffer_local_flags, scroll_down_aggressively), idx); ++idx; 5129 XSETFASTINT (BVAR (&buffer_local_flags, scroll_down_aggressively), idx); ++idx;
5141 XSETFASTINT (B_ (&buffer_local_flags, header_line_format), idx); ++idx; 5130 XSETFASTINT (BVAR (&buffer_local_flags, header_line_format), idx); ++idx;
5142 XSETFASTINT (B_ (&buffer_local_flags, cursor_type), idx); ++idx; 5131 XSETFASTINT (BVAR (&buffer_local_flags, cursor_type), idx); ++idx;
5143 XSETFASTINT (B_ (&buffer_local_flags, extra_line_spacing), idx); ++idx; 5132 XSETFASTINT (BVAR (&buffer_local_flags, extra_line_spacing), idx); ++idx;
5144 XSETFASTINT (B_ (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx; 5133 XSETFASTINT (BVAR (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx;
5145 5134
5146 /* Need more room? */ 5135 /* Need more room? */
5147 if (idx >= MAX_PER_BUFFER_VARS) 5136 if (idx >= MAX_PER_BUFFER_VARS)
@@ -5155,7 +5144,7 @@ init_buffer_once (void)
5155 QSFundamental = make_pure_c_string ("Fundamental"); 5144 QSFundamental = make_pure_c_string ("Fundamental");
5156 5145
5157 Qfundamental_mode = intern_c_string ("fundamental-mode"); 5146 Qfundamental_mode = intern_c_string ("fundamental-mode");
5158 B_ (&buffer_defaults, major_mode) = Qfundamental_mode; 5147 BVAR (&buffer_defaults, major_mode) = Qfundamental_mode;
5159 5148
5160 Qmode_class = intern_c_string ("mode-class"); 5149 Qmode_class = intern_c_string ("mode-class");
5161 5150
@@ -5198,7 +5187,7 @@ init_buffer (void)
5198#endif /* USE_MMAP_FOR_BUFFERS */ 5187#endif /* USE_MMAP_FOR_BUFFERS */
5199 5188
5200 Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); 5189 Fset_buffer (Fget_buffer_create (build_string ("*scratch*")));
5201 if (NILP (B_ (&buffer_defaults, enable_multibyte_characters))) 5190 if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
5202 Fset_buffer_multibyte (Qnil); 5191 Fset_buffer_multibyte (Qnil);
5203 5192
5204 pwd = get_current_dir_name (); 5193 pwd = get_current_dir_name ();
@@ -5219,28 +5208,28 @@ init_buffer (void)
5219 pwd[len + 1] = '\0'; 5208 pwd[len + 1] = '\0';
5220 } 5209 }
5221 5210
5222 B_ (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd)); 5211 BVAR (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd));
5223 if (! NILP (B_ (&buffer_defaults, enable_multibyte_characters))) 5212 if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
5224 /* At this moment, we still don't know how to decode the 5213 /* At this moment, we still don't know how to decode the
5225 directory name. So, we keep the bytes in multibyte form so 5214 directory name. So, we keep the bytes in multibyte form so
5226 that ENCODE_FILE correctly gets the original bytes. */ 5215 that ENCODE_FILE correctly gets the original bytes. */
5227 B_ (current_buffer, directory) 5216 BVAR (current_buffer, directory)
5228 = string_to_multibyte (B_ (current_buffer, directory)); 5217 = string_to_multibyte (BVAR (current_buffer, directory));
5229 5218
5230 /* Add /: to the front of the name 5219 /* Add /: to the front of the name
5231 if it would otherwise be treated as magic. */ 5220 if it would otherwise be treated as magic. */
5232 temp = Ffind_file_name_handler (B_ (current_buffer, directory), Qt); 5221 temp = Ffind_file_name_handler (BVAR (current_buffer, directory), Qt);
5233 if (! NILP (temp) 5222 if (! NILP (temp)
5234 /* If the default dir is just /, TEMP is non-nil 5223 /* If the default dir is just /, TEMP is non-nil
5235 because of the ange-ftp completion handler. 5224 because of the ange-ftp completion handler.
5236 However, it is not necessary to turn / into /:/. 5225 However, it is not necessary to turn / into /:/.
5237 So avoid doing that. */ 5226 So avoid doing that. */
5238 && strcmp ("/", SSDATA (B_ (current_buffer, directory)))) 5227 && strcmp ("/", SSDATA (BVAR (current_buffer, directory))))
5239 B_ (current_buffer, directory) 5228 BVAR (current_buffer, directory)
5240 = concat2 (build_string ("/:"), B_ (current_buffer, directory)); 5229 = concat2 (build_string ("/:"), BVAR (current_buffer, directory));
5241 5230
5242 temp = get_minibuffer (0); 5231 temp = get_minibuffer (0);
5243 B_ (XBUFFER (temp), directory) = B_ (current_buffer, directory); 5232 BVAR (XBUFFER (temp), directory) = BVAR (current_buffer, directory);
5244 5233
5245 free (pwd); 5234 free (pwd);
5246} 5235}
@@ -5415,14 +5404,6 @@ This is the same as (default-value 'tab-width). */);
5415 doc: /* Default value of `case-fold-search' for buffers that don't override it. 5404 doc: /* Default value of `case-fold-search' for buffers that don't override it.
5416This is the same as (default-value 'case-fold-search). */); 5405This is the same as (default-value 'case-fold-search). */);
5417 5406
5418#ifdef DOS_NT
5419 DEFVAR_BUFFER_DEFAULTS ("default-buffer-file-type",
5420 buffer_file_type,
5421 doc: /* Default file type for buffers that do not override it.
5422This is the same as (default-value 'buffer-file-type).
5423The file type is nil for text, t for binary. */);
5424#endif
5425
5426 DEFVAR_BUFFER_DEFAULTS ("default-left-margin-width", 5407 DEFVAR_BUFFER_DEFAULTS ("default-left-margin-width",
5427 left_margin_cols, 5408 left_margin_cols,
5428 doc: /* Default value of `left-margin-width' for buffers that don't override it. 5409 doc: /* Default value of `left-margin-width' for buffers that don't override it.
@@ -5491,13 +5472,13 @@ This value applies in buffers that don't have their own local values.
5491This is the same as (default-value 'scroll-down-aggressively). */); 5472This is the same as (default-value 'scroll-down-aggressively). */);
5492 5473
5493 DEFVAR_PER_BUFFER ("header-line-format", 5474 DEFVAR_PER_BUFFER ("header-line-format",
5494 &B_ (current_buffer, header_line_format), 5475 &BVAR (current_buffer, header_line_format),
5495 Qnil, 5476 Qnil,
5496 doc: /* Analogous to `mode-line-format', but controls the header line. 5477 doc: /* Analogous to `mode-line-format', but controls the header line.
5497The header line appears, optionally, at the top of a window; 5478The header line appears, optionally, at the top of a window;
5498the mode line appears at the bottom. */); 5479the mode line appears at the bottom. */);
5499 5480
5500 DEFVAR_PER_BUFFER ("mode-line-format", &B_ (current_buffer, mode_line_format), 5481 DEFVAR_PER_BUFFER ("mode-line-format", &BVAR (current_buffer, mode_line_format),
5501 Qnil, 5482 Qnil,
5502 doc: /* Template for displaying mode line for current buffer. 5483 doc: /* Template for displaying mode line for current buffer.
5503Each buffer has its own value of this variable. 5484Each buffer has its own value of this variable.
@@ -5554,7 +5535,7 @@ Decimal digits after the % specify field width to which to pad. */);
5554 DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode, 5535 DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode,
5555 doc: /* *Value of `major-mode' for new buffers. */); 5536 doc: /* *Value of `major-mode' for new buffers. */);
5556 5537
5557 DEFVAR_PER_BUFFER ("major-mode", &B_ (current_buffer, major_mode), 5538 DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode),
5558 make_number (Lisp_Symbol), 5539 make_number (Lisp_Symbol),
5559 doc: /* Symbol for current buffer's major mode. 5540 doc: /* Symbol for current buffer's major mode.
5560The default value (normally `fundamental-mode') affects new buffers. 5541The default value (normally `fundamental-mode') affects new buffers.
@@ -5567,46 +5548,46 @@ the buffer. Thus, the mode and its hooks should not expect certain
5567variables such as `buffer-read-only' and `buffer-file-coding-system' 5548variables such as `buffer-read-only' and `buffer-file-coding-system'
5568to be set up. */); 5549to be set up. */);
5569 5550
5570 DEFVAR_PER_BUFFER ("mode-name", &B_ (current_buffer, mode_name), 5551 DEFVAR_PER_BUFFER ("mode-name", &BVAR (current_buffer, mode_name),
5571 Qnil, 5552 Qnil,
5572 doc: /* Pretty name of current buffer's major mode. 5553 doc: /* Pretty name of current buffer's major mode.
5573Usually a string, but can use any of the constructs for `mode-line-format', 5554Usually a string, but can use any of the constructs for `mode-line-format',
5574which see. 5555which see.
5575Format with `format-mode-line' to produce a string value. */); 5556Format with `format-mode-line' to produce a string value. */);
5576 5557
5577 DEFVAR_PER_BUFFER ("local-abbrev-table", &B_ (current_buffer, abbrev_table), Qnil, 5558 DEFVAR_PER_BUFFER ("local-abbrev-table", &BVAR (current_buffer, abbrev_table), Qnil,
5578 doc: /* Local (mode-specific) abbrev table of current buffer. */); 5559 doc: /* Local (mode-specific) abbrev table of current buffer. */);
5579 5560
5580 DEFVAR_PER_BUFFER ("abbrev-mode", &B_ (current_buffer, abbrev_mode), Qnil, 5561 DEFVAR_PER_BUFFER ("abbrev-mode", &BVAR (current_buffer, abbrev_mode), Qnil,
5581 doc: /* Non-nil if Abbrev mode is enabled. 5562 doc: /* Non-nil if Abbrev mode is enabled.
5582Use the command `abbrev-mode' to change this variable. */); 5563Use the command `abbrev-mode' to change this variable. */);
5583 5564
5584 DEFVAR_PER_BUFFER ("case-fold-search", &B_ (current_buffer, case_fold_search), 5565 DEFVAR_PER_BUFFER ("case-fold-search", &BVAR (current_buffer, case_fold_search),
5585 Qnil, 5566 Qnil,
5586 doc: /* *Non-nil if searches and matches should ignore case. */); 5567 doc: /* *Non-nil if searches and matches should ignore case. */);
5587 5568
5588 DEFVAR_PER_BUFFER ("fill-column", &B_ (current_buffer, fill_column), 5569 DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column),
5589 make_number (LISP_INT_TAG), 5570 make_number (LISP_INT_TAG),
5590 doc: /* *Column beyond which automatic line-wrapping should happen. 5571 doc: /* *Column beyond which automatic line-wrapping should happen.
5591Interactively, you can set the buffer local value using \\[set-fill-column]. */); 5572Interactively, you can set the buffer local value using \\[set-fill-column]. */);
5592 5573
5593 DEFVAR_PER_BUFFER ("left-margin", &B_ (current_buffer, left_margin), 5574 DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin),
5594 make_number (LISP_INT_TAG), 5575 make_number (LISP_INT_TAG),
5595 doc: /* *Column for the default `indent-line-function' to indent to. 5576 doc: /* *Column for the default `indent-line-function' to indent to.
5596Linefeed indents to this column in Fundamental mode. */); 5577Linefeed indents to this column in Fundamental mode. */);
5597 5578
5598 DEFVAR_PER_BUFFER ("tab-width", &B_ (current_buffer, tab_width), 5579 DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width),
5599 make_number (LISP_INT_TAG), 5580 make_number (LISP_INT_TAG),
5600 doc: /* *Distance between tab stops (for display of tab characters), in columns. */); 5581 doc: /* *Distance between tab stops (for display of tab characters), in columns. */);
5601 5582
5602 DEFVAR_PER_BUFFER ("ctl-arrow", &B_ (current_buffer, ctl_arrow), Qnil, 5583 DEFVAR_PER_BUFFER ("ctl-arrow", &BVAR (current_buffer, ctl_arrow), Qnil,
5603 doc: /* *Non-nil means display control chars with uparrow. 5584 doc: /* *Non-nil means display control chars with uparrow.
5604A value of nil means use backslash and octal digits. 5585A value of nil means use backslash and octal digits.
5605This variable does not apply to characters whose display is specified 5586This variable does not apply to characters whose display is specified
5606in the current display table (if there is one). */); 5587in the current display table (if there is one). */);
5607 5588
5608 DEFVAR_PER_BUFFER ("enable-multibyte-characters", 5589 DEFVAR_PER_BUFFER ("enable-multibyte-characters",
5609 &B_ (current_buffer, enable_multibyte_characters), 5590 &BVAR (current_buffer, enable_multibyte_characters),
5610 Qnil, 5591 Qnil,
5611 doc: /* Non-nil means the buffer contents are regarded as multi-byte characters. 5592 doc: /* Non-nil means the buffer contents are regarded as multi-byte characters.
5612Otherwise they are regarded as unibyte. This affects the display, 5593Otherwise they are regarded as unibyte. This affects the display,
@@ -5620,7 +5601,7 @@ See also variable `default-enable-multibyte-characters' and Info node
5620 XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1; 5601 XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1;
5621 5602
5622 DEFVAR_PER_BUFFER ("buffer-file-coding-system", 5603 DEFVAR_PER_BUFFER ("buffer-file-coding-system",
5623 &B_ (current_buffer, buffer_file_coding_system), Qnil, 5604 &BVAR (current_buffer, buffer_file_coding_system), Qnil,
5624 doc: /* Coding system to be used for encoding the buffer contents on saving. 5605 doc: /* Coding system to be used for encoding the buffer contents on saving.
5625This variable applies to saving the buffer, and also to `write-region' 5606This variable applies to saving the buffer, and also to `write-region'
5626and other functions that use `write-region'. 5607and other functions that use `write-region'.
@@ -5638,11 +5619,11 @@ The variable `coding-system-for-write', if non-nil, overrides this variable.
5638This variable is never applied to a way of decoding a file while reading it. */); 5619This variable is never applied to a way of decoding a file while reading it. */);
5639 5620
5640 DEFVAR_PER_BUFFER ("bidi-display-reordering", 5621 DEFVAR_PER_BUFFER ("bidi-display-reordering",
5641 &B_ (current_buffer, bidi_display_reordering), Qnil, 5622 &BVAR (current_buffer, bidi_display_reordering), Qnil,
5642 doc: /* Non-nil means reorder bidirectional text for display in the visual order. */); 5623 doc: /* Non-nil means reorder bidirectional text for display in the visual order. */);
5643 5624
5644 DEFVAR_PER_BUFFER ("bidi-paragraph-direction", 5625 DEFVAR_PER_BUFFER ("bidi-paragraph-direction",
5645 &B_ (current_buffer, bidi_paragraph_direction), Qnil, 5626 &BVAR (current_buffer, bidi_paragraph_direction), Qnil,
5646 doc: /* *If non-nil, forces directionality of text paragraphs in the buffer. 5627 doc: /* *If non-nil, forces directionality of text paragraphs in the buffer.
5647 5628
5648If this is nil (the default), the direction of each paragraph is 5629If this is nil (the default), the direction of each paragraph is
@@ -5653,7 +5634,7 @@ Any other value is treated as nil.
5653This variable has no effect unless the buffer's value of 5634This variable has no effect unless the buffer's value of
5654\`bidi-display-reordering' is non-nil. */); 5635\`bidi-display-reordering' is non-nil. */);
5655 5636
5656 DEFVAR_PER_BUFFER ("truncate-lines", &B_ (current_buffer, truncate_lines), Qnil, 5637 DEFVAR_PER_BUFFER ("truncate-lines", &BVAR (current_buffer, truncate_lines), Qnil,
5657 doc: /* *Non-nil means do not display continuation lines. 5638 doc: /* *Non-nil means do not display continuation lines.
5658Instead, give each line of text just one screen line. 5639Instead, give each line of text just one screen line.
5659 5640
@@ -5661,7 +5642,7 @@ Note that this is overridden by the variable
5661`truncate-partial-width-windows' if that variable is non-nil 5642`truncate-partial-width-windows' if that variable is non-nil
5662and this buffer is not full-frame width. */); 5643and this buffer is not full-frame width. */);
5663 5644
5664 DEFVAR_PER_BUFFER ("word-wrap", &B_ (current_buffer, word_wrap), Qnil, 5645 DEFVAR_PER_BUFFER ("word-wrap", &BVAR (current_buffer, word_wrap), Qnil,
5665 doc: /* *Non-nil means to use word-wrapping for continuation lines. 5646 doc: /* *Non-nil means to use word-wrapping for continuation lines.
5666When word-wrapping is on, continuation lines are wrapped at the space 5647When word-wrapping is on, continuation lines are wrapped at the space
5667or tab character nearest to the right window edge. 5648or tab character nearest to the right window edge.
@@ -5673,21 +5654,12 @@ word-wrapping, you might want to reduce the value of
5673`truncate-partial-width-windows', since wrapping can make text readable 5654`truncate-partial-width-windows', since wrapping can make text readable
5674in narrower windows. */); 5655in narrower windows. */);
5675 5656
5676#ifdef DOS_NT 5657 DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory),
5677 DEFVAR_PER_BUFFER ("buffer-file-type", &B_ (current_buffer, buffer_file_type),
5678 Qnil,
5679 doc: /* Non-nil if the visited file is a binary file.
5680This variable is meaningful on MS-DOG and Windows NT.
5681On those systems, it is automatically local in every buffer.
5682On other systems, this variable is normally always nil. */);
5683#endif
5684
5685 DEFVAR_PER_BUFFER ("default-directory", &B_ (current_buffer, directory),
5686 make_number (Lisp_String), 5658 make_number (Lisp_String),
5687 doc: /* Name of default directory of current buffer. Should end with slash. 5659 doc: /* Name of default directory of current buffer. Should end with slash.
5688To interactively change the default directory, use command `cd'. */); 5660To interactively change the default directory, use command `cd'. */);
5689 5661
5690 DEFVAR_PER_BUFFER ("auto-fill-function", &B_ (current_buffer, auto_fill_function), 5662 DEFVAR_PER_BUFFER ("auto-fill-function", &BVAR (current_buffer, auto_fill_function),
5691 Qnil, 5663 Qnil,
5692 doc: /* Function called (if non-nil) to perform auto-fill. 5664 doc: /* Function called (if non-nil) to perform auto-fill.
5693It is called after self-inserting any character specified in 5665It is called after self-inserting any character specified in
@@ -5695,30 +5667,30 @@ the `auto-fill-chars' table.
5695NOTE: This variable is not a hook; 5667NOTE: This variable is not a hook;
5696its value may not be a list of functions. */); 5668its value may not be a list of functions. */);
5697 5669
5698 DEFVAR_PER_BUFFER ("buffer-file-name", &B_ (current_buffer, filename), 5670 DEFVAR_PER_BUFFER ("buffer-file-name", &BVAR (current_buffer, filename),
5699 make_number (Lisp_String), 5671 make_number (Lisp_String),
5700 doc: /* Name of file visited in current buffer, or nil if not visiting a file. */); 5672 doc: /* Name of file visited in current buffer, or nil if not visiting a file. */);
5701 5673
5702 DEFVAR_PER_BUFFER ("buffer-file-truename", &B_ (current_buffer, file_truename), 5674 DEFVAR_PER_BUFFER ("buffer-file-truename", &BVAR (current_buffer, file_truename),
5703 make_number (Lisp_String), 5675 make_number (Lisp_String),
5704 doc: /* Abbreviated truename of file visited in current buffer, or nil if none. 5676 doc: /* Abbreviated truename of file visited in current buffer, or nil if none.
5705The truename of a file is calculated by `file-truename' 5677The truename of a file is calculated by `file-truename'
5706and then abbreviated with `abbreviate-file-name'. */); 5678and then abbreviated with `abbreviate-file-name'. */);
5707 5679
5708 DEFVAR_PER_BUFFER ("buffer-auto-save-file-name", 5680 DEFVAR_PER_BUFFER ("buffer-auto-save-file-name",
5709 &B_ (current_buffer, auto_save_file_name), 5681 &BVAR (current_buffer, auto_save_file_name),
5710 make_number (Lisp_String), 5682 make_number (Lisp_String),
5711 doc: /* Name of file for auto-saving current buffer. 5683 doc: /* Name of file for auto-saving current buffer.
5712If it is nil, that means don't auto-save this buffer. */); 5684If it is nil, that means don't auto-save this buffer. */);
5713 5685
5714 DEFVAR_PER_BUFFER ("buffer-read-only", &B_ (current_buffer, read_only), Qnil, 5686 DEFVAR_PER_BUFFER ("buffer-read-only", &BVAR (current_buffer, read_only), Qnil,
5715 doc: /* Non-nil if this buffer is read-only. */); 5687 doc: /* Non-nil if this buffer is read-only. */);
5716 5688
5717 DEFVAR_PER_BUFFER ("buffer-backed-up", &B_ (current_buffer, backed_up), Qnil, 5689 DEFVAR_PER_BUFFER ("buffer-backed-up", &BVAR (current_buffer, backed_up), Qnil,
5718 doc: /* Non-nil if this buffer's file has been backed up. 5690 doc: /* Non-nil if this buffer's file has been backed up.
5719Backing up is done before the first time the file is saved. */); 5691Backing up is done before the first time the file is saved. */);
5720 5692
5721 DEFVAR_PER_BUFFER ("buffer-saved-size", &B_ (current_buffer, save_length), 5693 DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length),
5722 make_number (LISP_INT_TAG), 5694 make_number (LISP_INT_TAG),
5723 doc: /* Length of current buffer when last read in, saved or auto-saved. 5695 doc: /* Length of current buffer when last read in, saved or auto-saved.
57240 initially. 56960 initially.
@@ -5728,7 +5700,7 @@ If you set this to -2, that means don't turn off auto-saving in this buffer
5728if its text size shrinks. If you use `buffer-swap-text' on a buffer, 5700if its text size shrinks. If you use `buffer-swap-text' on a buffer,
5729you probably should set this to -2 in that buffer. */); 5701you probably should set this to -2 in that buffer. */);
5730 5702
5731 DEFVAR_PER_BUFFER ("selective-display", &B_ (current_buffer, selective_display), 5703 DEFVAR_PER_BUFFER ("selective-display", &BVAR (current_buffer, selective_display),
5732 Qnil, 5704 Qnil,
5733 doc: /* Non-nil enables selective display. 5705 doc: /* Non-nil enables selective display.
5734An integer N as value means display only lines 5706An integer N as value means display only lines
@@ -5739,12 +5711,12 @@ in a file, save the ^M as a newline. */);
5739 5711
5740#ifndef old 5712#ifndef old
5741 DEFVAR_PER_BUFFER ("selective-display-ellipses", 5713 DEFVAR_PER_BUFFER ("selective-display-ellipses",
5742 &B_ (current_buffer, selective_display_ellipses), 5714 &BVAR (current_buffer, selective_display_ellipses),
5743 Qnil, 5715 Qnil,
5744 doc: /* Non-nil means display ... on previous line when a line is invisible. */); 5716 doc: /* Non-nil means display ... on previous line when a line is invisible. */);
5745#endif 5717#endif
5746 5718
5747 DEFVAR_PER_BUFFER ("overwrite-mode", &B_ (current_buffer, overwrite_mode), Qnil, 5719 DEFVAR_PER_BUFFER ("overwrite-mode", &BVAR (current_buffer, overwrite_mode), Qnil,
5748 doc: /* Non-nil if self-insertion should replace existing text. 5720 doc: /* Non-nil if self-insertion should replace existing text.
5749The value should be one of `overwrite-mode-textual', 5721The value should be one of `overwrite-mode-textual',
5750`overwrite-mode-binary', or nil. 5722`overwrite-mode-binary', or nil.
@@ -5753,7 +5725,7 @@ inserts at the end of a line, and inserts when point is before a tab,
5753until the tab is filled in. 5725until the tab is filled in.
5754If `overwrite-mode-binary', self-insertion replaces newlines and tabs too. */); 5726If `overwrite-mode-binary', self-insertion replaces newlines and tabs too. */);
5755 5727
5756 DEFVAR_PER_BUFFER ("buffer-display-table", &B_ (current_buffer, display_table), 5728 DEFVAR_PER_BUFFER ("buffer-display-table", &BVAR (current_buffer, display_table),
5757 Qnil, 5729 Qnil,
5758 doc: /* Display table that controls display of the contents of current buffer. 5730 doc: /* Display table that controls display of the contents of current buffer.
5759 5731
@@ -5790,39 +5762,39 @@ In addition, a char-table has six extra slots to control the display of:
5790 5762
5791See also the functions `display-table-slot' and `set-display-table-slot'. */); 5763See also the functions `display-table-slot' and `set-display-table-slot'. */);
5792 5764
5793 DEFVAR_PER_BUFFER ("left-margin-width", &B_ (current_buffer, left_margin_cols), 5765 DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols),
5794 Qnil, 5766 Qnil,
5795 doc: /* *Width of left marginal area for display of a buffer. 5767 doc: /* *Width of left marginal area for display of a buffer.
5796A value of nil means no marginal area. */); 5768A value of nil means no marginal area. */);
5797 5769
5798 DEFVAR_PER_BUFFER ("right-margin-width", &B_ (current_buffer, right_margin_cols), 5770 DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols),
5799 Qnil, 5771 Qnil,
5800 doc: /* *Width of right marginal area for display of a buffer. 5772 doc: /* *Width of right marginal area for display of a buffer.
5801A value of nil means no marginal area. */); 5773A value of nil means no marginal area. */);
5802 5774
5803 DEFVAR_PER_BUFFER ("left-fringe-width", &B_ (current_buffer, left_fringe_width), 5775 DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width),
5804 Qnil, 5776 Qnil,
5805 doc: /* *Width of this buffer's left fringe (in pixels). 5777 doc: /* *Width of this buffer's left fringe (in pixels).
5806A value of 0 means no left fringe is shown in this buffer's window. 5778A value of 0 means no left fringe is shown in this buffer's window.
5807A value of nil means to use the left fringe width from the window's frame. */); 5779A value of nil means to use the left fringe width from the window's frame. */);
5808 5780
5809 DEFVAR_PER_BUFFER ("right-fringe-width", &B_ (current_buffer, right_fringe_width), 5781 DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width),
5810 Qnil, 5782 Qnil,
5811 doc: /* *Width of this buffer's right fringe (in pixels). 5783 doc: /* *Width of this buffer's right fringe (in pixels).
5812A value of 0 means no right fringe is shown in this buffer's window. 5784A value of 0 means no right fringe is shown in this buffer's window.
5813A value of nil means to use the right fringe width from the window's frame. */); 5785A value of nil means to use the right fringe width from the window's frame. */);
5814 5786
5815 DEFVAR_PER_BUFFER ("fringes-outside-margins", &B_ (current_buffer, fringes_outside_margins), 5787 DEFVAR_PER_BUFFER ("fringes-outside-margins", &BVAR (current_buffer, fringes_outside_margins),
5816 Qnil, 5788 Qnil,
5817 doc: /* *Non-nil means to display fringes outside display margins. 5789 doc: /* *Non-nil means to display fringes outside display margins.
5818A value of nil means to display fringes between margins and buffer text. */); 5790A value of nil means to display fringes between margins and buffer text. */);
5819 5791
5820 DEFVAR_PER_BUFFER ("scroll-bar-width", &B_ (current_buffer, scroll_bar_width), 5792 DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width),
5821 Qnil, 5793 Qnil,
5822 doc: /* *Width of this buffer's scroll bars in pixels. 5794 doc: /* *Width of this buffer's scroll bars in pixels.
5823A value of nil means to use the scroll bar width from the window's frame. */); 5795A value of nil means to use the scroll bar width from the window's frame. */);
5824 5796
5825 DEFVAR_PER_BUFFER ("vertical-scroll-bar", &B_ (current_buffer, vertical_scroll_bar_type), 5797 DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, vertical_scroll_bar_type),
5826 Qnil, 5798 Qnil,
5827 doc: /* *Position of this buffer's vertical scroll bar. 5799 doc: /* *Position of this buffer's vertical scroll bar.
5828The value takes effect whenever you tell a window to display this buffer; 5800The value takes effect whenever you tell a window to display this buffer;
@@ -5833,13 +5805,13 @@ of the window; a value of nil means don't show any vertical scroll bars.
5833A value of t (the default) means do whatever the window's frame specifies. */); 5805A value of t (the default) means do whatever the window's frame specifies. */);
5834 5806
5835 DEFVAR_PER_BUFFER ("indicate-empty-lines", 5807 DEFVAR_PER_BUFFER ("indicate-empty-lines",
5836 &B_ (current_buffer, indicate_empty_lines), Qnil, 5808 &BVAR (current_buffer, indicate_empty_lines), Qnil,
5837 doc: /* *Visually indicate empty lines after the buffer end. 5809 doc: /* *Visually indicate empty lines after the buffer end.
5838If non-nil, a bitmap is displayed in the left fringe of a window on 5810If non-nil, a bitmap is displayed in the left fringe of a window on
5839window-systems. */); 5811window-systems. */);
5840 5812
5841 DEFVAR_PER_BUFFER ("indicate-buffer-boundaries", 5813 DEFVAR_PER_BUFFER ("indicate-buffer-boundaries",
5842 &B_ (current_buffer, indicate_buffer_boundaries), Qnil, 5814 &BVAR (current_buffer, indicate_buffer_boundaries), Qnil,
5843 doc: /* *Visually indicate buffer boundaries and scrolling. 5815 doc: /* *Visually indicate buffer boundaries and scrolling.
5844If non-nil, the first and last line of the buffer are marked in the fringe 5816If non-nil, the first and last line of the buffer are marked in the fringe
5845of a window on window-systems with angle bitmaps, or if the window can be 5817of a window on window-systems with angle bitmaps, or if the window can be
@@ -5864,7 +5836,7 @@ bitmaps in right fringe. To show just the angle bitmaps in the left
5864fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */); 5836fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */);
5865 5837
5866 DEFVAR_PER_BUFFER ("fringe-indicator-alist", 5838 DEFVAR_PER_BUFFER ("fringe-indicator-alist",
5867 &B_ (current_buffer, fringe_indicator_alist), Qnil, 5839 &BVAR (current_buffer, fringe_indicator_alist), Qnil,
5868 doc: /* *Mapping from logical to physical fringe indicator bitmaps. 5840 doc: /* *Mapping from logical to physical fringe indicator bitmaps.
5869The value is an alist where each element (INDICATOR . BITMAPS) 5841The value is an alist where each element (INDICATOR . BITMAPS)
5870specifies the fringe bitmaps used to display a specific logical 5842specifies the fringe bitmaps used to display a specific logical
@@ -5883,7 +5855,7 @@ last (only) line has no final newline. BITMAPS may also be a single
5883symbol which is used in both left and right fringes. */); 5855symbol which is used in both left and right fringes. */);
5884 5856
5885 DEFVAR_PER_BUFFER ("fringe-cursor-alist", 5857 DEFVAR_PER_BUFFER ("fringe-cursor-alist",
5886 &B_ (current_buffer, fringe_cursor_alist), Qnil, 5858 &BVAR (current_buffer, fringe_cursor_alist), Qnil,
5887 doc: /* *Mapping from logical to physical fringe cursor bitmaps. 5859 doc: /* *Mapping from logical to physical fringe cursor bitmaps.
5888The value is an alist where each element (CURSOR . BITMAP) 5860The value is an alist where each element (CURSOR . BITMAP)
5889specifies the fringe bitmaps used to display a specific logical 5861specifies the fringe bitmaps used to display a specific logical
@@ -5898,7 +5870,7 @@ BITMAP is the corresponding fringe bitmap shown for the logical
5898cursor type. */); 5870cursor type. */);
5899 5871
5900 DEFVAR_PER_BUFFER ("scroll-up-aggressively", 5872 DEFVAR_PER_BUFFER ("scroll-up-aggressively",
5901 &B_ (current_buffer, scroll_up_aggressively), Qnil, 5873 &BVAR (current_buffer, scroll_up_aggressively), Qnil,
5902 doc: /* How far to scroll windows upward. 5874 doc: /* How far to scroll windows upward.
5903If you move point off the bottom, the window scrolls automatically. 5875If you move point off the bottom, the window scrolls automatically.
5904This variable controls how far it scrolls. The value nil, the default, 5876This variable controls how far it scrolls. The value nil, the default,
@@ -5911,7 +5883,7 @@ window scrolls by a full window height. Meaningful values are
5911between 0.0 and 1.0, inclusive. */); 5883between 0.0 and 1.0, inclusive. */);
5912 5884
5913 DEFVAR_PER_BUFFER ("scroll-down-aggressively", 5885 DEFVAR_PER_BUFFER ("scroll-down-aggressively",
5914 &B_ (current_buffer, scroll_down_aggressively), Qnil, 5886 &BVAR (current_buffer, scroll_down_aggressively), Qnil,
5915 doc: /* How far to scroll windows downward. 5887 doc: /* How far to scroll windows downward.
5916If you move point off the top, the window scrolls automatically. 5888If you move point off the top, the window scrolls automatically.
5917This variable controls how far it scrolls. The value nil, the default, 5889This variable controls how far it scrolls. The value nil, the default,
@@ -5966,7 +5938,7 @@ from happening repeatedly and making Emacs nonfunctional. */);
5966The functions are run using the `run-hooks' function. */); 5938The functions are run using the `run-hooks' function. */);
5967 Vfirst_change_hook = Qnil; 5939 Vfirst_change_hook = Qnil;
5968 5940
5969 DEFVAR_PER_BUFFER ("buffer-undo-list", &B_ (current_buffer, undo_list), Qnil, 5941 DEFVAR_PER_BUFFER ("buffer-undo-list", &BVAR (current_buffer, undo_list), Qnil,
5970 doc: /* List of undo entries in current buffer. 5942 doc: /* List of undo entries in current buffer.
5971Recent changes come first; older changes follow newer. 5943Recent changes come first; older changes follow newer.
5972 5944
@@ -6007,10 +5979,10 @@ the changes between two undo boundaries as a single step to be undone.
6007 5979
6008If the value of the variable is t, undo information is not recorded. */); 5980If the value of the variable is t, undo information is not recorded. */);
6009 5981
6010 DEFVAR_PER_BUFFER ("mark-active", &B_ (current_buffer, mark_active), Qnil, 5982 DEFVAR_PER_BUFFER ("mark-active", &BVAR (current_buffer, mark_active), Qnil,
6011 doc: /* Non-nil means the mark and region are currently active in this buffer. */); 5983 doc: /* Non-nil means the mark and region are currently active in this buffer. */);
6012 5984
6013 DEFVAR_PER_BUFFER ("cache-long-line-scans", &B_ (current_buffer, cache_long_line_scans), Qnil, 5985 DEFVAR_PER_BUFFER ("cache-long-line-scans", &BVAR (current_buffer, cache_long_line_scans), Qnil,
6014 doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly. 5986 doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly.
6015 5987
6016Normally, the line-motion functions work by scanning the buffer for 5988Normally, the line-motion functions work by scanning the buffer for
@@ -6038,23 +6010,23 @@ maintained internally by the Emacs primitives. Enabling or disabling
6038the cache should not affect the behavior of any of the motion 6010the cache should not affect the behavior of any of the motion
6039functions; it should only affect their performance. */); 6011functions; it should only affect their performance. */);
6040 6012
6041 DEFVAR_PER_BUFFER ("point-before-scroll", &B_ (current_buffer, point_before_scroll), Qnil, 6013 DEFVAR_PER_BUFFER ("point-before-scroll", &BVAR (current_buffer, point_before_scroll), Qnil,
6042 doc: /* Value of point before the last series of scroll operations, or nil. */); 6014 doc: /* Value of point before the last series of scroll operations, or nil. */);
6043 6015
6044 DEFVAR_PER_BUFFER ("buffer-file-format", &B_ (current_buffer, file_format), Qnil, 6016 DEFVAR_PER_BUFFER ("buffer-file-format", &BVAR (current_buffer, file_format), Qnil,
6045 doc: /* List of formats to use when saving this buffer. 6017 doc: /* List of formats to use when saving this buffer.
6046Formats are defined by `format-alist'. This variable is 6018Formats are defined by `format-alist'. This variable is
6047set when a file is visited. */); 6019set when a file is visited. */);
6048 6020
6049 DEFVAR_PER_BUFFER ("buffer-auto-save-file-format", 6021 DEFVAR_PER_BUFFER ("buffer-auto-save-file-format",
6050 &B_ (current_buffer, auto_save_file_format), Qnil, 6022 &BVAR (current_buffer, auto_save_file_format), Qnil,
6051 doc: /* *Format in which to write auto-save files. 6023 doc: /* *Format in which to write auto-save files.
6052Should be a list of symbols naming formats that are defined in `format-alist'. 6024Should be a list of symbols naming formats that are defined in `format-alist'.
6053If it is t, which is the default, auto-save files are written in the 6025If it is t, which is the default, auto-save files are written in the
6054same format as a regular save would use. */); 6026same format as a regular save would use. */);
6055 6027
6056 DEFVAR_PER_BUFFER ("buffer-invisibility-spec", 6028 DEFVAR_PER_BUFFER ("buffer-invisibility-spec",
6057 &B_ (current_buffer, invisibility_spec), Qnil, 6029 &BVAR (current_buffer, invisibility_spec), Qnil,
6058 doc: /* Invisibility spec of this buffer. 6030 doc: /* Invisibility spec of this buffer.
6059The default is t, which means that text is invisible 6031The default is t, which means that text is invisible
6060if it has a non-nil `invisible' property. 6032if it has a non-nil `invisible' property.
@@ -6065,12 +6037,12 @@ then characters with property value PROP are invisible,
6065and they have an ellipsis as well if ELLIPSIS is non-nil. */); 6037and they have an ellipsis as well if ELLIPSIS is non-nil. */);
6066 6038
6067 DEFVAR_PER_BUFFER ("buffer-display-count", 6039 DEFVAR_PER_BUFFER ("buffer-display-count",
6068 &B_ (current_buffer, display_count), Qnil, 6040 &BVAR (current_buffer, display_count), Qnil,
6069 doc: /* A number incremented each time this buffer is displayed in a window. 6041 doc: /* A number incremented each time this buffer is displayed in a window.
6070The function `set-window-buffer' increments it. */); 6042The function `set-window-buffer' increments it. */);
6071 6043
6072 DEFVAR_PER_BUFFER ("buffer-display-time", 6044 DEFVAR_PER_BUFFER ("buffer-display-time",
6073 &B_ (current_buffer, display_time), Qnil, 6045 &BVAR (current_buffer, display_time), Qnil,
6074 doc: /* Time stamp updated each time this buffer is displayed in a window. 6046 doc: /* Time stamp updated each time this buffer is displayed in a window.
6075The function `set-window-buffer' updates this variable 6047The function `set-window-buffer' updates this variable
6076to the value obtained by calling `current-time'. 6048to the value obtained by calling `current-time'.
@@ -6105,7 +6077,7 @@ and disregard a `read-only' text property if the property value
6105is a member of the list. */); 6077is a member of the list. */);
6106 Vinhibit_read_only = Qnil; 6078 Vinhibit_read_only = Qnil;
6107 6079
6108 DEFVAR_PER_BUFFER ("cursor-type", &B_ (current_buffer, cursor_type), Qnil, 6080 DEFVAR_PER_BUFFER ("cursor-type", &BVAR (current_buffer, cursor_type), Qnil,
6109 doc: /* Cursor to use when this buffer is in the selected window. 6081 doc: /* Cursor to use when this buffer is in the selected window.
6110Values are interpreted as follows: 6082Values are interpreted as follows:
6111 6083
@@ -6124,7 +6096,7 @@ cursor's appearance is instead controlled by the variable
6124`cursor-in-non-selected-windows'. */); 6096`cursor-in-non-selected-windows'. */);
6125 6097
6126 DEFVAR_PER_BUFFER ("line-spacing", 6098 DEFVAR_PER_BUFFER ("line-spacing",
6127 &B_ (current_buffer, extra_line_spacing), Qnil, 6099 &BVAR (current_buffer, extra_line_spacing), Qnil,
6128 doc: /* Additional space to put between lines when displaying a buffer. 6100 doc: /* Additional space to put between lines when displaying a buffer.
6129The space is measured in pixels, and put below lines on graphic displays, 6101The space is measured in pixels, and put below lines on graphic displays,
6130see `display-graphic-p'. 6102see `display-graphic-p'.
@@ -6132,7 +6104,7 @@ If value is a floating point number, it specifies the spacing relative
6132to the default frame line height. A value of nil means add no extra space. */); 6104to the default frame line height. A value of nil means add no extra space. */);
6133 6105
6134 DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", 6106 DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows",
6135 &B_ (current_buffer, cursor_in_non_selected_windows), Qnil, 6107 &BVAR (current_buffer, cursor_in_non_selected_windows), Qnil,
6136 doc: /* *Non-nil means show a cursor in non-selected windows. 6108 doc: /* *Non-nil means show a cursor in non-selected windows.
6137If nil, only shows a cursor in the selected window. 6109If nil, only shows a cursor in the selected window.
6138If t, displays a cursor related to the usual cursor type 6110If t, displays a cursor related to the usual cursor type
diff --git a/src/buffer.h b/src/buffer.h
index 36cb5fe9dda..65c7168d60a 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -321,7 +321,7 @@ while (0)
321/* Return character at byte position POS. */ 321/* Return character at byte position POS. */
322 322
323#define FETCH_CHAR(pos) \ 323#define FETCH_CHAR(pos) \
324 (!NILP (B_ (current_buffer, enable_multibyte_characters)) \ 324 (!NILP (BVAR (current_buffer, enable_multibyte_characters)) \
325 ? FETCH_MULTIBYTE_CHAR ((pos)) \ 325 ? FETCH_MULTIBYTE_CHAR ((pos)) \
326 : FETCH_BYTE ((pos))) 326 : FETCH_BYTE ((pos)))
327 327
@@ -346,7 +346,7 @@ extern unsigned char *_fetch_multibyte_char_p;
346 multibyte. */ 346 multibyte. */
347 347
348#define FETCH_CHAR_AS_MULTIBYTE(pos) \ 348#define FETCH_CHAR_AS_MULTIBYTE(pos) \
349 (!NILP (B_ (current_buffer, enable_multibyte_characters)) \ 349 (!NILP (BVAR (current_buffer, enable_multibyte_characters)) \
350 ? FETCH_MULTIBYTE_CHAR ((pos)) \ 350 ? FETCH_MULTIBYTE_CHAR ((pos)) \
351 : UNIBYTE_TO_CHAR (FETCH_BYTE ((pos)))) 351 : UNIBYTE_TO_CHAR (FETCH_BYTE ((pos))))
352 352
@@ -465,13 +465,13 @@ struct buffer_text
465 }; 465 };
466 466
467/* Lisp fields in struct buffer are hidden from most code and accessed 467/* Lisp fields in struct buffer are hidden from most code and accessed
468 via the B_ macro, below. Only select pieces of code, like the GC, 468 via the BVAR macro, below. Only select pieces of code, like the GC,
469 are allowed to use BUFFER_INTERNAL_FIELD. */ 469 are allowed to use BUFFER_INTERNAL_FIELD. */
470#define BUFFER_INTERNAL_FIELD(field) field ## _ 470#define BUFFER_INTERNAL_FIELD(field) field ## _
471 471
472/* Most code should use this macro to access Lisp fields in struct 472/* Most code should use this macro to access Lisp fields in struct
473 buffer. */ 473 buffer. */
474#define B_(buf, field) ((buf)->BUFFER_INTERNAL_FIELD (field)) 474#define BVAR(buf, field) ((buf)->BUFFER_INTERNAL_FIELD (field))
475 475
476/* This is the structure that the buffer Lisp object points to. */ 476/* This is the structure that the buffer Lisp object points to. */
477 477
@@ -662,12 +662,6 @@ struct buffer
662 Lisp_Object BUFFER_INTERNAL_FIELD (left_margin); 662 Lisp_Object BUFFER_INTERNAL_FIELD (left_margin);
663 /* Function to call when insert space past fill column. */ 663 /* Function to call when insert space past fill column. */
664 Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function); 664 Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function);
665 /* nil: text, t: binary.
666 This value is meaningful only on certain operating systems. */
667 /* Actually, we don't need this flag any more because end-of-line
668 is handled correctly according to the buffer-file-coding-system
669 of the buffer. Just keeping it for backward compatibility. */
670 Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_type);
671 665
672 /* Case table for case-conversion in this buffer. 666 /* Case table for case-conversion in this buffer.
673 This char-table maps each char into its lower-case version. */ 667 This char-table maps each char into its lower-case version. */
diff --git a/src/bytecode.c b/src/bytecode.c
index a470eca16a9..cf4a1fc225f 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -229,6 +229,8 @@ Lisp_Object Qbytecode;
229#define Bconstant 0300 229#define Bconstant 0300
230#define CONSTANTLIM 0100 230#define CONSTANTLIM 0100
231 231
232/* Whether to maintain a `top' and `bottom' field in the stack frame. */
233#define BYTE_MAINTAIN_TOP (BYTE_CODE_SAFE || BYTE_MARK_STACK)
232 234
233/* Structure describing a value stack used during byte-code execution 235/* Structure describing a value stack used during byte-code execution
234 in Fbyte_code. */ 236 in Fbyte_code. */
@@ -241,7 +243,9 @@ struct byte_stack
241 243
242 /* Top and bottom of stack. The bottom points to an area of memory 244 /* Top and bottom of stack. The bottom points to an area of memory
243 allocated with alloca in Fbyte_code. */ 245 allocated with alloca in Fbyte_code. */
246#if BYTE_MAINTAIN_TOP
244 Lisp_Object *top, *bottom; 247 Lisp_Object *top, *bottom;
248#endif
245 249
246 /* The string containing the byte-code, and its current address. 250 /* The string containing the byte-code, and its current address.
247 Storing this here protects it from GC because mark_byte_stack 251 Storing this here protects it from GC because mark_byte_stack
@@ -268,6 +272,7 @@ struct byte_stack *byte_stack_list;
268 272
269/* Mark objects on byte_stack_list. Called during GC. */ 273/* Mark objects on byte_stack_list. Called during GC. */
270 274
275#if BYTE_MARK_STACK
271void 276void
272mark_byte_stack (void) 277mark_byte_stack (void)
273{ 278{
@@ -292,7 +297,7 @@ mark_byte_stack (void)
292 mark_object (stack->constants); 297 mark_object (stack->constants);
293 } 298 }
294} 299}
295 300#endif
296 301
297/* Unmark objects in the stacks on byte_stack_list. Relocate program 302/* Unmark objects in the stacks on byte_stack_list. Relocate program
298 counters. Called when GC has completed. */ 303 counters. Called when GC has completed. */
@@ -346,8 +351,13 @@ unmark_byte_stack (void)
346/* Actions that must be performed before and after calling a function 351/* Actions that must be performed before and after calling a function
347 that might GC. */ 352 that might GC. */
348 353
354#if !BYTE_MAINTAIN_TOP
355#define BEFORE_POTENTIAL_GC() ((void)0)
356#define AFTER_POTENTIAL_GC() ((void)0)
357#else
349#define BEFORE_POTENTIAL_GC() stack.top = top 358#define BEFORE_POTENTIAL_GC() stack.top = top
350#define AFTER_POTENTIAL_GC() stack.top = NULL 359#define AFTER_POTENTIAL_GC() stack.top = NULL
360#endif
351 361
352/* Garbage collect if we have consed enough since the last time. 362/* Garbage collect if we have consed enough since the last time.
353 We do this at every branch, to avoid loops that never GC. */ 363 We do this at every branch, to avoid loops that never GC. */
@@ -447,10 +457,13 @@ If the third argument is incorrect, Emacs may crash. */)
447 stack.byte_string = bytestr; 457 stack.byte_string = bytestr;
448 stack.pc = stack.byte_string_start = SDATA (bytestr); 458 stack.pc = stack.byte_string_start = SDATA (bytestr);
449 stack.constants = vector; 459 stack.constants = vector;
450 stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) 460 top = (Lisp_Object *) alloca (XFASTINT (maxdepth)
451 * sizeof (Lisp_Object)); 461 * sizeof (Lisp_Object));
452 top = stack.bottom - 1; 462#if BYTE_MAINTAIN_TOP
463 stack.bottom = top;
453 stack.top = NULL; 464 stack.top = NULL;
465#endif
466 top -= 1;
454 stack.next = byte_stack_list; 467 stack.next = byte_stack_list;
455 byte_stack_list = &stack; 468 byte_stack_list = &stack;
456 469
@@ -1398,7 +1411,7 @@ If the third argument is incorrect, Emacs may crash. */)
1398 CHECK_CHARACTER (TOP); 1411 CHECK_CHARACTER (TOP);
1399 AFTER_POTENTIAL_GC (); 1412 AFTER_POTENTIAL_GC ();
1400 c = XFASTINT (TOP); 1413 c = XFASTINT (TOP);
1401 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 1414 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
1402 MAKE_CHAR_MULTIBYTE (c); 1415 MAKE_CHAR_MULTIBYTE (c);
1403 XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]); 1416 XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]);
1404 } 1417 }
diff --git a/src/callint.c b/src/callint.c
index 154659490b8..21dd3cd4d9d 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -149,12 +149,12 @@ static void
149check_mark (int for_region) 149check_mark (int for_region)
150{ 150{
151 Lisp_Object tem; 151 Lisp_Object tem;
152 tem = Fmarker_buffer (B_ (current_buffer, mark)); 152 tem = Fmarker_buffer (BVAR (current_buffer, mark));
153 if (NILP (tem) || (XBUFFER (tem) != current_buffer)) 153 if (NILP (tem) || (XBUFFER (tem) != current_buffer))
154 error (for_region ? "The mark is not set now, so there is no region" 154 error (for_region ? "The mark is not set now, so there is no region"
155 : "The mark is not set now"); 155 : "The mark is not set now");
156 if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive) 156 if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive)
157 && NILP (B_ (current_buffer, mark_active))) 157 && NILP (BVAR (current_buffer, mark_active)))
158 xsignal0 (Qmark_inactive); 158 xsignal0 (Qmark_inactive);
159} 159}
160 160
@@ -280,7 +280,7 @@ invoke it. If KEYS is omitted or nil, the return value of
280 save_this_command = Vthis_command; 280 save_this_command = Vthis_command;
281 save_this_original_command = Vthis_original_command; 281 save_this_original_command = Vthis_original_command;
282 save_real_this_command = real_this_command; 282 save_real_this_command = real_this_command;
283 save_last_command = current_kboard->Vlast_command; 283 save_last_command = KVAR (current_kboard, Vlast_command);
284 284
285 if (NILP (keys)) 285 if (NILP (keys))
286 keys = this_command_keys, key_count = this_command_key_count; 286 keys = this_command_keys, key_count = this_command_key_count;
@@ -363,7 +363,7 @@ invoke it. If KEYS is omitted or nil, the return value of
363 Vthis_command = save_this_command; 363 Vthis_command = save_this_command;
364 Vthis_original_command = save_this_original_command; 364 Vthis_original_command = save_this_original_command;
365 real_this_command= save_real_this_command; 365 real_this_command= save_real_this_command;
366 current_kboard->Vlast_command = save_last_command; 366 KVAR (current_kboard, Vlast_command) = save_last_command;
367 367
368 temporarily_switch_to_single_kboard (NULL); 368 temporarily_switch_to_single_kboard (NULL);
369 return unbind_to (speccount, apply1 (function, specs)); 369 return unbind_to (speccount, apply1 (function, specs));
@@ -385,7 +385,7 @@ invoke it. If KEYS is omitted or nil, the return value of
385 else if (*string == '*') 385 else if (*string == '*')
386 { 386 {
387 string++; 387 string++;
388 if (!NILP (B_ (current_buffer, read_only))) 388 if (!NILP (BVAR (current_buffer, read_only)))
389 { 389 {
390 if (!NILP (record_flag)) 390 if (!NILP (record_flag))
391 { 391 {
@@ -543,7 +543,7 @@ invoke it. If KEYS is omitted or nil, the return value of
543 543
544 case 'D': /* Directory name. */ 544 case 'D': /* Directory name. */
545 args[i] = Fread_file_name (callint_message, Qnil, 545 args[i] = Fread_file_name (callint_message, Qnil,
546 B_ (current_buffer, directory), Qlambda, Qnil, 546 BVAR (current_buffer, directory), Qlambda, Qnil,
547 Qfile_directory_p); 547 Qfile_directory_p);
548 break; 548 break;
549 549
@@ -661,7 +661,7 @@ invoke it. If KEYS is omitted or nil, the return value of
661 case 'm': /* Value of mark. Does not do I/O. */ 661 case 'm': /* Value of mark. Does not do I/O. */
662 check_mark (0); 662 check_mark (0);
663 /* visargs[i] = Qnil; */ 663 /* visargs[i] = Qnil; */
664 args[i] = B_ (current_buffer, mark); 664 args[i] = BVAR (current_buffer, mark);
665 varies[i] = 2; 665 varies[i] = 2;
666 break; 666 break;
667 667
@@ -717,11 +717,11 @@ invoke it. If KEYS is omitted or nil, the return value of
717 check_mark (1); 717 check_mark (1);
718 set_marker_both (point_marker, Qnil, PT, PT_BYTE); 718 set_marker_both (point_marker, Qnil, PT, PT_BYTE);
719 /* visargs[i+1] = Qnil; */ 719 /* visargs[i+1] = Qnil; */
720 foo = marker_position (B_ (current_buffer, mark)); 720 foo = marker_position (BVAR (current_buffer, mark));
721 /* visargs[i] = Qnil; */ 721 /* visargs[i] = Qnil; */
722 args[i] = PT < foo ? point_marker : B_ (current_buffer, mark); 722 args[i] = PT < foo ? point_marker : BVAR (current_buffer, mark);
723 varies[i] = 3; 723 varies[i] = 3;
724 args[++i] = PT > foo ? point_marker : B_ (current_buffer, mark); 724 args[++i] = PT > foo ? point_marker : BVAR (current_buffer, mark);
725 varies[i] = 4; 725 varies[i] = 4;
726 break; 726 break;
727 727
@@ -832,7 +832,7 @@ invoke it. If KEYS is omitted or nil, the return value of
832 Vthis_command = save_this_command; 832 Vthis_command = save_this_command;
833 Vthis_original_command = save_this_original_command; 833 Vthis_original_command = save_this_original_command;
834 real_this_command= save_real_this_command; 834 real_this_command= save_real_this_command;
835 current_kboard->Vlast_command = save_last_command; 835 KVAR (current_kboard, Vlast_command) = save_last_command;
836 836
837 { 837 {
838 Lisp_Object val; 838 Lisp_Object val;
diff --git a/src/callproc.c b/src/callproc.c
index bdd3060bef1..c53a92bbaf8 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -74,10 +74,6 @@ extern char **environ;
74/* Pattern used by call-process-region to make temp files. */ 74/* Pattern used by call-process-region to make temp files. */
75static Lisp_Object Vtemp_file_name_pattern; 75static Lisp_Object Vtemp_file_name_pattern;
76 76
77#ifdef DOS_NT
78Lisp_Object Qbuffer_file_type;
79#endif /* DOS_NT */
80
81/* True if we are about to fork off a synchronous process or if we 77/* True if we are about to fork off a synchronous process or if we
82 are waiting for it. */ 78 are waiting for it. */
83int synch_process_alive; 79int synch_process_alive;
@@ -265,7 +261,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
265 261
266 if (nargs >= 2 && ! NILP (args[1])) 262 if (nargs >= 2 && ! NILP (args[1]))
267 { 263 {
268 infile = Fexpand_file_name (args[1], B_ (current_buffer, directory)); 264 infile = Fexpand_file_name (args[1], BVAR (current_buffer, directory));
269 CHECK_STRING (infile); 265 CHECK_STRING (infile);
270 } 266 }
271 else 267 else
@@ -322,7 +318,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
322 { 318 {
323 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 319 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
324 320
325 current_dir = B_ (current_buffer, directory); 321 current_dir = BVAR (current_buffer, directory);
326 322
327 GCPRO4 (infile, buffer, current_dir, error_file); 323 GCPRO4 (infile, buffer, current_dir, error_file);
328 324
@@ -336,7 +332,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
336 332
337 if (NILP (Ffile_accessible_directory_p (current_dir))) 333 if (NILP (Ffile_accessible_directory_p (current_dir)))
338 report_file_error ("Setting current directory", 334 report_file_error ("Setting current directory",
339 Fcons (B_ (current_buffer, directory), Qnil)); 335 Fcons (BVAR (current_buffer, directory), Qnil));
340 336
341 if (STRING_MULTIBYTE (infile)) 337 if (STRING_MULTIBYTE (infile))
342 infile = ENCODE_FILE (infile); 338 infile = ENCODE_FILE (infile);
@@ -663,7 +659,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
663 /* In unibyte mode, character code conversion should not take 659 /* In unibyte mode, character code conversion should not take
664 place but EOL conversion should. So, setup raw-text or one 660 place but EOL conversion should. So, setup raw-text or one
665 of the subsidiary according to the information just setup. */ 661 of the subsidiary according to the information just setup. */
666 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 662 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
667 && !NILP (val)) 663 && !NILP (val))
668 val = raw_text_coding_system (val); 664 val = raw_text_coding_system (val);
669 setup_coding_system (val, &process_coding); 665 setup_coding_system (val, &process_coding);
@@ -713,7 +709,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
713 709
714 if (!NILP (buffer)) 710 if (!NILP (buffer))
715 { 711 {
716 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 712 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
717 && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) 713 && ! CODING_MAY_REQUIRE_DECODING (&process_coding))
718 insert_1_both (buf, nread, nread, 0, 1, 0); 714 insert_1_both (buf, nread, nread, 0, 1, 0);
719 else 715 else
@@ -926,7 +922,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
926 /* Decide coding-system of the contents of the temporary file. */ 922 /* Decide coding-system of the contents of the temporary file. */
927 if (!NILP (Vcoding_system_for_write)) 923 if (!NILP (Vcoding_system_for_write))
928 val = Vcoding_system_for_write; 924 val = Vcoding_system_for_write;
929 else if (NILP (B_ (current_buffer, enable_multibyte_characters))) 925 else if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
930 val = Qraw_text; 926 val = Qraw_text;
931 else 927 else
932 { 928 {
@@ -1535,11 +1531,6 @@ set_initial_environment (void)
1535void 1531void
1536syms_of_callproc (void) 1532syms_of_callproc (void)
1537{ 1533{
1538#ifdef DOS_NT
1539 Qbuffer_file_type = intern_c_string ("buffer-file-type");
1540 staticpro (&Qbuffer_file_type);
1541#endif /* DOS_NT */
1542
1543#ifndef DOS_NT 1534#ifndef DOS_NT
1544 Vtemp_file_name_pattern = build_string ("emacsXXXXXX"); 1535 Vtemp_file_name_pattern = build_string ("emacsXXXXXX");
1545#elif defined (WINDOWSNT) 1536#elif defined (WINDOWSNT)
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 6c05aecffe8..26fa0db2d77 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -39,15 +39,15 @@ casify_object (enum case_action flag, Lisp_Object obj)
39 register int inword = flag == CASE_DOWN; 39 register int inword = flag == CASE_DOWN;
40 40
41 /* If the case table is flagged as modified, rescan it. */ 41 /* If the case table is flagged as modified, rescan it. */
42 if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1])) 42 if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1]))
43 Fset_case_table (B_ (current_buffer, downcase_table)); 43 Fset_case_table (BVAR (current_buffer, downcase_table));
44 44
45 if (INTEGERP (obj)) 45 if (INTEGERP (obj))
46 { 46 {
47 int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER 47 int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER
48 | CHAR_SHIFT | CHAR_CTL | CHAR_META); 48 | CHAR_SHIFT | CHAR_CTL | CHAR_META);
49 int flags = XINT (obj) & flagbits; 49 int flags = XINT (obj) & flagbits;
50 int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 50 int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
51 51
52 /* If the character has higher bits set 52 /* If the character has higher bits set
53 above the flags, return it unchanged. 53 above the flags, return it unchanged.
@@ -198,7 +198,7 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
198{ 198{
199 register int c; 199 register int c;
200 register int inword = flag == CASE_DOWN; 200 register int inword = flag == CASE_DOWN;
201 register int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); 201 register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
202 EMACS_INT start, end; 202 EMACS_INT start, end;
203 EMACS_INT start_byte, end_byte; 203 EMACS_INT start_byte, end_byte;
204 EMACS_INT first = -1, last; /* Position of first and last changes. */ 204 EMACS_INT first = -1, last; /* Position of first and last changes. */
@@ -210,8 +210,8 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
210 return; 210 return;
211 211
212 /* If the case table is flagged as modified, rescan it. */ 212 /* If the case table is flagged as modified, rescan it. */
213 if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1])) 213 if (NILP (XCHAR_TABLE (BVAR (current_buffer, downcase_table))->extras[1]))
214 Fset_case_table (B_ (current_buffer, downcase_table)); 214 Fset_case_table (BVAR (current_buffer, downcase_table));
215 215
216 validate_region (&b, &e); 216 validate_region (&b, &e);
217 start = XFASTINT (b); 217 start = XFASTINT (b);
diff --git a/src/casetab.c b/src/casetab.c
index 85c2d6e1581..5207e5315ae 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -71,7 +71,7 @@ DEFUN ("current-case-table", Fcurrent_case_table, Scurrent_case_table, 0, 0, 0,
71 doc: /* Return the case table of the current buffer. */) 71 doc: /* Return the case table of the current buffer. */)
72 (void) 72 (void)
73{ 73{
74 return B_ (current_buffer, downcase_table); 74 return BVAR (current_buffer, downcase_table);
75} 75}
76 76
77DEFUN ("standard-case-table", Fstandard_case_table, Sstandard_case_table, 0, 0, 0, 77DEFUN ("standard-case-table", Fstandard_case_table, Sstandard_case_table, 0, 0, 0,
@@ -160,10 +160,10 @@ set_case_table (Lisp_Object table, int standard)
160 } 160 }
161 else 161 else
162 { 162 {
163 B_ (current_buffer, downcase_table) = table; 163 BVAR (current_buffer, downcase_table) = table;
164 B_ (current_buffer, upcase_table) = up; 164 BVAR (current_buffer, upcase_table) = up;
165 B_ (current_buffer, case_canon_table) = canon; 165 BVAR (current_buffer, case_canon_table) = canon;
166 B_ (current_buffer, case_eqv_table) = eqv; 166 BVAR (current_buffer, case_eqv_table) = eqv;
167 } 167 }
168 168
169 return table; 169 return table;
diff --git a/src/category.c b/src/category.c
index bf8269ffd75..bcd73d3a487 100644
--- a/src/category.c
+++ b/src/category.c
@@ -190,7 +190,7 @@ Lisp_Object
190check_category_table (Lisp_Object table) 190check_category_table (Lisp_Object table)
191{ 191{
192 if (NILP (table)) 192 if (NILP (table))
193 return B_ (current_buffer, category_table); 193 return BVAR (current_buffer, category_table);
194 CHECK_TYPE (!NILP (Fcategory_table_p (table)), Qcategory_table_p, table); 194 CHECK_TYPE (!NILP (Fcategory_table_p (table)), Qcategory_table_p, table);
195 return table; 195 return table;
196} 196}
@@ -200,7 +200,7 @@ DEFUN ("category-table", Fcategory_table, Scategory_table, 0, 0, 0,
200This is the one specified by the current buffer. */) 200This is the one specified by the current buffer. */)
201 (void) 201 (void)
202{ 202{
203 return B_ (current_buffer, category_table); 203 return BVAR (current_buffer, category_table);
204} 204}
205 205
206DEFUN ("standard-category-table", Fstandard_category_table, 206DEFUN ("standard-category-table", Fstandard_category_table,
@@ -281,7 +281,7 @@ Return TABLE. */)
281{ 281{
282 int idx; 282 int idx;
283 table = check_category_table (table); 283 table = check_category_table (table);
284 B_ (current_buffer, category_table) = table; 284 BVAR (current_buffer, category_table) = table;
285 /* Indicate that this buffer now has a specified category table. */ 285 /* Indicate that this buffer now has a specified category table. */
286 idx = PER_BUFFER_VAR_IDX (category_table); 286 idx = PER_BUFFER_VAR_IDX (category_table);
287 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); 287 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
@@ -292,7 +292,7 @@ Return TABLE. */)
292Lisp_Object 292Lisp_Object
293char_category_set (int c) 293char_category_set (int c)
294{ 294{
295 return CHAR_TABLE_REF (B_ (current_buffer, category_table), c); 295 return CHAR_TABLE_REF (BVAR (current_buffer, category_table), c);
296} 296}
297 297
298DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0, 298DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0,
diff --git a/src/category.h b/src/category.h
index 16b31da0819..b279f3d9c59 100644
--- a/src/category.h
+++ b/src/category.h
@@ -91,7 +91,7 @@ extern Lisp_Object _temp_category_set;
91 91
92/* The standard category table is stored where it will automatically 92/* The standard category table is stored where it will automatically
93 be used in all new buffers. */ 93 be used in all new buffers. */
94#define Vstandard_category_table B_ (&buffer_defaults, category_table) 94#define Vstandard_category_table BVAR (&buffer_defaults, category_table)
95 95
96/* Return the category set of character C in the current category table. */ 96/* Return the category set of character C in the current category table. */
97#define CATEGORY_SET(c) char_category_set (c) 97#define CATEGORY_SET(c) char_category_set (c)
diff --git a/src/character.c b/src/character.c
index e4ff3d7922c..f12c4f28d31 100644
--- a/src/character.c
+++ b/src/character.c
@@ -521,7 +521,7 @@ chars_in_text (const unsigned char *ptr, EMACS_INT nbytes)
521{ 521{
522 /* current_buffer is null at early stages of Emacs initialization. */ 522 /* current_buffer is null at early stages of Emacs initialization. */
523 if (current_buffer == 0 523 if (current_buffer == 0
524 || NILP (B_ (current_buffer, enable_multibyte_characters))) 524 || NILP (BVAR (current_buffer, enable_multibyte_characters)))
525 return nbytes; 525 return nbytes;
526 526
527 return multibyte_chars_in_text (ptr, nbytes); 527 return multibyte_chars_in_text (ptr, nbytes);
@@ -987,7 +987,7 @@ character is not ASCII nor 8-bit character, an error is signalled. */)
987 pos = XFASTINT (position); 987 pos = XFASTINT (position);
988 p = CHAR_POS_ADDR (pos); 988 p = CHAR_POS_ADDR (pos);
989 } 989 }
990 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 990 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
991 return make_number (*p); 991 return make_number (*p);
992 } 992 }
993 else 993 else
diff --git a/src/character.h b/src/character.h
index f2d06102f62..fb29ced66b7 100644
--- a/src/character.h
+++ b/src/character.h
@@ -417,7 +417,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
417 do \ 417 do \
418 { \ 418 { \
419 CHARIDX++; \ 419 CHARIDX++; \
420 if (!NILP (B_ (current_buffer, enable_multibyte_characters))) \ 420 if (!NILP (BVAR (current_buffer, enable_multibyte_characters))) \
421 { \ 421 { \
422 unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \ 422 unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
423 int len; \ 423 int len; \
@@ -484,7 +484,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
484 do \ 484 do \
485 { \ 485 { \
486 (charpos)++; \ 486 (charpos)++; \
487 if (NILP (B_ (current_buffer, enable_multibyte_characters))) \ 487 if (NILP (BVAR (current_buffer, enable_multibyte_characters))) \
488 (bytepos)++; \ 488 (bytepos)++; \
489 else \ 489 else \
490 INC_POS ((bytepos)); \ 490 INC_POS ((bytepos)); \
@@ -498,7 +498,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
498 do \ 498 do \
499 { \ 499 { \
500 (charpos)--; \ 500 (charpos)--; \
501 if (NILP (B_ (current_buffer, enable_multibyte_characters))) \ 501 if (NILP (BVAR (current_buffer, enable_multibyte_characters))) \
502 (bytepos)--; \ 502 (bytepos)--; \
503 else \ 503 else \
504 DEC_POS ((bytepos)); \ 504 DEC_POS ((bytepos)); \
@@ -561,11 +561,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
561#define ASCII_CHAR_WIDTH(c) \ 561#define ASCII_CHAR_WIDTH(c) \
562 (c < 0x20 \ 562 (c < 0x20 \
563 ? (c == '\t' \ 563 ? (c == '\t' \
564 ? XFASTINT (B_ (current_buffer, tab_width)) \ 564 ? XFASTINT (BVAR (current_buffer, tab_width)) \
565 : (c == '\n' ? 0 : (NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2))) \ 565 : (c == '\n' ? 0 : (NILP (BVAR (current_buffer, ctl_arrow)) ? 4 : 2))) \
566 : (c < 0x7f \ 566 : (c < 0x7f \
567 ? 1 \ 567 ? 1 \
568 : ((NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2)))) 568 : ((NILP (BVAR (current_buffer, ctl_arrow)) ? 4 : 2))))
569 569
570/* Return the width of character C. The width is measured by how many 570/* Return the width of character C. The width is measured by how many
571 columns C will occupy on the screen when displayed in the current 571 columns C will occupy on the screen when displayed in the current
diff --git a/src/charset.c b/src/charset.c
index 80e6a114197..3624e740acb 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1554,7 +1554,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
1554 EMACS_INT from, from_byte, to, stop, stop_byte; 1554 EMACS_INT from, from_byte, to, stop, stop_byte;
1555 int i; 1555 int i;
1556 Lisp_Object val; 1556 Lisp_Object val;
1557 int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 1557 int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
1558 1558
1559 validate_region (&beg, &end); 1559 validate_region (&beg, &end);
1560 from = XFASTINT (beg); 1560 from = XFASTINT (beg);
diff --git a/src/cmds.c b/src/cmds.c
index e82ada6f03c..336bf1154f9 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -277,7 +277,7 @@ After insertion, the value of `auto-fill-function' is called if the
277 int remove_boundary = 1; 277 int remove_boundary = 1;
278 CHECK_NATNUM (n); 278 CHECK_NATNUM (n);
279 279
280 if (!EQ (Vthis_command, current_kboard->Vlast_command)) 280 if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
281 nonundocount = 0; 281 nonundocount = 0;
282 282
283 if (NILP (Vexecuting_kbd_macro) 283 if (NILP (Vexecuting_kbd_macro)
@@ -292,10 +292,10 @@ After insertion, the value of `auto-fill-function' is called if the
292 } 292 }
293 293
294 if (remove_boundary 294 if (remove_boundary
295 && CONSP (B_ (current_buffer, undo_list)) 295 && CONSP (BVAR (current_buffer, undo_list))
296 && NILP (XCAR (B_ (current_buffer, undo_list)))) 296 && NILP (XCAR (BVAR (current_buffer, undo_list))))
297 /* Remove the undo_boundary that was just pushed. */ 297 /* Remove the undo_boundary that was just pushed. */
298 B_ (current_buffer, undo_list) = XCDR (B_ (current_buffer, undo_list)); 298 BVAR (current_buffer, undo_list) = XCDR (BVAR (current_buffer, undo_list));
299 299
300 /* Barf if the key that invoked this was not a character. */ 300 /* Barf if the key that invoked this was not a character. */
301 if (!CHARACTERP (last_command_event)) 301 if (!CHARACTERP (last_command_event))
@@ -335,12 +335,12 @@ internal_self_insert (int c, EMACS_INT n)
335 EMACS_INT chars_to_delete = 0; 335 EMACS_INT chars_to_delete = 0;
336 EMACS_INT spaces_to_insert = 0; 336 EMACS_INT spaces_to_insert = 0;
337 337
338 overwrite = B_ (current_buffer, overwrite_mode); 338 overwrite = BVAR (current_buffer, overwrite_mode);
339 if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) 339 if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions))
340 hairy = 1; 340 hairy = 1;
341 341
342 /* At first, get multi-byte form of C in STR. */ 342 /* At first, get multi-byte form of C in STR. */
343 if (!NILP (B_ (current_buffer, enable_multibyte_characters))) 343 if (!NILP (BVAR (current_buffer, enable_multibyte_characters)))
344 { 344 {
345 len = CHAR_STRING (c, str); 345 len = CHAR_STRING (c, str);
346 if (len == 1) 346 if (len == 1)
@@ -416,11 +416,11 @@ internal_self_insert (int c, EMACS_INT n)
416 416
417 synt = SYNTAX (c); 417 synt = SYNTAX (c);
418 418
419 if (!NILP (B_ (current_buffer, abbrev_mode)) 419 if (!NILP (BVAR (current_buffer, abbrev_mode))
420 && synt != Sword 420 && synt != Sword
421 && NILP (B_ (current_buffer, read_only)) 421 && NILP (BVAR (current_buffer, read_only))
422 && PT > BEGV 422 && PT > BEGV
423 && (SYNTAX (!NILP (B_ (current_buffer, enable_multibyte_characters)) 423 && (SYNTAX (!NILP (BVAR (current_buffer, enable_multibyte_characters))
424 ? XFASTINT (Fprevious_char ()) 424 ? XFASTINT (Fprevious_char ())
425 : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) 425 : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
426 == Sword)) 426 == Sword))
@@ -448,7 +448,7 @@ internal_self_insert (int c, EMACS_INT n)
448 448
449 if (chars_to_delete) 449 if (chars_to_delete)
450 { 450 {
451 int mc = ((NILP (B_ (current_buffer, enable_multibyte_characters)) 451 int mc = ((NILP (BVAR (current_buffer, enable_multibyte_characters))
452 && SINGLE_BYTE_CHAR_P (c)) 452 && SINGLE_BYTE_CHAR_P (c))
453 ? UNIBYTE_TO_CHAR (c) : c); 453 ? UNIBYTE_TO_CHAR (c) : c);
454 Lisp_Object string = Fmake_string (make_number (n), make_number (mc)); 454 Lisp_Object string = Fmake_string (make_number (n), make_number (mc));
@@ -479,7 +479,7 @@ internal_self_insert (int c, EMACS_INT n)
479 if ((CHAR_TABLE_P (Vauto_fill_chars) 479 if ((CHAR_TABLE_P (Vauto_fill_chars)
480 ? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c)) 480 ? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c))
481 : (c == ' ' || c == '\n')) 481 : (c == ' ' || c == '\n'))
482 && !NILP (B_ (current_buffer, auto_fill_function))) 482 && !NILP (BVAR (current_buffer, auto_fill_function)))
483 { 483 {
484 Lisp_Object tem; 484 Lisp_Object tem;
485 485
@@ -488,7 +488,7 @@ internal_self_insert (int c, EMACS_INT n)
488 that. Must have the newline in place already so filling and 488 that. Must have the newline in place already so filling and
489 justification, if any, know where the end is going to be. */ 489 justification, if any, know where the end is going to be. */
490 SET_PT_BOTH (PT - 1, PT_BYTE - 1); 490 SET_PT_BOTH (PT - 1, PT_BYTE - 1);
491 tem = call0 (B_ (current_buffer, auto_fill_function)); 491 tem = call0 (BVAR (current_buffer, auto_fill_function));
492 /* Test PT < ZV in case the auto-fill-function is strange. */ 492 /* Test PT < ZV in case the auto-fill-function is strange. */
493 if (c == '\n' && PT < ZV) 493 if (c == '\n' && PT < ZV)
494 SET_PT_BOTH (PT + 1, PT_BYTE + 1); 494 SET_PT_BOTH (PT + 1, PT_BYTE + 1);
diff --git a/src/coding.c b/src/coding.c
index 899cca6d5aa..f6310369ad3 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7038,8 +7038,8 @@ decode_coding (struct coding_system *coding)
7038 set_buffer_internal (XBUFFER (coding->dst_object)); 7038 set_buffer_internal (XBUFFER (coding->dst_object));
7039 if (GPT != PT) 7039 if (GPT != PT)
7040 move_gap_both (PT, PT_BYTE); 7040 move_gap_both (PT, PT_BYTE);
7041 undo_list = B_ (current_buffer, undo_list); 7041 undo_list = BVAR (current_buffer, undo_list);
7042 B_ (current_buffer, undo_list) = Qt; 7042 BVAR (current_buffer, undo_list) = Qt;
7043 } 7043 }
7044 7044
7045 coding->consumed = coding->consumed_char = 0; 7045 coding->consumed = coding->consumed_char = 0;
@@ -7136,7 +7136,7 @@ decode_coding (struct coding_system *coding)
7136 decode_eol (coding); 7136 decode_eol (coding);
7137 if (BUFFERP (coding->dst_object)) 7137 if (BUFFERP (coding->dst_object))
7138 { 7138 {
7139 B_ (current_buffer, undo_list) = undo_list; 7139 BVAR (current_buffer, undo_list) = undo_list;
7140 record_insert (coding->dst_pos, coding->produced_char); 7140 record_insert (coding->dst_pos, coding->produced_char);
7141 } 7141 }
7142 return coding->result; 7142 return coding->result;
@@ -7433,7 +7433,7 @@ encode_coding (struct coding_system *coding)
7433 { 7433 {
7434 set_buffer_internal (XBUFFER (coding->dst_object)); 7434 set_buffer_internal (XBUFFER (coding->dst_object));
7435 coding->dst_multibyte 7435 coding->dst_multibyte
7436 = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 7436 = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
7437 } 7437 }
7438 7438
7439 coding->consumed = coding->consumed_char = 0; 7439 coding->consumed = coding->consumed_char = 0;
@@ -7504,8 +7504,8 @@ make_conversion_work_buffer (int multibyte)
7504 doesn't compile new regexps. */ 7504 doesn't compile new regexps. */
7505 Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt); 7505 Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
7506 Ferase_buffer (); 7506 Ferase_buffer ();
7507 B_ (current_buffer, undo_list) = Qt; 7507 BVAR (current_buffer, undo_list) = Qt;
7508 B_ (current_buffer, enable_multibyte_characters) = multibyte ? Qt : Qnil; 7508 BVAR (current_buffer, enable_multibyte_characters) = multibyte ? Qt : Qnil;
7509 set_buffer_internal (current); 7509 set_buffer_internal (current);
7510 return workbuf; 7510 return workbuf;
7511} 7511}
@@ -7562,7 +7562,7 @@ decode_coding_gap (struct coding_system *coding,
7562 coding->dst_object = coding->src_object; 7562 coding->dst_object = coding->src_object;
7563 coding->dst_pos = PT; 7563 coding->dst_pos = PT;
7564 coding->dst_pos_byte = PT_BYTE; 7564 coding->dst_pos_byte = PT_BYTE;
7565 coding->dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 7565 coding->dst_multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
7566 7566
7567 if (CODING_REQUIRE_DETECTION (coding)) 7567 if (CODING_REQUIRE_DETECTION (coding))
7568 detect_coding (coding); 7568 detect_coding (coding);
@@ -7728,7 +7728,7 @@ decode_coding_object (struct coding_system *coding,
7728 coding->dst_pos = BUF_PT (XBUFFER (dst_object)); 7728 coding->dst_pos = BUF_PT (XBUFFER (dst_object));
7729 coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object)); 7729 coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object));
7730 coding->dst_multibyte 7730 coding->dst_multibyte
7731 = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters)); 7731 = ! NILP (BVAR (XBUFFER (dst_object), enable_multibyte_characters));
7732 } 7732 }
7733 else 7733 else
7734 { 7734 {
@@ -7798,7 +7798,7 @@ decode_coding_object (struct coding_system *coding,
7798 TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte); 7798 TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
7799 else if (saved_pt < from + chars) 7799 else if (saved_pt < from + chars)
7800 TEMP_SET_PT_BOTH (from, from_byte); 7800 TEMP_SET_PT_BOTH (from, from_byte);
7801 else if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 7801 else if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
7802 TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars), 7802 TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
7803 saved_pt_byte + (coding->produced - bytes)); 7803 saved_pt_byte + (coding->produced - bytes));
7804 else 7804 else
@@ -7822,7 +7822,7 @@ decode_coding_object (struct coding_system *coding,
7822 { 7822 {
7823 tail->bytepos = from_byte + coding->produced; 7823 tail->bytepos = from_byte + coding->produced;
7824 tail->charpos 7824 tail->charpos
7825 = (NILP (B_ (current_buffer, enable_multibyte_characters)) 7825 = (NILP (BVAR (current_buffer, enable_multibyte_characters))
7826 ? tail->bytepos : from + coding->produced_char); 7826 ? tail->bytepos : from + coding->produced_char);
7827 } 7827 }
7828 } 7828 }
@@ -7960,7 +7960,7 @@ encode_coding_object (struct coding_system *coding,
7960 set_buffer_temp (current); 7960 set_buffer_temp (current);
7961 } 7961 }
7962 coding->dst_multibyte 7962 coding->dst_multibyte
7963 = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters)); 7963 = ! NILP (BVAR (XBUFFER (dst_object), enable_multibyte_characters));
7964 } 7964 }
7965 else if (EQ (dst_object, Qt)) 7965 else if (EQ (dst_object, Qt))
7966 { 7966 {
@@ -8003,7 +8003,7 @@ encode_coding_object (struct coding_system *coding,
8003 TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte); 8003 TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
8004 else if (saved_pt < from + chars) 8004 else if (saved_pt < from + chars)
8005 TEMP_SET_PT_BOTH (from, from_byte); 8005 TEMP_SET_PT_BOTH (from, from_byte);
8006 else if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 8006 else if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
8007 TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars), 8007 TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
8008 saved_pt_byte + (coding->produced - bytes)); 8008 saved_pt_byte + (coding->produced - bytes));
8009 else 8009 else
@@ -8027,7 +8027,7 @@ encode_coding_object (struct coding_system *coding,
8027 { 8027 {
8028 tail->bytepos = from_byte + coding->produced; 8028 tail->bytepos = from_byte + coding->produced;
8029 tail->charpos 8029 tail->charpos
8030 = (NILP (B_ (current_buffer, enable_multibyte_characters)) 8030 = (NILP (BVAR (current_buffer, enable_multibyte_characters))
8031 ? tail->bytepos : from + coding->produced_char); 8031 ? tail->bytepos : from + coding->produced_char);
8032 } 8032 }
8033 } 8033 }
@@ -8481,7 +8481,7 @@ highest priority. */)
8481 return detect_coding_system (BYTE_POS_ADDR (from_byte), 8481 return detect_coding_system (BYTE_POS_ADDR (from_byte),
8482 to - from, to_byte - from_byte, 8482 to - from, to_byte - from_byte,
8483 !NILP (highest), 8483 !NILP (highest),
8484 !NILP (B_ (current_buffer 8484 !NILP (BVAR (current_buffer
8485 , enable_multibyte_characters)), 8485 , enable_multibyte_characters)),
8486 Qnil); 8486 Qnil);
8487} 8487}
@@ -8564,7 +8564,7 @@ DEFUN ("find-coding-systems-region-internal",
8564 CHECK_NUMBER_COERCE_MARKER (end); 8564 CHECK_NUMBER_COERCE_MARKER (end);
8565 if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) 8565 if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end))
8566 args_out_of_range (start, end); 8566 args_out_of_range (start, end);
8567 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 8567 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
8568 return Qt; 8568 return Qt;
8569 start_byte = CHAR_TO_BYTE (XINT (start)); 8569 start_byte = CHAR_TO_BYTE (XINT (start));
8570 end_byte = CHAR_TO_BYTE (XINT (end)); 8570 end_byte = CHAR_TO_BYTE (XINT (end));
@@ -8698,7 +8698,7 @@ to the string. */)
8698 validate_region (&start, &end); 8698 validate_region (&start, &end);
8699 from = XINT (start); 8699 from = XINT (start);
8700 to = XINT (end); 8700 to = XINT (end);
8701 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 8701 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
8702 || (ascii_compatible 8702 || (ascii_compatible
8703 && (to - from) == (CHAR_TO_BYTE (to) - (CHAR_TO_BYTE (from))))) 8703 && (to - from) == (CHAR_TO_BYTE (to) - (CHAR_TO_BYTE (from)))))
8704 return Qnil; 8704 return Qnil;
@@ -8814,7 +8814,7 @@ is nil. */)
8814 CHECK_NUMBER_COERCE_MARKER (end); 8814 CHECK_NUMBER_COERCE_MARKER (end);
8815 if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) 8815 if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end))
8816 args_out_of_range (start, end); 8816 args_out_of_range (start, end);
8817 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 8817 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
8818 return Qnil; 8818 return Qnil;
8819 start_byte = CHAR_TO_BYTE (XINT (start)); 8819 start_byte = CHAR_TO_BYTE (XINT (start));
8820 end_byte = CHAR_TO_BYTE (XINT (end)); 8820 end_byte = CHAR_TO_BYTE (XINT (end));
diff --git a/src/composite.c b/src/composite.c
index 3c941ea6614..0b0602bf283 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -796,7 +796,7 @@ fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, Lis
796 796
797 if (NILP (string)) 797 if (NILP (string))
798 { 798 {
799 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 799 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
800 error ("Attempt to shape unibyte text"); 800 error ("Attempt to shape unibyte text");
801 validate_region (&start, &end); 801 validate_region (&start, &end);
802 from = XFASTINT (start); 802 from = XFASTINT (start);
@@ -1028,7 +1028,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
1028 cmp_it->stop_pos = endpos = start; 1028 cmp_it->stop_pos = endpos = start;
1029 cmp_it->ch = -1; 1029 cmp_it->ch = -1;
1030 } 1030 }
1031 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 1031 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
1032 || NILP (Vauto_composition_mode)) 1032 || NILP (Vauto_composition_mode))
1033 return; 1033 return;
1034 if (bytepos < 0) 1034 if (bytepos < 0)
@@ -1674,7 +1674,7 @@ composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt)
1674 return new_pt; 1674 return new_pt;
1675 } 1675 }
1676 1676
1677 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 1677 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
1678 || NILP (Vauto_composition_mode)) 1678 || NILP (Vauto_composition_mode))
1679 return new_pt; 1679 return new_pt;
1680 1680
@@ -1851,7 +1851,7 @@ See `find-composition' for more details. */)
1851 1851
1852 if (!find_composition (from, to, &start, &end, &prop, string)) 1852 if (!find_composition (from, to, &start, &end, &prop, string))
1853 { 1853 {
1854 if (!NILP (B_ (current_buffer, enable_multibyte_characters)) 1854 if (!NILP (BVAR (current_buffer, enable_multibyte_characters))
1855 && ! NILP (Vauto_composition_mode) 1855 && ! NILP (Vauto_composition_mode)
1856 && find_automatic_composition (from, to, &start, &end, &gstring, 1856 && find_automatic_composition (from, to, &start, &end, &gstring,
1857 string)) 1857 string))
diff --git a/src/data.c b/src/data.c
index c0557d5c735..d0afca6a09f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1009,7 +1009,7 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
1009 } 1009 }
1010 else 1010 else
1011 { 1011 {
1012 tem1 = assq_no_quit (var, B_ (current_buffer, local_var_alist)); 1012 tem1 = assq_no_quit (var, BVAR (current_buffer, local_var_alist));
1013 XSETBUFFER (blv->where, current_buffer); 1013 XSETBUFFER (blv->where, current_buffer);
1014 } 1014 }
1015 } 1015 }
@@ -1178,7 +1178,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
1178 tem1 = Fassq (symbol, 1178 tem1 = Fassq (symbol,
1179 (blv->frame_local 1179 (blv->frame_local
1180 ? XFRAME (where)->param_alist 1180 ? XFRAME (where)->param_alist
1181 : B_ (XBUFFER (where), local_var_alist))); 1181 : BVAR (XBUFFER (where), local_var_alist)));
1182 blv->where = where; 1182 blv->where = where;
1183 blv->found = 1; 1183 blv->found = 1;
1184 1184
@@ -1209,8 +1209,8 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
1209 bindings, not for frame-local bindings. */ 1209 bindings, not for frame-local bindings. */
1210 eassert (!blv->frame_local); 1210 eassert (!blv->frame_local);
1211 tem1 = Fcons (symbol, XCDR (blv->defcell)); 1211 tem1 = Fcons (symbol, XCDR (blv->defcell));
1212 B_ (XBUFFER (where), local_var_alist) 1212 BVAR (XBUFFER (where), local_var_alist)
1213 = Fcons (tem1, B_ (XBUFFER (where), local_var_alist)); 1213 = Fcons (tem1, BVAR (XBUFFER (where), local_var_alist));
1214 } 1214 }
1215 } 1215 }
1216 1216
@@ -1632,13 +1632,13 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
1632 if (let_shadows_global_binding_p (symbol)) 1632 if (let_shadows_global_binding_p (symbol))
1633 message ("Making %s local to %s while let-bound!", 1633 message ("Making %s local to %s while let-bound!",
1634 SDATA (SYMBOL_NAME (variable)), 1634 SDATA (SYMBOL_NAME (variable)),
1635 SDATA (B_ (current_buffer, name))); 1635 SDATA (BVAR (current_buffer, name)));
1636 } 1636 }
1637 } 1637 }
1638 1638
1639 /* Make sure this buffer has its own value of symbol. */ 1639 /* Make sure this buffer has its own value of symbol. */
1640 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ 1640 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
1641 tem = Fassq (variable, B_ (current_buffer, local_var_alist)); 1641 tem = Fassq (variable, BVAR (current_buffer, local_var_alist));
1642 if (NILP (tem)) 1642 if (NILP (tem))
1643 { 1643 {
1644 if (let_shadows_buffer_binding_p (sym)) 1644 if (let_shadows_buffer_binding_p (sym))
@@ -1650,9 +1650,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
1650 default value. */ 1650 default value. */
1651 find_symbol_value (variable); 1651 find_symbol_value (variable);
1652 1652
1653 B_ (current_buffer, local_var_alist) 1653 BVAR (current_buffer, local_var_alist)
1654 = Fcons (Fcons (variable, XCDR (blv->defcell)), 1654 = Fcons (Fcons (variable, XCDR (blv->defcell)),
1655 B_ (current_buffer, local_var_alist)); 1655 BVAR (current_buffer, local_var_alist));
1656 1656
1657 /* Make sure symbol does not think it is set up for this buffer; 1657 /* Make sure symbol does not think it is set up for this buffer;
1658 force it to look once again for this buffer's value. */ 1658 force it to look once again for this buffer's value. */
@@ -1718,10 +1718,10 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
1718 1718
1719 /* Get rid of this buffer's alist element, if any. */ 1719 /* Get rid of this buffer's alist element, if any. */
1720 XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ 1720 XSETSYMBOL (variable, sym); /* Propagate variable indirection. */
1721 tem = Fassq (variable, B_ (current_buffer, local_var_alist)); 1721 tem = Fassq (variable, BVAR (current_buffer, local_var_alist));
1722 if (!NILP (tem)) 1722 if (!NILP (tem))
1723 B_ (current_buffer, local_var_alist) 1723 BVAR (current_buffer, local_var_alist)
1724 = Fdelq (tem, B_ (current_buffer, local_var_alist)); 1724 = Fdelq (tem, BVAR (current_buffer, local_var_alist));
1725 1725
1726 /* If the symbol is set up with the current buffer's binding 1726 /* If the symbol is set up with the current buffer's binding
1727 loaded, recompute its value. We have to do it now, or else 1727 loaded, recompute its value. We have to do it now, or else
@@ -1848,7 +1848,7 @@ BUFFER defaults to the current buffer. */)
1848 XSETBUFFER (tmp, buf); 1848 XSETBUFFER (tmp, buf);
1849 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ 1849 XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
1850 1850
1851 for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) 1851 for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
1852 { 1852 {
1853 elt = XCAR (tail); 1853 elt = XCAR (tail);
1854 if (EQ (variable, XCAR (elt))) 1854 if (EQ (variable, XCAR (elt)))
diff --git a/src/dired.c b/src/dired.c
index f1dc03b56d0..7b4b83cbe54 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -158,7 +158,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
158# ifdef WINDOWSNT 158# ifdef WINDOWSNT
159 /* Windows users want case-insensitive wildcards. */ 159 /* Windows users want case-insensitive wildcards. */
160 bufp = compile_pattern (match, 0, 160 bufp = compile_pattern (match, 0,
161 B_ (&buffer_defaults, case_canon_table), 0, 1); 161 BVAR (&buffer_defaults, case_canon_table), 0, 1);
162# else /* !WINDOWSNT */ 162# else /* !WINDOWSNT */
163 bufp = compile_pattern (match, 0, Qnil, 0, 1); 163 bufp = compile_pattern (match, 0, Qnil, 0, 1);
164# endif /* !WINDOWSNT */ 164# endif /* !WINDOWSNT */
diff --git a/src/dispextern.h b/src/dispextern.h
index e01c1a961f7..6bb0c3a6aae 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1416,7 +1416,7 @@ struct glyph_string
1416 && !(W)->pseudo_window_p \ 1416 && !(W)->pseudo_window_p \
1417 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ 1417 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
1418 && BUFFERP ((W)->buffer) \ 1418 && BUFFERP ((W)->buffer) \
1419 && !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format)) \ 1419 && !NILP (BVAR (XBUFFER ((W)->buffer), mode_line_format)) \
1420 && WINDOW_TOTAL_LINES (W) > 1) 1420 && WINDOW_TOTAL_LINES (W) > 1)
1421 1421
1422/* Value is non-zero if window W wants a header line. */ 1422/* Value is non-zero if window W wants a header line. */
@@ -1426,8 +1426,8 @@ struct glyph_string
1426 && !(W)->pseudo_window_p \ 1426 && !(W)->pseudo_window_p \
1427 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ 1427 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
1428 && BUFFERP ((W)->buffer) \ 1428 && BUFFERP ((W)->buffer) \
1429 && !NILP (B_ (XBUFFER ((W)->buffer), header_line_format)) \ 1429 && !NILP (BVAR (XBUFFER ((W)->buffer), header_line_format)) \
1430 && WINDOW_TOTAL_LINES (W) > 1 + !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format))) 1430 && WINDOW_TOTAL_LINES (W) > 1 + !NILP (BVAR (XBUFFER ((W)->buffer), mode_line_format)))
1431 1431
1432 1432
1433/* Return proper value to be used as baseline offset of font that has 1433/* Return proper value to be used as baseline offset of font that has
diff --git a/src/dispnew.c b/src/dispnew.c
index 2aa3d9208b3..4e068bde536 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6129,7 +6129,7 @@ pass nil for VARIABLE. */)
6129 { 6129 {
6130 buf = XCDR (XCAR (tail)); 6130 buf = XCDR (XCAR (tail));
6131 /* Ignore buffers that aren't included in buffer lists. */ 6131 /* Ignore buffers that aren't included in buffer lists. */
6132 if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') 6132 if (SREF (BVAR (XBUFFER (buf), name), 0) == ' ')
6133 continue; 6133 continue;
6134 if (vecp == end) 6134 if (vecp == end)
6135 goto changed; 6135 goto changed;
@@ -6137,7 +6137,7 @@ pass nil for VARIABLE. */)
6137 goto changed; 6137 goto changed;
6138 if (vecp == end) 6138 if (vecp == end)
6139 goto changed; 6139 goto changed;
6140 if (!EQ (*vecp++, B_ (XBUFFER (buf), read_only))) 6140 if (!EQ (*vecp++, BVAR (XBUFFER (buf), read_only)))
6141 goto changed; 6141 goto changed;
6142 if (vecp == end) 6142 if (vecp == end)
6143 goto changed; 6143 goto changed;
@@ -6184,10 +6184,10 @@ pass nil for VARIABLE. */)
6184 { 6184 {
6185 buf = XCDR (XCAR (tail)); 6185 buf = XCDR (XCAR (tail));
6186 /* Ignore buffers that aren't included in buffer lists. */ 6186 /* Ignore buffers that aren't included in buffer lists. */
6187 if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') 6187 if (SREF (BVAR (XBUFFER (buf), name), 0) == ' ')
6188 continue; 6188 continue;
6189 *vecp++ = buf; 6189 *vecp++ = buf;
6190 *vecp++ = B_ (XBUFFER (buf), read_only); 6190 *vecp++ = BVAR (XBUFFER (buf), read_only);
6191 *vecp++ = Fbuffer_modified_p (buf); 6191 *vecp++ = Fbuffer_modified_p (buf);
6192 } 6192 }
6193 /* Fill up the vector with lambdas (always at least one). */ 6193 /* Fill up the vector with lambdas (always at least one). */
diff --git a/src/doc.c b/src/doc.c
index 31f1e5a9175..e572d43dbf4 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -719,7 +719,7 @@ a new string, without any text properties, is returned. */)
719 or a specified local map (which means search just that and the 719 or a specified local map (which means search just that and the
720 global map). If non-nil, it might come from Voverriding_local_map, 720 global map). If non-nil, it might come from Voverriding_local_map,
721 or from a \\<mapname> construct in STRING itself.. */ 721 or from a \\<mapname> construct in STRING itself.. */
722 keymap = current_kboard->Voverriding_terminal_local_map; 722 keymap = KVAR (current_kboard, Voverriding_terminal_local_map);
723 if (NILP (keymap)) 723 if (NILP (keymap))
724 keymap = Voverriding_local_map; 724 keymap = Voverriding_local_map;
725 725
diff --git a/src/editfns.c b/src/editfns.c
index a3de4907efc..5d6189f2a3c 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -306,10 +306,10 @@ region_limit (int beginningp)
306 306
307 if (!NILP (Vtransient_mark_mode) 307 if (!NILP (Vtransient_mark_mode)
308 && NILP (Vmark_even_if_inactive) 308 && NILP (Vmark_even_if_inactive)
309 && NILP (B_ (current_buffer, mark_active))) 309 && NILP (BVAR (current_buffer, mark_active)))
310 xsignal0 (Qmark_inactive); 310 xsignal0 (Qmark_inactive);
311 311
312 m = Fmarker_position (B_ (current_buffer, mark)); 312 m = Fmarker_position (BVAR (current_buffer, mark));
313 if (NILP (m)) 313 if (NILP (m))
314 error ("The mark is not set now, so there is no region"); 314 error ("The mark is not set now, so there is no region");
315 315
@@ -338,7 +338,7 @@ Watch out! Moving this marker changes the mark position.
338If you set the marker not to point anywhere, the buffer will have no mark. */) 338If you set the marker not to point anywhere, the buffer will have no mark. */)
339 (void) 339 (void)
340{ 340{
341 return B_ (current_buffer, mark); 341 return BVAR (current_buffer, mark);
342} 342}
343 343
344 344
@@ -866,9 +866,9 @@ save_excursion_save (void)
866 == current_buffer); 866 == current_buffer);
867 867
868 return Fcons (Fpoint_marker (), 868 return Fcons (Fpoint_marker (),
869 Fcons (Fcopy_marker (B_ (current_buffer, mark), Qnil), 869 Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil),
870 Fcons (visible ? Qt : Qnil, 870 Fcons (visible ? Qt : Qnil,
871 Fcons (B_ (current_buffer, mark_active), 871 Fcons (BVAR (current_buffer, mark_active),
872 selected_window)))); 872 selected_window))));
873} 873}
874 874
@@ -900,8 +900,8 @@ save_excursion_restore (Lisp_Object info)
900 /* Mark marker. */ 900 /* Mark marker. */
901 info = XCDR (info); 901 info = XCDR (info);
902 tem = XCAR (info); 902 tem = XCAR (info);
903 omark = Fmarker_position (B_ (current_buffer, mark)); 903 omark = Fmarker_position (BVAR (current_buffer, mark));
904 Fset_marker (B_ (current_buffer, mark), tem, Fcurrent_buffer ()); 904 Fset_marker (BVAR (current_buffer, mark), tem, Fcurrent_buffer ());
905 nmark = Fmarker_position (tem); 905 nmark = Fmarker_position (tem);
906 unchain_marker (XMARKER (tem)); 906 unchain_marker (XMARKER (tem));
907 907
@@ -922,14 +922,14 @@ save_excursion_restore (Lisp_Object info)
922 /* Mark active */ 922 /* Mark active */
923 info = XCDR (info); 923 info = XCDR (info);
924 tem = XCAR (info); 924 tem = XCAR (info);
925 tem1 = B_ (current_buffer, mark_active); 925 tem1 = BVAR (current_buffer, mark_active);
926 B_ (current_buffer, mark_active) = tem; 926 BVAR (current_buffer, mark_active) = tem;
927 927
928 if (!NILP (Vrun_hooks)) 928 if (!NILP (Vrun_hooks))
929 { 929 {
930 /* If mark is active now, and either was not active 930 /* If mark is active now, and either was not active
931 or was at a different place, run the activate hook. */ 931 or was at a different place, run the activate hook. */
932 if (! NILP (B_ (current_buffer, mark_active))) 932 if (! NILP (BVAR (current_buffer, mark_active)))
933 { 933 {
934 if (! EQ (omark, nmark)) 934 if (! EQ (omark, nmark))
935 call1 (Vrun_hooks, intern ("activate-mark-hook")); 935 call1 (Vrun_hooks, intern ("activate-mark-hook"));
@@ -1114,7 +1114,7 @@ At the beginning of the buffer or accessible region, return 0. */)
1114 Lisp_Object temp; 1114 Lisp_Object temp;
1115 if (PT <= BEGV) 1115 if (PT <= BEGV)
1116 XSETFASTINT (temp, 0); 1116 XSETFASTINT (temp, 0);
1117 else if (!NILP (B_ (current_buffer, enable_multibyte_characters))) 1117 else if (!NILP (BVAR (current_buffer, enable_multibyte_characters)))
1118 { 1118 {
1119 EMACS_INT pos = PT_BYTE; 1119 EMACS_INT pos = PT_BYTE;
1120 DEC_POS (pos); 1120 DEC_POS (pos);
@@ -1228,7 +1228,7 @@ If POS is out of range, the value is nil. */)
1228 pos_byte = CHAR_TO_BYTE (XINT (pos)); 1228 pos_byte = CHAR_TO_BYTE (XINT (pos));
1229 } 1229 }
1230 1230
1231 if (!NILP (B_ (current_buffer, enable_multibyte_characters))) 1231 if (!NILP (BVAR (current_buffer, enable_multibyte_characters)))
1232 { 1232 {
1233 DEC_POS (pos_byte); 1233 DEC_POS (pos_byte);
1234 XSETFASTINT (val, FETCH_CHAR (pos_byte)); 1234 XSETFASTINT (val, FETCH_CHAR (pos_byte));
@@ -2135,7 +2135,7 @@ general_insert_function (void (*insert_func)
2135 unsigned char str[MAX_MULTIBYTE_LENGTH]; 2135 unsigned char str[MAX_MULTIBYTE_LENGTH];
2136 int len; 2136 int len;
2137 2137
2138 if (!NILP (B_ (current_buffer, enable_multibyte_characters))) 2138 if (!NILP (BVAR (current_buffer, enable_multibyte_characters)))
2139 len = CHAR_STRING (XFASTINT (val), str); 2139 len = CHAR_STRING (XFASTINT (val), str);
2140 else 2140 else
2141 { 2141 {
@@ -2267,7 +2267,7 @@ from adjoining text, if those properties are sticky. */)
2267 CHECK_NUMBER (character); 2267 CHECK_NUMBER (character);
2268 CHECK_NUMBER (count); 2268 CHECK_NUMBER (count);
2269 2269
2270 if (!NILP (B_ (current_buffer, enable_multibyte_characters))) 2270 if (!NILP (BVAR (current_buffer, enable_multibyte_characters)))
2271 len = CHAR_STRING (XFASTINT (character), str); 2271 len = CHAR_STRING (XFASTINT (character), str);
2272 else 2272 else
2273 str[0] = XFASTINT (character), len = 1; 2273 str[0] = XFASTINT (character), len = 1;
@@ -2316,7 +2316,7 @@ from adjoining text, if those properties are sticky. */)
2316 if (XINT (byte) < 0 || XINT (byte) > 255) 2316 if (XINT (byte) < 0 || XINT (byte) > 255)
2317 args_out_of_range_3 (byte, make_number (0), make_number (255)); 2317 args_out_of_range_3 (byte, make_number (0), make_number (255));
2318 if (XINT (byte) >= 128 2318 if (XINT (byte) >= 128
2319 && ! NILP (B_ (current_buffer, enable_multibyte_characters))) 2319 && ! NILP (BVAR (current_buffer, enable_multibyte_characters)))
2320 XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte))); 2320 XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte)));
2321 return Finsert_char (byte, count, inherit); 2321 return Finsert_char (byte, count, inherit);
2322} 2322}
@@ -2370,7 +2370,7 @@ make_buffer_string_both (EMACS_INT start, EMACS_INT start_byte,
2370 if (start < GPT && GPT < end) 2370 if (start < GPT && GPT < end)
2371 move_gap (start); 2371 move_gap (start);
2372 2372
2373 if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 2373 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
2374 result = make_uninit_multibyte_string (end - start, end_byte - start_byte); 2374 result = make_uninit_multibyte_string (end - start, end_byte - start_byte);
2375 else 2375 else
2376 result = make_uninit_string (end - start); 2376 result = make_uninit_string (end - start);
@@ -2485,7 +2485,7 @@ They default to the values of (point-min) and (point-max) in BUFFER. */)
2485 if (NILP (buf)) 2485 if (NILP (buf))
2486 nsberror (buffer); 2486 nsberror (buffer);
2487 bp = XBUFFER (buf); 2487 bp = XBUFFER (buf);
2488 if (NILP (B_ (bp, name))) 2488 if (NILP (BVAR (bp, name)))
2489 error ("Selecting deleted buffer"); 2489 error ("Selecting deleted buffer");
2490 2490
2491 if (NILP (start)) 2491 if (NILP (start))
@@ -2533,8 +2533,8 @@ determines whether case is significant or ignored. */)
2533 register EMACS_INT begp1, endp1, begp2, endp2, temp; 2533 register EMACS_INT begp1, endp1, begp2, endp2, temp;
2534 register struct buffer *bp1, *bp2; 2534 register struct buffer *bp1, *bp2;
2535 register Lisp_Object trt 2535 register Lisp_Object trt
2536 = (!NILP (B_ (current_buffer, case_fold_search)) 2536 = (!NILP (BVAR (current_buffer, case_fold_search))
2537 ? B_ (current_buffer, case_canon_table) : Qnil); 2537 ? BVAR (current_buffer, case_canon_table) : Qnil);
2538 EMACS_INT chars = 0; 2538 EMACS_INT chars = 0;
2539 EMACS_INT i1, i2, i1_byte, i2_byte; 2539 EMACS_INT i1, i2, i1_byte, i2_byte;
2540 2540
@@ -2549,7 +2549,7 @@ determines whether case is significant or ignored. */)
2549 if (NILP (buf1)) 2549 if (NILP (buf1))
2550 nsberror (buffer1); 2550 nsberror (buffer1);
2551 bp1 = XBUFFER (buf1); 2551 bp1 = XBUFFER (buf1);
2552 if (NILP (B_ (bp1, name))) 2552 if (NILP (BVAR (bp1, name)))
2553 error ("Selecting deleted buffer"); 2553 error ("Selecting deleted buffer");
2554 } 2554 }
2555 2555
@@ -2587,7 +2587,7 @@ determines whether case is significant or ignored. */)
2587 if (NILP (buf2)) 2587 if (NILP (buf2))
2588 nsberror (buffer2); 2588 nsberror (buffer2);
2589 bp2 = XBUFFER (buf2); 2589 bp2 = XBUFFER (buf2);
2590 if (NILP (B_ (bp2, name))) 2590 if (NILP (BVAR (bp2, name)))
2591 error ("Selecting deleted buffer"); 2591 error ("Selecting deleted buffer");
2592 } 2592 }
2593 2593
@@ -2627,7 +2627,7 @@ determines whether case is significant or ignored. */)
2627 2627
2628 QUIT; 2628 QUIT;
2629 2629
2630 if (! NILP (B_ (bp1, enable_multibyte_characters))) 2630 if (! NILP (BVAR (bp1, enable_multibyte_characters)))
2631 { 2631 {
2632 c1 = BUF_FETCH_MULTIBYTE_CHAR (bp1, i1_byte); 2632 c1 = BUF_FETCH_MULTIBYTE_CHAR (bp1, i1_byte);
2633 BUF_INC_POS (bp1, i1_byte); 2633 BUF_INC_POS (bp1, i1_byte);
@@ -2640,7 +2640,7 @@ determines whether case is significant or ignored. */)
2640 i1++; 2640 i1++;
2641 } 2641 }
2642 2642
2643 if (! NILP (B_ (bp2, enable_multibyte_characters))) 2643 if (! NILP (BVAR (bp2, enable_multibyte_characters)))
2644 { 2644 {
2645 c2 = BUF_FETCH_MULTIBYTE_CHAR (bp2, i2_byte); 2645 c2 = BUF_FETCH_MULTIBYTE_CHAR (bp2, i2_byte);
2646 BUF_INC_POS (bp2, i2_byte); 2646 BUF_INC_POS (bp2, i2_byte);
@@ -2680,13 +2680,13 @@ determines whether case is significant or ignored. */)
2680static Lisp_Object 2680static Lisp_Object
2681subst_char_in_region_unwind (Lisp_Object arg) 2681subst_char_in_region_unwind (Lisp_Object arg)
2682{ 2682{
2683 return B_ (current_buffer, undo_list) = arg; 2683 return BVAR (current_buffer, undo_list) = arg;
2684} 2684}
2685 2685
2686static Lisp_Object 2686static Lisp_Object
2687subst_char_in_region_unwind_1 (Lisp_Object arg) 2687subst_char_in_region_unwind_1 (Lisp_Object arg)
2688{ 2688{
2689 return B_ (current_buffer, filename) = arg; 2689 return BVAR (current_buffer, filename) = arg;
2690} 2690}
2691 2691
2692DEFUN ("subst-char-in-region", Fsubst_char_in_region, 2692DEFUN ("subst-char-in-region", Fsubst_char_in_region,
@@ -2712,7 +2712,7 @@ Both characters must have the same length of multi-byte form. */)
2712#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER) 2712#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER)
2713 int maybe_byte_combining = COMBINING_NO; 2713 int maybe_byte_combining = COMBINING_NO;
2714 EMACS_INT last_changed = 0; 2714 EMACS_INT last_changed = 0;
2715 int multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); 2715 int multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
2716 2716
2717 restart: 2717 restart:
2718 2718
@@ -2756,12 +2756,12 @@ Both characters must have the same length of multi-byte form. */)
2756 if (!changed && !NILP (noundo)) 2756 if (!changed && !NILP (noundo))
2757 { 2757 {
2758 record_unwind_protect (subst_char_in_region_unwind, 2758 record_unwind_protect (subst_char_in_region_unwind,
2759 B_ (current_buffer, undo_list)); 2759 BVAR (current_buffer, undo_list));
2760 B_ (current_buffer, undo_list) = Qt; 2760 BVAR (current_buffer, undo_list) = Qt;
2761 /* Don't do file-locking. */ 2761 /* Don't do file-locking. */
2762 record_unwind_protect (subst_char_in_region_unwind_1, 2762 record_unwind_protect (subst_char_in_region_unwind_1,
2763 B_ (current_buffer, filename)); 2763 BVAR (current_buffer, filename));
2764 B_ (current_buffer, filename) = Qnil; 2764 BVAR (current_buffer, filename) = Qnil;
2765 } 2765 }
2766 2766
2767 if (pos_byte < GPT_BYTE) 2767 if (pos_byte < GPT_BYTE)
@@ -2824,7 +2824,7 @@ Both characters must have the same length of multi-byte form. */)
2824 2824
2825 struct gcpro gcpro1; 2825 struct gcpro gcpro1;
2826 2826
2827 tem = B_ (current_buffer, undo_list); 2827 tem = BVAR (current_buffer, undo_list);
2828 GCPRO1 (tem); 2828 GCPRO1 (tem);
2829 2829
2830 /* Make a multibyte string containing this single character. */ 2830 /* Make a multibyte string containing this single character. */
@@ -2843,7 +2843,7 @@ Both characters must have the same length of multi-byte form. */)
2843 INC_POS (pos_byte_next); 2843 INC_POS (pos_byte_next);
2844 2844
2845 if (! NILP (noundo)) 2845 if (! NILP (noundo))
2846 B_ (current_buffer, undo_list) = tem; 2846 BVAR (current_buffer, undo_list) = tem;
2847 2847
2848 UNGCPRO; 2848 UNGCPRO;
2849 } 2849 }
@@ -2945,7 +2945,7 @@ It returns the number of characters changed. */)
2945 int cnt; /* Number of changes made. */ 2945 int cnt; /* Number of changes made. */
2946 EMACS_INT size; /* Size of translate table. */ 2946 EMACS_INT size; /* Size of translate table. */
2947 EMACS_INT pos, pos_byte, end_pos; 2947 EMACS_INT pos, pos_byte, end_pos;
2948 int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); 2948 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
2949 int string_multibyte; 2949 int string_multibyte;
2950 Lisp_Object val; 2950 Lisp_Object val;
2951 2951
@@ -3206,7 +3206,7 @@ save_restriction_restore (Lisp_Object data)
3206 ? XMARKER (XCAR (data))->buffer 3206 ? XMARKER (XCAR (data))->buffer
3207 : XBUFFER (data)); 3207 : XBUFFER (data));
3208 3208
3209 if (buf && buf != current_buffer && !NILP (B_ (buf, pt_marker))) 3209 if (buf && buf != current_buffer && !NILP (BVAR (buf, pt_marker)))
3210 { /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as 3210 { /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as
3211 is the case if it is or has an indirect buffer), then make 3211 is the case if it is or has an indirect buffer), then make
3212 sure it is current before we update BEGV, so 3212 sure it is current before we update BEGV, so
@@ -4136,20 +4136,20 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
4136 4136
4137 if (XINT (c1) == XINT (c2)) 4137 if (XINT (c1) == XINT (c2))
4138 return Qt; 4138 return Qt;
4139 if (NILP (B_ (current_buffer, case_fold_search))) 4139 if (NILP (BVAR (current_buffer, case_fold_search)))
4140 return Qnil; 4140 return Qnil;
4141 4141
4142 /* Do these in separate statements, 4142 /* Do these in separate statements,
4143 then compare the variables. 4143 then compare the variables.
4144 because of the way DOWNCASE uses temp variables. */ 4144 because of the way DOWNCASE uses temp variables. */
4145 i1 = XFASTINT (c1); 4145 i1 = XFASTINT (c1);
4146 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 4146 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
4147 && ! ASCII_CHAR_P (i1)) 4147 && ! ASCII_CHAR_P (i1))
4148 { 4148 {
4149 MAKE_CHAR_MULTIBYTE (i1); 4149 MAKE_CHAR_MULTIBYTE (i1);
4150 } 4150 }
4151 i2 = XFASTINT (c2); 4151 i2 = XFASTINT (c2);
4152 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 4152 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
4153 && ! ASCII_CHAR_P (i2)) 4153 && ! ASCII_CHAR_P (i2))
4154 { 4154 {
4155 MAKE_CHAR_MULTIBYTE (i2); 4155 MAKE_CHAR_MULTIBYTE (i2);
diff --git a/src/fileio.c b/src/fileio.c
index 4a4935b43a2..2ccad83f668 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -770,7 +770,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
770 770
771 /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */ 771 /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */
772 if (NILP (default_directory)) 772 if (NILP (default_directory))
773 default_directory = B_ (current_buffer, directory); 773 default_directory = BVAR (current_buffer, directory);
774 if (! STRINGP (default_directory)) 774 if (! STRINGP (default_directory))
775 { 775 {
776#ifdef DOS_NT 776#ifdef DOS_NT
@@ -2669,7 +2669,7 @@ See `file-symlink-p' to distinguish symlinks. */)
2669 struct stat st; 2669 struct stat st;
2670 Lisp_Object handler; 2670 Lisp_Object handler;
2671 2671
2672 absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); 2672 absname = expand_and_dir_to_file (filename, BVAR (current_buffer, directory));
2673 2673
2674 /* If the file name has special constructs in it, 2674 /* If the file name has special constructs in it,
2675 call the corresponding file handler. */ 2675 call the corresponding file handler. */
@@ -2722,7 +2722,7 @@ See `file-symlink-p' to distinguish symlinks. */)
2722 struct stat st; 2722 struct stat st;
2723 Lisp_Object handler; 2723 Lisp_Object handler;
2724 2724
2725 absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); 2725 absname = expand_and_dir_to_file (filename, BVAR (current_buffer, directory));
2726 2726
2727 /* If the file name has special constructs in it, 2727 /* If the file name has special constructs in it,
2728 call the corresponding file handler. */ 2728 call the corresponding file handler. */
@@ -2769,7 +2769,7 @@ if file does not exist, is not accessible, or SELinux is disabled */)
2769 context_t context; 2769 context_t context;
2770#endif 2770#endif
2771 2771
2772 absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); 2772 absname = expand_and_dir_to_file (filename, BVAR (current_buffer, directory));
2773 2773
2774 /* If the file name has special constructs in it, 2774 /* If the file name has special constructs in it,
2775 call the corresponding file handler. */ 2775 call the corresponding file handler. */
@@ -2827,7 +2827,7 @@ is disabled. */)
2827 context_t parsed_con; 2827 context_t parsed_con;
2828#endif 2828#endif
2829 2829
2830 absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); 2830 absname = Fexpand_file_name (filename, BVAR (current_buffer, directory));
2831 2831
2832 /* If the file name has special constructs in it, 2832 /* If the file name has special constructs in it,
2833 call the corresponding file handler. */ 2833 call the corresponding file handler. */
@@ -2894,7 +2894,7 @@ Return nil, if file does not exist or is not accessible. */)
2894 struct stat st; 2894 struct stat st;
2895 Lisp_Object handler; 2895 Lisp_Object handler;
2896 2896
2897 absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); 2897 absname = expand_and_dir_to_file (filename, BVAR (current_buffer, directory));
2898 2898
2899 /* If the file name has special constructs in it, 2899 /* If the file name has special constructs in it,
2900 call the corresponding file handler. */ 2900 call the corresponding file handler. */
@@ -2923,7 +2923,7 @@ symbolic notation, like the `chmod' command from GNU Coreutils. */)
2923 Lisp_Object absname, encoded_absname; 2923 Lisp_Object absname, encoded_absname;
2924 Lisp_Object handler; 2924 Lisp_Object handler;
2925 2925
2926 absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); 2926 absname = Fexpand_file_name (filename, BVAR (current_buffer, directory));
2927 CHECK_NUMBER (mode); 2927 CHECK_NUMBER (mode);
2928 2928
2929 /* If the file name has special constructs in it, 2929 /* If the file name has special constructs in it,
@@ -2985,7 +2985,7 @@ Use the current time if TIME is nil. TIME is in the format of
2985 if (! lisp_time_argument (time, &sec, &usec)) 2985 if (! lisp_time_argument (time, &sec, &usec))
2986 error ("Invalid time specification"); 2986 error ("Invalid time specification");
2987 2987
2988 absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); 2988 absname = Fexpand_file_name (filename, BVAR (current_buffer, directory));
2989 2989
2990 /* If the file name has special constructs in it, 2990 /* If the file name has special constructs in it,
2991 call the corresponding file handler. */ 2991 call the corresponding file handler. */
@@ -3047,8 +3047,8 @@ otherwise, if FILE2 does not exist, the answer is t. */)
3047 3047
3048 absname1 = Qnil; 3048 absname1 = Qnil;
3049 GCPRO2 (absname1, file2); 3049 GCPRO2 (absname1, file2);
3050 absname1 = expand_and_dir_to_file (file1, B_ (current_buffer, directory)); 3050 absname1 = expand_and_dir_to_file (file1, BVAR (current_buffer, directory));
3051 absname2 = expand_and_dir_to_file (file2, B_ (current_buffer, directory)); 3051 absname2 = expand_and_dir_to_file (file2, BVAR (current_buffer, directory));
3052 UNGCPRO; 3052 UNGCPRO;
3053 3053
3054 /* If the file name has special constructs in it, 3054 /* If the file name has special constructs in it,
@@ -3075,10 +3075,6 @@ otherwise, if FILE2 does not exist, the answer is t. */)
3075 return (mtime1 > st.st_mtime) ? Qt : Qnil; 3075 return (mtime1 > st.st_mtime) ? Qt : Qnil;
3076} 3076}
3077 3077
3078#ifdef DOS_NT
3079Lisp_Object Qfind_buffer_file_type;
3080#endif /* DOS_NT */
3081
3082#ifndef READ_BUF_SIZE 3078#ifndef READ_BUF_SIZE
3083#define READ_BUF_SIZE (64 << 10) 3079#define READ_BUF_SIZE (64 << 10)
3084#endif 3080#endif
@@ -3116,8 +3112,8 @@ decide_coding_unwind (Lisp_Object unwind_data)
3116 TEMP_SET_PT_BOTH (BEG, BEG_BYTE); 3112 TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
3117 3113
3118 /* Now we are safe to change the buffer's multibyteness directly. */ 3114 /* Now we are safe to change the buffer's multibyteness directly. */
3119 B_ (current_buffer, enable_multibyte_characters) = multibyte; 3115 BVAR (current_buffer, enable_multibyte_characters) = multibyte;
3120 B_ (current_buffer, undo_list) = undo_list; 3116 BVAR (current_buffer, undo_list) = undo_list;
3121 3117
3122 return Qnil; 3118 return Qnil;
3123} 3119}
@@ -3212,7 +3208,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3212 if (current_buffer->base_buffer && ! NILP (visit)) 3208 if (current_buffer->base_buffer && ! NILP (visit))
3213 error ("Cannot do file visiting in an indirect buffer"); 3209 error ("Cannot do file visiting in an indirect buffer");
3214 3210
3215 if (!NILP (B_ (current_buffer, read_only))) 3211 if (!NILP (BVAR (current_buffer, read_only)))
3216 Fbarf_if_buffer_read_only (); 3212 Fbarf_if_buffer_read_only ();
3217 3213
3218 val = Qnil; 3214 val = Qnil;
@@ -3403,16 +3399,16 @@ variable `last-coding-system-used' to the coding system actually used. */)
3403 buf = XBUFFER (buffer); 3399 buf = XBUFFER (buffer);
3404 3400
3405 delete_all_overlays (buf); 3401 delete_all_overlays (buf);
3406 B_ (buf, directory) = B_ (current_buffer, directory); 3402 BVAR (buf, directory) = BVAR (current_buffer, directory);
3407 B_ (buf, read_only) = Qnil; 3403 BVAR (buf, read_only) = Qnil;
3408 B_ (buf, filename) = Qnil; 3404 BVAR (buf, filename) = Qnil;
3409 B_ (buf, undo_list) = Qt; 3405 BVAR (buf, undo_list) = Qt;
3410 eassert (buf->overlays_before == NULL); 3406 eassert (buf->overlays_before == NULL);
3411 eassert (buf->overlays_after == NULL); 3407 eassert (buf->overlays_after == NULL);
3412 3408
3413 set_buffer_internal (buf); 3409 set_buffer_internal (buf);
3414 Ferase_buffer (); 3410 Ferase_buffer ();
3415 B_ (buf, enable_multibyte_characters) = Qnil; 3411 BVAR (buf, enable_multibyte_characters) = Qnil;
3416 3412
3417 insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0); 3413 insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0);
3418 TEMP_SET_PT_BOTH (BEG, BEG_BYTE); 3414 TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
@@ -3450,7 +3446,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3450 else 3446 else
3451 CHECK_CODING_SYSTEM (coding_system); 3447 CHECK_CODING_SYSTEM (coding_system);
3452 3448
3453 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 3449 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
3454 /* We must suppress all character code conversion except for 3450 /* We must suppress all character code conversion except for
3455 end-of-line conversion. */ 3451 end-of-line conversion. */
3456 coding_system = raw_text_coding_system (coding_system); 3452 coding_system = raw_text_coding_system (coding_system);
@@ -3598,7 +3594,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3598 we cannot use this method; giveup and try the other. */ 3594 we cannot use this method; giveup and try the other. */
3599 if (same_at_end > same_at_start 3595 if (same_at_end > same_at_start
3600 && FETCH_BYTE (same_at_end - 1) >= 0200 3596 && FETCH_BYTE (same_at_end - 1) >= 0200
3601 && ! NILP (B_ (current_buffer, enable_multibyte_characters)) 3597 && ! NILP (BVAR (current_buffer, enable_multibyte_characters))
3602 && (CODING_MAY_REQUIRE_DECODING (&coding))) 3598 && (CODING_MAY_REQUIRE_DECODING (&coding)))
3603 giveup_match_end = 1; 3599 giveup_match_end = 1;
3604 break; 3600 break;
@@ -3617,14 +3613,14 @@ variable `last-coding-system-used' to the coding system actually used. */)
3617 3613
3618 /* Extend the start of non-matching text area to multibyte 3614 /* Extend the start of non-matching text area to multibyte
3619 character boundary. */ 3615 character boundary. */
3620 if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 3616 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
3621 while (same_at_start > BEGV_BYTE 3617 while (same_at_start > BEGV_BYTE
3622 && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start))) 3618 && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start)))
3623 same_at_start--; 3619 same_at_start--;
3624 3620
3625 /* Extend the end of non-matching text area to multibyte 3621 /* Extend the end of non-matching text area to multibyte
3626 character boundary. */ 3622 character boundary. */
3627 if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 3623 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
3628 while (same_at_end < ZV_BYTE 3624 while (same_at_end < ZV_BYTE
3629 && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end))) 3625 && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end)))
3630 same_at_end++; 3626 same_at_end++;
@@ -3673,7 +3669,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3673 unsigned char *decoded; 3669 unsigned char *decoded;
3674 EMACS_INT temp; 3670 EMACS_INT temp;
3675 int this_count = SPECPDL_INDEX (); 3671 int this_count = SPECPDL_INDEX ();
3676 int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 3672 int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
3677 Lisp_Object conversion_buffer; 3673 Lisp_Object conversion_buffer;
3678 3674
3679 conversion_buffer = code_conversion_save (1, multibyte); 3675 conversion_buffer = code_conversion_save (1, multibyte);
@@ -3778,7 +3774,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3778 3774
3779 /* Extend the start of non-matching text area to the previous 3775 /* Extend the start of non-matching text area to the previous
3780 multibyte character boundary. */ 3776 multibyte character boundary. */
3781 if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 3777 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
3782 while (same_at_start > BEGV_BYTE 3778 while (same_at_start > BEGV_BYTE
3783 && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start))) 3779 && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start)))
3784 same_at_start--; 3780 same_at_start--;
@@ -3795,7 +3791,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3795 3791
3796 /* Extend the end of non-matching text area to the next 3792 /* Extend the end of non-matching text area to the next
3797 multibyte character boundary. */ 3793 multibyte character boundary. */
3798 if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 3794 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
3799 while (same_at_end < ZV_BYTE 3795 while (same_at_end < ZV_BYTE
3800 && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end))) 3796 && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end)))
3801 same_at_end++; 3797 same_at_end++;
@@ -3870,9 +3866,9 @@ variable `last-coding-system-used' to the coding system actually used. */)
3870 if (NILP (visit) && inserted > 0) 3866 if (NILP (visit) && inserted > 0)
3871 { 3867 {
3872#ifdef CLASH_DETECTION 3868#ifdef CLASH_DETECTION
3873 if (!NILP (B_ (current_buffer, file_truename)) 3869 if (!NILP (BVAR (current_buffer, file_truename))
3874 /* Make binding buffer-file-name to nil effective. */ 3870 /* Make binding buffer-file-name to nil effective. */
3875 && !NILP (B_ (current_buffer, filename)) 3871 && !NILP (BVAR (current_buffer, filename))
3876 && SAVE_MODIFF >= MODIFF) 3872 && SAVE_MODIFF >= MODIFF)
3877 we_locked_file = 1; 3873 we_locked_file = 1;
3878#endif /* CLASH_DETECTION */ 3874#endif /* CLASH_DETECTION */
@@ -3977,7 +3973,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3977 { 3973 {
3978#ifdef CLASH_DETECTION 3974#ifdef CLASH_DETECTION
3979 if (we_locked_file) 3975 if (we_locked_file)
3980 unlock_file (B_ (current_buffer, file_truename)); 3976 unlock_file (BVAR (current_buffer, file_truename));
3981#endif 3977#endif
3982 Vdeactivate_mark = old_Vdeactivate_mark; 3978 Vdeactivate_mark = old_Vdeactivate_mark;
3983 } 3979 }
@@ -4028,11 +4024,11 @@ variable `last-coding-system-used' to the coding system actually used. */)
4028 Lisp_Object unwind_data; 4024 Lisp_Object unwind_data;
4029 int count = SPECPDL_INDEX (); 4025 int count = SPECPDL_INDEX ();
4030 4026
4031 unwind_data = Fcons (B_ (current_buffer, enable_multibyte_characters), 4027 unwind_data = Fcons (BVAR (current_buffer, enable_multibyte_characters),
4032 Fcons (B_ (current_buffer, undo_list), 4028 Fcons (BVAR (current_buffer, undo_list),
4033 Fcurrent_buffer ())); 4029 Fcurrent_buffer ()));
4034 B_ (current_buffer, enable_multibyte_characters) = Qnil; 4030 BVAR (current_buffer, enable_multibyte_characters) = Qnil;
4035 B_ (current_buffer, undo_list) = Qt; 4031 BVAR (current_buffer, undo_list) = Qt;
4036 record_unwind_protect (decide_coding_unwind, unwind_data); 4032 record_unwind_protect (decide_coding_unwind, unwind_data);
4037 4033
4038 if (inserted > 0 && ! NILP (Vset_auto_coding_function)) 4034 if (inserted > 0 && ! NILP (Vset_auto_coding_function))
@@ -4062,7 +4058,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
4062 else 4058 else
4063 CHECK_CODING_SYSTEM (coding_system); 4059 CHECK_CODING_SYSTEM (coding_system);
4064 4060
4065 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 4061 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
4066 /* We must suppress all character code conversion except for 4062 /* We must suppress all character code conversion except for
4067 end-of-line conversion. */ 4063 end-of-line conversion. */
4068 coding_system = raw_text_coding_system (coding_system); 4064 coding_system = raw_text_coding_system (coding_system);
@@ -4080,10 +4076,10 @@ variable `last-coding-system-used' to the coding system actually used. */)
4080 && NILP (replace)) 4076 && NILP (replace))
4081 /* Visiting a file with these coding system makes the buffer 4077 /* Visiting a file with these coding system makes the buffer
4082 unibyte. */ 4078 unibyte. */
4083 B_ (current_buffer, enable_multibyte_characters) = Qnil; 4079 BVAR (current_buffer, enable_multibyte_characters) = Qnil;
4084 } 4080 }
4085 4081
4086 coding.dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 4082 coding.dst_multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
4087 if (CODING_MAY_REQUIRE_DECODING (&coding) 4083 if (CODING_MAY_REQUIRE_DECODING (&coding)
4088 && (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding))) 4084 && (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding)))
4089 { 4085 {
@@ -4103,18 +4099,6 @@ variable `last-coding-system-used' to the coding system actually used. */)
4103 4099
4104 /* Now INSERTED is measured in characters. */ 4100 /* Now INSERTED is measured in characters. */
4105 4101
4106#ifdef DOS_NT
4107 /* Use the conversion type to determine buffer-file-type
4108 (find-buffer-file-type is now used to help determine the
4109 conversion). */
4110 if ((VECTORP (CODING_ID_EOL_TYPE (coding.id))
4111 || EQ (CODING_ID_EOL_TYPE (coding.id), Qunix))
4112 && ! CODING_REQUIRE_DECODING (&coding))
4113 B_ (current_buffer, buffer_file_type) = Qt;
4114 else
4115 B_ (current_buffer, buffer_file_type) = Qnil;
4116#endif
4117
4118 handled: 4102 handled:
4119 4103
4120 if (deferred_remove_unwind_protect) 4104 if (deferred_remove_unwind_protect)
@@ -4124,24 +4108,24 @@ variable `last-coding-system-used' to the coding system actually used. */)
4124 4108
4125 if (!NILP (visit)) 4109 if (!NILP (visit))
4126 { 4110 {
4127 if (!EQ (B_ (current_buffer, undo_list), Qt) && !nochange) 4111 if (!EQ (BVAR (current_buffer, undo_list), Qt) && !nochange)
4128 B_ (current_buffer, undo_list) = Qnil; 4112 BVAR (current_buffer, undo_list) = Qnil;
4129 4113
4130 if (NILP (handler)) 4114 if (NILP (handler))
4131 { 4115 {
4132 current_buffer->modtime = st.st_mtime; 4116 current_buffer->modtime = st.st_mtime;
4133 current_buffer->modtime_size = st.st_size; 4117 current_buffer->modtime_size = st.st_size;
4134 B_ (current_buffer, filename) = orig_filename; 4118 BVAR (current_buffer, filename) = orig_filename;
4135 } 4119 }
4136 4120
4137 SAVE_MODIFF = MODIFF; 4121 SAVE_MODIFF = MODIFF;
4138 BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; 4122 BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
4139 XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); 4123 XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
4140#ifdef CLASH_DETECTION 4124#ifdef CLASH_DETECTION
4141 if (NILP (handler)) 4125 if (NILP (handler))
4142 { 4126 {
4143 if (!NILP (B_ (current_buffer, file_truename))) 4127 if (!NILP (BVAR (current_buffer, file_truename)))
4144 unlock_file (B_ (current_buffer, file_truename)); 4128 unlock_file (BVAR (current_buffer, file_truename));
4145 unlock_file (filename); 4129 unlock_file (filename);
4146 } 4130 }
4147#endif /* CLASH_DETECTION */ 4131#endif /* CLASH_DETECTION */
@@ -4174,8 +4158,8 @@ variable `last-coding-system-used' to the coding system actually used. */)
4174 specbind (Qinhibit_modification_hooks, Qt); 4158 specbind (Qinhibit_modification_hooks, Qt);
4175 4159
4176 /* Save old undo list and don't record undo for decoding. */ 4160 /* Save old undo list and don't record undo for decoding. */
4177 old_undo = B_ (current_buffer, undo_list); 4161 old_undo = BVAR (current_buffer, undo_list);
4178 B_ (current_buffer, undo_list) = Qt; 4162 BVAR (current_buffer, undo_list) = Qt;
4179 4163
4180 if (NILP (replace)) 4164 if (NILP (replace))
4181 { 4165 {
@@ -4263,7 +4247,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
4263 4247
4264 if (NILP (visit)) 4248 if (NILP (visit))
4265 { 4249 {
4266 B_ (current_buffer, undo_list) = old_undo; 4250 BVAR (current_buffer, undo_list) = old_undo;
4267 if (CONSP (old_undo) && inserted != old_inserted) 4251 if (CONSP (old_undo) && inserted != old_inserted)
4268 { 4252 {
4269 /* Adjust the last undo record for the size change during 4253 /* Adjust the last undo record for the size change during
@@ -4278,7 +4262,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
4278 else 4262 else
4279 /* If undo_list was Qt before, keep it that way. 4263 /* If undo_list was Qt before, keep it that way.
4280 Otherwise start with an empty undo_list. */ 4264 Otherwise start with an empty undo_list. */
4281 B_ (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil; 4265 BVAR (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil;
4282 4266
4283 unbind_to (count, Qnil); 4267 unbind_to (count, Qnil);
4284 } 4268 }
@@ -4332,8 +4316,8 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
4332 Lisp_Object eol_parent = Qnil; 4316 Lisp_Object eol_parent = Qnil;
4333 4317
4334 if (auto_saving 4318 if (auto_saving
4335 && NILP (Fstring_equal (B_ (current_buffer, filename), 4319 && NILP (Fstring_equal (BVAR (current_buffer, filename),
4336 B_ (current_buffer, auto_save_file_name)))) 4320 BVAR (current_buffer, auto_save_file_name))))
4337 { 4321 {
4338 val = Qutf_8_emacs; 4322 val = Qutf_8_emacs;
4339 eol_parent = Qunix; 4323 eol_parent = Qunix;
@@ -4362,12 +4346,12 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
4362 int using_default_coding = 0; 4346 int using_default_coding = 0;
4363 int force_raw_text = 0; 4347 int force_raw_text = 0;
4364 4348
4365 val = B_ (current_buffer, buffer_file_coding_system); 4349 val = BVAR (current_buffer, buffer_file_coding_system);
4366 if (NILP (val) 4350 if (NILP (val)
4367 || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil))) 4351 || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil)))
4368 { 4352 {
4369 val = Qnil; 4353 val = Qnil;
4370 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 4354 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
4371 force_raw_text = 1; 4355 force_raw_text = 1;
4372 } 4356 }
4373 4357
@@ -4388,7 +4372,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
4388 { 4372 {
4389 /* If we still have not decided a coding system, use the 4373 /* If we still have not decided a coding system, use the
4390 default value of buffer-file-coding-system. */ 4374 default value of buffer-file-coding-system. */
4391 val = B_ (current_buffer, buffer_file_coding_system); 4375 val = BVAR (current_buffer, buffer_file_coding_system);
4392 using_default_coding = 1; 4376 using_default_coding = 1;
4393 } 4377 }
4394 4378
@@ -4412,9 +4396,9 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
4412 format, we use that of 4396 format, we use that of
4413 `default-buffer-file-coding-system'. */ 4397 `default-buffer-file-coding-system'. */
4414 if (! using_default_coding 4398 if (! using_default_coding
4415 && ! NILP (B_ (&buffer_defaults, buffer_file_coding_system))) 4399 && ! NILP (BVAR (&buffer_defaults, buffer_file_coding_system)))
4416 val = (coding_inherit_eol_type 4400 val = (coding_inherit_eol_type
4417 (val, B_ (&buffer_defaults, buffer_file_coding_system))); 4401 (val, BVAR (&buffer_defaults, buffer_file_coding_system)));
4418 4402
4419 /* If we decide not to encode text, use `raw-text' or one of its 4403 /* If we decide not to encode text, use `raw-text' or one of its
4420 subsidiaries. */ 4404 subsidiaries. */
@@ -4425,7 +4409,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
4425 val = coding_inherit_eol_type (val, eol_parent); 4409 val = coding_inherit_eol_type (val, eol_parent);
4426 setup_coding_system (val, coding); 4410 setup_coding_system (val, coding);
4427 4411
4428 if (!STRINGP (start) && !NILP (B_ (current_buffer, selective_display))) 4412 if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display)))
4429 coding->mode |= CODING_MODE_SELECTIVE_DISPLAY; 4413 coding->mode |= CODING_MODE_SELECTIVE_DISPLAY;
4430 return val; 4414 return val;
4431} 4415}
@@ -4484,9 +4468,6 @@ This calls `write-region-annotate-functions' at the start, and
4484 int quietly = !NILP (visit); 4468 int quietly = !NILP (visit);
4485 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 4469 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
4486 struct buffer *given_buffer; 4470 struct buffer *given_buffer;
4487#ifdef DOS_NT
4488 int buffer_file_type = O_BINARY;
4489#endif /* DOS_NT */
4490 struct coding_system coding; 4471 struct coding_system coding;
4491 4472
4492 if (current_buffer->base_buffer && visiting) 4473 if (current_buffer->base_buffer && visiting)
@@ -4529,8 +4510,8 @@ This calls `write-region-annotate-functions' at the start, and
4529 if (visiting) 4510 if (visiting)
4530 { 4511 {
4531 SAVE_MODIFF = MODIFF; 4512 SAVE_MODIFF = MODIFF;
4532 XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); 4513 XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
4533 B_ (current_buffer, filename) = visit_file; 4514 BVAR (current_buffer, filename) = visit_file;
4534 } 4515 }
4535 UNGCPRO; 4516 UNGCPRO;
4536 return val; 4517 return val;
@@ -4596,7 +4577,7 @@ This calls `write-region-annotate-functions' at the start, and
4596 desc = -1; 4577 desc = -1;
4597 if (!NILP (append)) 4578 if (!NILP (append))
4598#ifdef DOS_NT 4579#ifdef DOS_NT
4599 desc = emacs_open (fn, O_WRONLY | buffer_file_type, 0); 4580 desc = emacs_open (fn, O_WRONLY | O_BINARY, 0);
4600#else /* not DOS_NT */ 4581#else /* not DOS_NT */
4601 desc = emacs_open (fn, O_WRONLY, 0); 4582 desc = emacs_open (fn, O_WRONLY, 0);
4602#endif /* not DOS_NT */ 4583#endif /* not DOS_NT */
@@ -4604,7 +4585,7 @@ This calls `write-region-annotate-functions' at the start, and
4604 if (desc < 0 && (NILP (append) || errno == ENOENT)) 4585 if (desc < 0 && (NILP (append) || errno == ENOENT))
4605#ifdef DOS_NT 4586#ifdef DOS_NT
4606 desc = emacs_open (fn, 4587 desc = emacs_open (fn,
4607 O_WRONLY | O_CREAT | buffer_file_type 4588 O_WRONLY | O_CREAT | O_BINARY
4608 | (EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC), 4589 | (EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC),
4609 S_IREAD | S_IWRITE); 4590 S_IREAD | S_IWRITE);
4610#else /* not DOS_NT */ 4591#else /* not DOS_NT */
@@ -4743,15 +4724,15 @@ This calls `write-region-annotate-functions' at the start, and
4743 if (visiting) 4724 if (visiting)
4744 { 4725 {
4745 SAVE_MODIFF = MODIFF; 4726 SAVE_MODIFF = MODIFF;
4746 XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); 4727 XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
4747 B_ (current_buffer, filename) = visit_file; 4728 BVAR (current_buffer, filename) = visit_file;
4748 update_mode_lines++; 4729 update_mode_lines++;
4749 } 4730 }
4750 else if (quietly) 4731 else if (quietly)
4751 { 4732 {
4752 if (auto_saving 4733 if (auto_saving
4753 && ! NILP (Fstring_equal (B_ (current_buffer, filename), 4734 && ! NILP (Fstring_equal (BVAR (current_buffer, filename),
4754 B_ (current_buffer, auto_save_file_name)))) 4735 BVAR (current_buffer, auto_save_file_name))))
4755 SAVE_MODIFF = MODIFF; 4736 SAVE_MODIFF = MODIFF;
4756 4737
4757 return Qnil; 4738 return Qnil;
@@ -4833,10 +4814,10 @@ build_annotations (Lisp_Object start, Lisp_Object end)
4833 } 4814 }
4834 4815
4835 /* Now do the same for annotation functions implied by the file-format */ 4816 /* Now do the same for annotation functions implied by the file-format */
4836 if (auto_saving && (!EQ (B_ (current_buffer, auto_save_file_format), Qt))) 4817 if (auto_saving && (!EQ (BVAR (current_buffer, auto_save_file_format), Qt)))
4837 p = B_ (current_buffer, auto_save_file_format); 4818 p = BVAR (current_buffer, auto_save_file_format);
4838 else 4819 else
4839 p = B_ (current_buffer, file_format); 4820 p = BVAR (current_buffer, file_format);
4840 for (i = 0; CONSP (p); p = XCDR (p), ++i) 4821 for (i = 0; CONSP (p); p = XCDR (p), ++i)
4841 { 4822 {
4842 struct buffer *given_buffer = current_buffer; 4823 struct buffer *given_buffer = current_buffer;
@@ -5015,17 +4996,17 @@ See Info node `(elisp)Modification Time' for more details. */)
5015 b = XBUFFER (buf); 4996 b = XBUFFER (buf);
5016 } 4997 }
5017 4998
5018 if (!STRINGP (B_ (b, filename))) return Qt; 4999 if (!STRINGP (BVAR (b, filename))) return Qt;
5019 if (b->modtime == 0) return Qt; 5000 if (b->modtime == 0) return Qt;
5020 5001
5021 /* If the file name has special constructs in it, 5002 /* If the file name has special constructs in it,
5022 call the corresponding file handler. */ 5003 call the corresponding file handler. */
5023 handler = Ffind_file_name_handler (B_ (b, filename), 5004 handler = Ffind_file_name_handler (BVAR (b, filename),
5024 Qverify_visited_file_modtime); 5005 Qverify_visited_file_modtime);
5025 if (!NILP (handler)) 5006 if (!NILP (handler))
5026 return call2 (handler, Qverify_visited_file_modtime, buf); 5007 return call2 (handler, Qverify_visited_file_modtime, buf);
5027 5008
5028 filename = ENCODE_FILE (B_ (b, filename)); 5009 filename = ENCODE_FILE (BVAR (b, filename));
5029 5010
5030 if (stat (SSDATA (filename), &st) < 0) 5011 if (stat (SSDATA (filename), &st) < 0)
5031 { 5012 {
@@ -5093,7 +5074,7 @@ An argument specifies the modification time value to use
5093 struct stat st; 5074 struct stat st;
5094 Lisp_Object handler; 5075 Lisp_Object handler;
5095 5076
5096 filename = Fexpand_file_name (B_ (current_buffer, filename), Qnil); 5077 filename = Fexpand_file_name (BVAR (current_buffer, filename), Qnil);
5097 5078
5098 /* If the file name has special constructs in it, 5079 /* If the file name has special constructs in it,
5099 call the corresponding file handler. */ 5080 call the corresponding file handler. */
@@ -5128,7 +5109,7 @@ auto_save_error (Lisp_Object error)
5128 ring_bell (XFRAME (selected_frame)); 5109 ring_bell (XFRAME (selected_frame));
5129 5110
5130 args[0] = build_string ("Auto-saving %s: %s"); 5111 args[0] = build_string ("Auto-saving %s: %s");
5131 args[1] = B_ (current_buffer, name); 5112 args[1] = BVAR (current_buffer, name);
5132 args[2] = Ferror_message_string (error); 5113 args[2] = Ferror_message_string (error);
5133 msg = Fformat (3, args); 5114 msg = Fformat (3, args);
5134 GCPRO1 (msg); 5115 GCPRO1 (msg);
@@ -5159,19 +5140,19 @@ auto_save_1 (void)
5159 auto_save_mode_bits = 0666; 5140 auto_save_mode_bits = 0666;
5160 5141
5161 /* Get visited file's mode to become the auto save file's mode. */ 5142 /* Get visited file's mode to become the auto save file's mode. */
5162 if (! NILP (B_ (current_buffer, filename))) 5143 if (! NILP (BVAR (current_buffer, filename)))
5163 { 5144 {
5164 if (stat (SSDATA (B_ (current_buffer, filename)), &st) >= 0) 5145 if (stat (SSDATA (BVAR (current_buffer, filename)), &st) >= 0)
5165 /* But make sure we can overwrite it later! */ 5146 /* But make sure we can overwrite it later! */
5166 auto_save_mode_bits = st.st_mode | 0600; 5147 auto_save_mode_bits = st.st_mode | 0600;
5167 else if ((modes = Ffile_modes (B_ (current_buffer, filename)), 5148 else if ((modes = Ffile_modes (BVAR (current_buffer, filename)),
5168 INTEGERP (modes))) 5149 INTEGERP (modes)))
5169 /* Remote files don't cooperate with stat. */ 5150 /* Remote files don't cooperate with stat. */
5170 auto_save_mode_bits = XINT (modes) | 0600; 5151 auto_save_mode_bits = XINT (modes) | 0600;
5171 } 5152 }
5172 5153
5173 return 5154 return
5174 Fwrite_region (Qnil, Qnil, B_ (current_buffer, auto_save_file_name), Qnil, 5155 Fwrite_region (Qnil, Qnil, BVAR (current_buffer, auto_save_file_name), Qnil,
5175 NILP (Vauto_save_visited_file_name) ? Qlambda : Qt, 5156 NILP (Vauto_save_visited_file_name) ? Qlambda : Qt,
5176 Qnil, Qnil); 5157 Qnil, Qnil);
5177} 5158}
@@ -5312,18 +5293,18 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5312 /* Record all the buffers that have auto save mode 5293 /* Record all the buffers that have auto save mode
5313 in the special file that lists them. For each of these buffers, 5294 in the special file that lists them. For each of these buffers,
5314 Record visited name (if any) and auto save name. */ 5295 Record visited name (if any) and auto save name. */
5315 if (STRINGP (B_ (b, auto_save_file_name)) 5296 if (STRINGP (BVAR (b, auto_save_file_name))
5316 && stream != NULL && do_handled_files == 0) 5297 && stream != NULL && do_handled_files == 0)
5317 { 5298 {
5318 BLOCK_INPUT; 5299 BLOCK_INPUT;
5319 if (!NILP (B_ (b, filename))) 5300 if (!NILP (BVAR (b, filename)))
5320 { 5301 {
5321 fwrite (SDATA (B_ (b, filename)), 1, 5302 fwrite (SDATA (BVAR (b, filename)), 1,
5322 SBYTES (B_ (b, filename)), stream); 5303 SBYTES (BVAR (b, filename)), stream);
5323 } 5304 }
5324 putc ('\n', stream); 5305 putc ('\n', stream);
5325 fwrite (SDATA (B_ (b, auto_save_file_name)), 1, 5306 fwrite (SDATA (BVAR (b, auto_save_file_name)), 1,
5326 SBYTES (B_ (b, auto_save_file_name)), stream); 5307 SBYTES (BVAR (b, auto_save_file_name)), stream);
5327 putc ('\n', stream); 5308 putc ('\n', stream);
5328 UNBLOCK_INPUT; 5309 UNBLOCK_INPUT;
5329 } 5310 }
@@ -5340,13 +5321,13 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5340 /* Check for auto save enabled 5321 /* Check for auto save enabled
5341 and file changed since last auto save 5322 and file changed since last auto save
5342 and file changed since last real save. */ 5323 and file changed since last real save. */
5343 if (STRINGP (B_ (b, auto_save_file_name)) 5324 if (STRINGP (BVAR (b, auto_save_file_name))
5344 && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) 5325 && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
5345 && BUF_AUTOSAVE_MODIFF (b) < BUF_MODIFF (b) 5326 && BUF_AUTOSAVE_MODIFF (b) < BUF_MODIFF (b)
5346 /* -1 means we've turned off autosaving for a while--see below. */ 5327 /* -1 means we've turned off autosaving for a while--see below. */
5347 && XINT (B_ (b, save_length)) >= 0 5328 && XINT (BVAR (b, save_length)) >= 0
5348 && (do_handled_files 5329 && (do_handled_files
5349 || NILP (Ffind_file_name_handler (B_ (b, auto_save_file_name), 5330 || NILP (Ffind_file_name_handler (BVAR (b, auto_save_file_name),
5350 Qwrite_region)))) 5331 Qwrite_region))))
5351 { 5332 {
5352 EMACS_TIME before_time, after_time; 5333 EMACS_TIME before_time, after_time;
@@ -5360,23 +5341,23 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5360 5341
5361 set_buffer_internal (b); 5342 set_buffer_internal (b);
5362 if (NILP (Vauto_save_include_big_deletions) 5343 if (NILP (Vauto_save_include_big_deletions)
5363 && (XFASTINT (B_ (b, save_length)) * 10 5344 && (XFASTINT (BVAR (b, save_length)) * 10
5364 > (BUF_Z (b) - BUF_BEG (b)) * 13) 5345 > (BUF_Z (b) - BUF_BEG (b)) * 13)
5365 /* A short file is likely to change a large fraction; 5346 /* A short file is likely to change a large fraction;
5366 spare the user annoying messages. */ 5347 spare the user annoying messages. */
5367 && XFASTINT (B_ (b, save_length)) > 5000 5348 && XFASTINT (BVAR (b, save_length)) > 5000
5368 /* These messages are frequent and annoying for `*mail*'. */ 5349 /* These messages are frequent and annoying for `*mail*'. */
5369 && !EQ (B_ (b, filename), Qnil) 5350 && !EQ (BVAR (b, filename), Qnil)
5370 && NILP (no_message)) 5351 && NILP (no_message))
5371 { 5352 {
5372 /* It has shrunk too much; turn off auto-saving here. */ 5353 /* It has shrunk too much; turn off auto-saving here. */
5373 minibuffer_auto_raise = orig_minibuffer_auto_raise; 5354 minibuffer_auto_raise = orig_minibuffer_auto_raise;
5374 message_with_string ("Buffer %s has shrunk a lot; auto save disabled in that buffer until next real save", 5355 message_with_string ("Buffer %s has shrunk a lot; auto save disabled in that buffer until next real save",
5375 B_ (b, name), 1); 5356 BVAR (b, name), 1);
5376 minibuffer_auto_raise = 0; 5357 minibuffer_auto_raise = 0;
5377 /* Turn off auto-saving until there's a real save, 5358 /* Turn off auto-saving until there's a real save,
5378 and prevent any more warnings. */ 5359 and prevent any more warnings. */
5379 XSETINT (B_ (b, save_length), -1); 5360 XSETINT (BVAR (b, save_length), -1);
5380 Fsleep_for (make_number (1), Qnil); 5361 Fsleep_for (make_number (1), Qnil);
5381 continue; 5362 continue;
5382 } 5363 }
@@ -5385,7 +5366,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5385 internal_condition_case (auto_save_1, Qt, auto_save_error); 5366 internal_condition_case (auto_save_1, Qt, auto_save_error);
5386 auto_saved++; 5367 auto_saved++;
5387 BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b); 5368 BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b);
5388 XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); 5369 XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
5389 set_buffer_internal (old); 5370 set_buffer_internal (old);
5390 5371
5391 EMACS_GET_TIME (after_time); 5372 EMACS_GET_TIME (after_time);
@@ -5432,7 +5413,7 @@ No auto-save file will be written until the buffer changes again. */)
5432 /* FIXME: This should not be called in indirect buffers, since 5413 /* FIXME: This should not be called in indirect buffers, since
5433 they're not autosaved. */ 5414 they're not autosaved. */
5434 BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; 5415 BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
5435 XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); 5416 XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
5436 current_buffer->auto_save_failure_time = -1; 5417 current_buffer->auto_save_failure_time = -1;
5437 return Qnil; 5418 return Qnil;
5438} 5419}
@@ -5586,11 +5567,6 @@ syms_of_fileio (void)
5586 Qexcl = intern_c_string ("excl"); 5567 Qexcl = intern_c_string ("excl");
5587 staticpro (&Qexcl); 5568 staticpro (&Qexcl);
5588 5569
5589#ifdef DOS_NT
5590 Qfind_buffer_file_type = intern_c_string ("find-buffer-file-type");
5591 staticpro (&Qfind_buffer_file_type);
5592#endif /* DOS_NT */
5593
5594 DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system, 5570 DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system,
5595 doc: /* *Coding system for encoding file names. 5571 doc: /* *Coding system for encoding file names.
5596If it is nil, `default-file-name-coding-system' (which see) is used. */); 5572If it is nil, `default-file-name-coding-system' (which see) is used. */);
diff --git a/src/filelock.c b/src/filelock.c
index 6802880c985..8e18bb7b650 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -637,9 +637,9 @@ unlock_all_files (void)
637 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) 637 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
638 { 638 {
639 b = XBUFFER (XCDR (XCAR (tail))); 639 b = XBUFFER (XCDR (XCAR (tail)));
640 if (STRINGP (B_ (b, file_truename)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) 640 if (STRINGP (BVAR (b, file_truename)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
641 { 641 {
642 unlock_file(B_ (b, file_truename)); 642 unlock_file(BVAR (b, file_truename));
643 } 643 }
644 } 644 }
645} 645}
@@ -652,7 +652,7 @@ or else nothing is done if current buffer isn't visiting a file. */)
652 (Lisp_Object file) 652 (Lisp_Object file)
653{ 653{
654 if (NILP (file)) 654 if (NILP (file))
655 file = B_ (current_buffer, file_truename); 655 file = BVAR (current_buffer, file_truename);
656 else 656 else
657 CHECK_STRING (file); 657 CHECK_STRING (file);
658 if (SAVE_MODIFF < MODIFF 658 if (SAVE_MODIFF < MODIFF
@@ -669,8 +669,8 @@ should not be locked in that case. */)
669 (void) 669 (void)
670{ 670{
671 if (SAVE_MODIFF < MODIFF 671 if (SAVE_MODIFF < MODIFF
672 && STRINGP (B_ (current_buffer, file_truename))) 672 && STRINGP (BVAR (current_buffer, file_truename)))
673 unlock_file (B_ (current_buffer, file_truename)); 673 unlock_file (BVAR (current_buffer, file_truename));
674 return Qnil; 674 return Qnil;
675} 675}
676 676
@@ -680,8 +680,8 @@ void
680unlock_buffer (struct buffer *buffer) 680unlock_buffer (struct buffer *buffer)
681{ 681{
682 if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer) 682 if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer)
683 && STRINGP (B_ (buffer, file_truename))) 683 && STRINGP (BVAR (buffer, file_truename)))
684 unlock_file (B_ (buffer, file_truename)); 684 unlock_file (BVAR (buffer, file_truename));
685} 685}
686 686
687DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0, 687DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0,
diff --git a/src/fns.c b/src/fns.c
index a9632914d67..b54d52e3003 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2984,7 +2984,7 @@ into shorter lines. */)
2984 SAFE_ALLOCA (encoded, char *, allength); 2984 SAFE_ALLOCA (encoded, char *, allength);
2985 encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg), 2985 encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg),
2986 encoded, length, NILP (no_line_break), 2986 encoded, length, NILP (no_line_break),
2987 !NILP (B_ (current_buffer, enable_multibyte_characters))); 2987 !NILP (BVAR (current_buffer, enable_multibyte_characters)));
2988 if (encoded_length > allength) 2988 if (encoded_length > allength)
2989 abort (); 2989 abort ();
2990 2990
@@ -3166,7 +3166,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3166 EMACS_INT old_pos = PT; 3166 EMACS_INT old_pos = PT;
3167 EMACS_INT decoded_length; 3167 EMACS_INT decoded_length;
3168 EMACS_INT inserted_chars; 3168 EMACS_INT inserted_chars;
3169 int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); 3169 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
3170 USE_SAFE_ALLOCA; 3170 USE_SAFE_ALLOCA;
3171 3171
3172 validate_region (&beg, &end); 3172 validate_region (&beg, &end);
@@ -4684,12 +4684,12 @@ guesswork fails. Normally, an error is signaled in such case. */)
4684 { 4684 {
4685 int force_raw_text = 0; 4685 int force_raw_text = 0;
4686 4686
4687 coding_system = B_ (XBUFFER (object), buffer_file_coding_system); 4687 coding_system = BVAR (XBUFFER (object), buffer_file_coding_system);
4688 if (NILP (coding_system) 4688 if (NILP (coding_system)
4689 || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil))) 4689 || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil)))
4690 { 4690 {
4691 coding_system = Qnil; 4691 coding_system = Qnil;
4692 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 4692 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
4693 force_raw_text = 1; 4693 force_raw_text = 1;
4694 } 4694 }
4695 4695
@@ -4706,11 +4706,11 @@ guesswork fails. Normally, an error is signaled in such case. */)
4706 } 4706 }
4707 4707
4708 if (NILP (coding_system) 4708 if (NILP (coding_system)
4709 && !NILP (B_ (XBUFFER (object), buffer_file_coding_system))) 4709 && !NILP (BVAR (XBUFFER (object), buffer_file_coding_system)))
4710 { 4710 {
4711 /* If we still have not decided a coding system, use the 4711 /* If we still have not decided a coding system, use the
4712 default value of buffer-file-coding-system. */ 4712 default value of buffer-file-coding-system. */
4713 coding_system = B_ (XBUFFER (object), buffer_file_coding_system); 4713 coding_system = BVAR (XBUFFER (object), buffer_file_coding_system);
4714 } 4714 }
4715 4715
4716 if (!force_raw_text 4716 if (!force_raw_text
diff --git a/src/font.c b/src/font.c
index d67e8465b6a..d77eafb6ad2 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3637,7 +3637,7 @@ font_at (int c, EMACS_INT pos, struct face *face, struct window *w,
3637 Lisp_Object font_object; 3637 Lisp_Object font_object;
3638 3638
3639 multibyte = (NILP (string) 3639 multibyte = (NILP (string)
3640 ? ! NILP (B_ (current_buffer, enable_multibyte_characters)) 3640 ? ! NILP (BVAR (current_buffer, enable_multibyte_characters))
3641 : STRING_MULTIBYTE (string)); 3641 : STRING_MULTIBYTE (string));
3642 if (c < 0) 3642 if (c < 0)
3643 { 3643 {
diff --git a/src/frame.c b/src/frame.c
index ac223ac4da0..56e0e7ec919 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -428,20 +428,20 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
428 if (NILP (mini_window)) 428 if (NILP (mini_window))
429 { 429 {
430 /* Use default-minibuffer-frame if possible. */ 430 /* Use default-minibuffer-frame if possible. */
431 if (!FRAMEP (kb->Vdefault_minibuffer_frame) 431 if (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
432 || ! FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))) 432 || ! FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame))))
433 { 433 {
434 Lisp_Object frame_dummy; 434 Lisp_Object frame_dummy;
435 435
436 XSETFRAME (frame_dummy, f); 436 XSETFRAME (frame_dummy, f);
437 GCPRO1 (frame_dummy); 437 GCPRO1 (frame_dummy);
438 /* If there's no minibuffer frame to use, create one. */ 438 /* If there's no minibuffer frame to use, create one. */
439 kb->Vdefault_minibuffer_frame = 439 KVAR (kb, Vdefault_minibuffer_frame) =
440 call1 (intern ("make-initial-minibuffer-frame"), display); 440 call1 (intern ("make-initial-minibuffer-frame"), display);
441 UNGCPRO; 441 UNGCPRO;
442 } 442 }
443 443
444 mini_window = XFRAME (kb->Vdefault_minibuffer_frame)->minibuffer_window; 444 mini_window = XFRAME (KVAR (kb, Vdefault_minibuffer_frame))->minibuffer_window;
445 } 445 }
446 446
447 f->minibuffer_window = mini_window; 447 f->minibuffer_window = mini_window;
@@ -889,7 +889,7 @@ to that frame. */)
889 (Lisp_Object event) 889 (Lisp_Object event)
890{ 890{
891 /* Preserve prefix arg that the command loop just cleared. */ 891 /* Preserve prefix arg that the command loop just cleared. */
892 current_kboard->Vprefix_arg = Vcurrent_prefix_arg; 892 KVAR (current_kboard, Vprefix_arg) = Vcurrent_prefix_arg;
893 call1 (Vrun_hooks, Qmouse_leave_buffer_hook); 893 call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
894 return do_switch_frame (event, 0, 0, Qnil); 894 return do_switch_frame (event, 0, 0, Qnil);
895} 895}
@@ -1526,7 +1526,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1526 /* If we've deleted this keyboard's default_minibuffer_frame, try to 1526 /* If we've deleted this keyboard's default_minibuffer_frame, try to
1527 find another one. Prefer minibuffer-only frames, but also notice 1527 find another one. Prefer minibuffer-only frames, but also notice
1528 frames with other windows. */ 1528 frames with other windows. */
1529 if (kb != NULL && EQ (frame, kb->Vdefault_minibuffer_frame)) 1529 if (kb != NULL && EQ (frame, KVAR (kb, Vdefault_minibuffer_frame)))
1530 { 1530 {
1531 Lisp_Object frames; 1531 Lisp_Object frames;
1532 1532
@@ -1575,11 +1575,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1575 if (NILP (frame_with_minibuf)) 1575 if (NILP (frame_with_minibuf))
1576 abort (); 1576 abort ();
1577 1577
1578 kb->Vdefault_minibuffer_frame = frame_with_minibuf; 1578 KVAR (kb, Vdefault_minibuffer_frame) = frame_with_minibuf;
1579 } 1579 }
1580 else 1580 else
1581 /* No frames left on this kboard--say no minibuffer either. */ 1581 /* No frames left on this kboard--say no minibuffer either. */
1582 kb->Vdefault_minibuffer_frame = Qnil; 1582 KVAR (kb, Vdefault_minibuffer_frame) = Qnil;
1583 } 1583 }
1584 1584
1585 /* Cause frame titles to update--necessary if we now have just one frame. */ 1585 /* Cause frame titles to update--necessary if we now have just one frame. */
@@ -1817,7 +1817,7 @@ make_frame_visible_1 (Lisp_Object window)
1817 w = XWINDOW (window); 1817 w = XWINDOW (window);
1818 1818
1819 if (!NILP (w->buffer)) 1819 if (!NILP (w->buffer))
1820 B_ (XBUFFER (w->buffer), display_time) = Fcurrent_time (); 1820 BVAR (XBUFFER (w->buffer), display_time) = Fcurrent_time ();
1821 1821
1822 if (!NILP (w->vchild)) 1822 if (!NILP (w->vchild))
1823 make_frame_visible_1 (w->vchild); 1823 make_frame_visible_1 (w->vchild);
diff --git a/src/fringe.c b/src/fringe.c
index 5b7f8833069..d42d6467f31 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -660,7 +660,7 @@ get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor)
660{ 660{
661 Lisp_Object cmap, bm = Qnil; 661 Lisp_Object cmap, bm = Qnil;
662 662
663 if ((cmap = B_ (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap)) 663 if ((cmap = BVAR (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap))
664 { 664 {
665 bm = Fassq (cursor, cmap); 665 bm = Fassq (cursor, cmap);
666 if (CONSP (bm)) 666 if (CONSP (bm))
@@ -670,9 +670,9 @@ get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor)
670 return lookup_fringe_bitmap (bm); 670 return lookup_fringe_bitmap (bm);
671 } 671 }
672 } 672 }
673 if (EQ (cmap, B_ (&buffer_defaults, fringe_cursor_alist))) 673 if (EQ (cmap, BVAR (&buffer_defaults, fringe_cursor_alist)))
674 return NO_FRINGE_BITMAP; 674 return NO_FRINGE_BITMAP;
675 bm = Fassq (cursor, B_ (&buffer_defaults, fringe_cursor_alist)); 675 bm = Fassq (cursor, BVAR (&buffer_defaults, fringe_cursor_alist));
676 if (!CONSP (bm) || ((bm = XCDR (bm)), NILP (bm))) 676 if (!CONSP (bm) || ((bm = XCDR (bm)), NILP (bm)))
677 return NO_FRINGE_BITMAP; 677 return NO_FRINGE_BITMAP;
678 return lookup_fringe_bitmap (bm); 678 return lookup_fringe_bitmap (bm);
@@ -697,7 +697,7 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in
697 If partial, lookup partial bitmap in default value if not found here. 697 If partial, lookup partial bitmap in default value if not found here.
698 If not partial, or no partial spec is present, use non-partial bitmap. */ 698 If not partial, or no partial spec is present, use non-partial bitmap. */
699 699
700 if ((cmap = B_ (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap)) 700 if ((cmap = BVAR (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap))
701 { 701 {
702 bm1 = Fassq (bitmap, cmap); 702 bm1 = Fassq (bitmap, cmap);
703 if (CONSP (bm1)) 703 if (CONSP (bm1))
@@ -731,10 +731,10 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in
731 } 731 }
732 } 732 }
733 733
734 if (!EQ (cmap, B_ (&buffer_defaults, fringe_indicator_alist)) 734 if (!EQ (cmap, BVAR (&buffer_defaults, fringe_indicator_alist))
735 && !NILP (B_ (&buffer_defaults, fringe_indicator_alist))) 735 && !NILP (BVAR (&buffer_defaults, fringe_indicator_alist)))
736 { 736 {
737 bm2 = Fassq (bitmap, B_ (&buffer_defaults, fringe_indicator_alist)); 737 bm2 = Fassq (bitmap, BVAR (&buffer_defaults, fringe_indicator_alist));
738 if (CONSP (bm2)) 738 if (CONSP (bm2))
739 { 739 {
740 if ((bm2 = XCDR (bm2)), !NILP (bm2)) 740 if ((bm2 = XCDR (bm2)), !NILP (bm2))
@@ -919,7 +919,7 @@ update_window_fringes (struct window *w, int keep_current_p)
919 return 0; 919 return 0;
920 920
921 if (!MINI_WINDOW_P (w) 921 if (!MINI_WINDOW_P (w)
922 && (ind = B_ (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind))) 922 && (ind = BVAR (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind)))
923 { 923 {
924 if (EQ (ind, Qleft) || EQ (ind, Qright)) 924 if (EQ (ind, Qleft) || EQ (ind, Qright))
925 boundary_top = boundary_bot = arrow_top = arrow_bot = ind; 925 boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
@@ -988,7 +988,7 @@ update_window_fringes (struct window *w, int keep_current_p)
988 } 988 }
989 } 989 }
990 990
991 empty_pos = B_ (XBUFFER (w->buffer), indicate_empty_lines); 991 empty_pos = BVAR (XBUFFER (w->buffer), indicate_empty_lines);
992 if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) 992 if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
993 empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft; 993 empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
994 994
diff --git a/src/indent.c b/src/indent.c
index b0195b3dec8..85d26520cfb 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -70,7 +70,7 @@ buffer_display_table (void)
70{ 70{
71 Lisp_Object thisbuf; 71 Lisp_Object thisbuf;
72 72
73 thisbuf = B_ (current_buffer, display_table); 73 thisbuf = BVAR (current_buffer, display_table);
74 if (DISP_TABLE_P (thisbuf)) 74 if (DISP_TABLE_P (thisbuf))
75 return XCHAR_TABLE (thisbuf); 75 return XCHAR_TABLE (thisbuf);
76 if (DISP_TABLE_P (Vstandard_display_table)) 76 if (DISP_TABLE_P (Vstandard_display_table))
@@ -140,9 +140,9 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
140 int i; 140 int i;
141 struct Lisp_Vector *widthtab; 141 struct Lisp_Vector *widthtab;
142 142
143 if (!VECTORP (B_ (buf, width_table))) 143 if (!VECTORP (BVAR (buf, width_table)))
144 B_ (buf, width_table) = Fmake_vector (make_number (256), make_number (0)); 144 BVAR (buf, width_table) = Fmake_vector (make_number (256), make_number (0));
145 widthtab = XVECTOR (B_ (buf, width_table)); 145 widthtab = XVECTOR (BVAR (buf, width_table));
146 if (widthtab->size != 256) 146 if (widthtab->size != 256)
147 abort (); 147 abort ();
148 148
@@ -156,17 +156,17 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
156static void 156static void
157width_run_cache_on_off (void) 157width_run_cache_on_off (void)
158{ 158{
159 if (NILP (B_ (current_buffer, cache_long_line_scans)) 159 if (NILP (BVAR (current_buffer, cache_long_line_scans))
160 /* And, for the moment, this feature doesn't work on multibyte 160 /* And, for the moment, this feature doesn't work on multibyte
161 characters. */ 161 characters. */
162 || !NILP (B_ (current_buffer, enable_multibyte_characters))) 162 || !NILP (BVAR (current_buffer, enable_multibyte_characters)))
163 { 163 {
164 /* It should be off. */ 164 /* It should be off. */
165 if (current_buffer->width_run_cache) 165 if (current_buffer->width_run_cache)
166 { 166 {
167 free_region_cache (current_buffer->width_run_cache); 167 free_region_cache (current_buffer->width_run_cache);
168 current_buffer->width_run_cache = 0; 168 current_buffer->width_run_cache = 0;
169 B_ (current_buffer, width_table) = Qnil; 169 BVAR (current_buffer, width_table) = Qnil;
170 } 170 }
171 } 171 }
172 else 172 else
@@ -329,8 +329,8 @@ current_column (void)
329 register int tab_seen; 329 register int tab_seen;
330 int post_tab; 330 int post_tab;
331 register int c; 331 register int c;
332 register int tab_width = XINT (B_ (current_buffer, tab_width)); 332 register int tab_width = XINT (BVAR (current_buffer, tab_width));
333 int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); 333 int ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
334 register struct Lisp_Char_Table *dp = buffer_display_table (); 334 register struct Lisp_Char_Table *dp = buffer_display_table ();
335 335
336 if (PT == last_known_column_point 336 if (PT == last_known_column_point
@@ -417,7 +417,7 @@ current_column (void)
417 col++; 417 col++;
418 else if (c == '\n' 418 else if (c == '\n'
419 || (c == '\r' 419 || (c == '\r'
420 && EQ (B_ (current_buffer, selective_display), Qt))) 420 && EQ (BVAR (current_buffer, selective_display), Qt)))
421 { 421 {
422 ptr++; 422 ptr++;
423 goto start_of_line_found; 423 goto start_of_line_found;
@@ -512,10 +512,10 @@ check_display_width (EMACS_INT pos, EMACS_INT col, EMACS_INT *endpos)
512static void 512static void
513scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) 513scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
514{ 514{
515 register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width)); 515 register EMACS_INT tab_width = XINT (BVAR (current_buffer, tab_width));
516 register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); 516 register int ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
517 register struct Lisp_Char_Table *dp = buffer_display_table (); 517 register struct Lisp_Char_Table *dp = buffer_display_table ();
518 int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); 518 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
519 struct composition_it cmp_it; 519 struct composition_it cmp_it;
520 Lisp_Object window; 520 Lisp_Object window;
521 struct window *w; 521 struct window *w;
@@ -637,7 +637,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
637 637
638 if (c == '\n') 638 if (c == '\n')
639 goto endloop; 639 goto endloop;
640 if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt)) 640 if (c == '\r' && EQ (BVAR (current_buffer, selective_display), Qt))
641 goto endloop; 641 goto endloop;
642 if (c == '\t') 642 if (c == '\t')
643 { 643 {
@@ -655,7 +655,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
655 655
656 if (c == '\n') 656 if (c == '\n')
657 goto endloop; 657 goto endloop;
658 if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt)) 658 if (c == '\r' && EQ (BVAR (current_buffer, selective_display), Qt))
659 goto endloop; 659 goto endloop;
660 if (c == '\t') 660 if (c == '\t')
661 { 661 {
@@ -809,7 +809,7 @@ The return value is COLUMN. */)
809{ 809{
810 int mincol; 810 int mincol;
811 register int fromcol; 811 register int fromcol;
812 register int tab_width = XINT (B_ (current_buffer, tab_width)); 812 register int tab_width = XINT (BVAR (current_buffer, tab_width));
813 813
814 CHECK_NUMBER (column); 814 CHECK_NUMBER (column);
815 if (NILP (minimum)) 815 if (NILP (minimum))
@@ -872,7 +872,7 @@ static double
872position_indentation (register int pos_byte) 872position_indentation (register int pos_byte)
873{ 873{
874 register EMACS_INT column = 0; 874 register EMACS_INT column = 0;
875 register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width)); 875 register EMACS_INT tab_width = XINT (BVAR (current_buffer, tab_width));
876 register unsigned char *p; 876 register unsigned char *p;
877 register unsigned char *stop; 877 register unsigned char *stop;
878 unsigned char *start; 878 unsigned char *start;
@@ -924,7 +924,7 @@ position_indentation (register int pos_byte)
924 switch (*p++) 924 switch (*p++)
925 { 925 {
926 case 0240: 926 case 0240:
927 if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 927 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
928 return column; 928 return column;
929 case ' ': 929 case ' ':
930 column++; 930 column++;
@@ -934,7 +934,7 @@ position_indentation (register int pos_byte)
934 break; 934 break;
935 default: 935 default:
936 if (ASCII_BYTE_P (p[-1]) 936 if (ASCII_BYTE_P (p[-1])
937 || NILP (B_ (current_buffer, enable_multibyte_characters))) 937 || NILP (BVAR (current_buffer, enable_multibyte_characters)))
938 return column; 938 return column;
939 { 939 {
940 int c; 940 int c;
@@ -1123,13 +1123,13 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1123 register EMACS_INT pos; 1123 register EMACS_INT pos;
1124 EMACS_INT pos_byte; 1124 EMACS_INT pos_byte;
1125 register int c = 0; 1125 register int c = 0;
1126 register EMACS_INT tab_width = XFASTINT (B_ (current_buffer, tab_width)); 1126 register EMACS_INT tab_width = XFASTINT (BVAR (current_buffer, tab_width));
1127 register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); 1127 register int ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
1128 register struct Lisp_Char_Table *dp = window_display_table (win); 1128 register struct Lisp_Char_Table *dp = window_display_table (win);
1129 int selective 1129 int selective
1130 = (INTEGERP (B_ (current_buffer, selective_display)) 1130 = (INTEGERP (BVAR (current_buffer, selective_display))
1131 ? XINT (B_ (current_buffer, selective_display)) 1131 ? XINT (BVAR (current_buffer, selective_display))
1132 : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0); 1132 : !NILP (BVAR (current_buffer, selective_display)) ? -1 : 0);
1133 int selective_rlen 1133 int selective_rlen
1134 = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp)) 1134 = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
1135 ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); 1135 ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
@@ -1151,7 +1151,7 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1151 EMACS_INT next_width_run = from; 1151 EMACS_INT next_width_run = from;
1152 Lisp_Object window; 1152 Lisp_Object window;
1153 1153
1154 int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); 1154 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
1155 /* If previous char scanned was a wide character, 1155 /* If previous char scanned was a wide character,
1156 this is the column where it ended. Otherwise, this is 0. */ 1156 this is the column where it ended. Otherwise, this is 0. */
1157 EMACS_INT wide_column_end_hpos = 0; 1157 EMACS_INT wide_column_end_hpos = 0;
@@ -1170,8 +1170,8 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1170 1170
1171 width_run_cache_on_off (); 1171 width_run_cache_on_off ();
1172 if (dp == buffer_display_table ()) 1172 if (dp == buffer_display_table ())
1173 width_table = (VECTORP (B_ (current_buffer, width_table)) 1173 width_table = (VECTORP (BVAR (current_buffer, width_table))
1174 ? XVECTOR (B_ (current_buffer, width_table))->contents 1174 ? XVECTOR (BVAR (current_buffer, width_table))->contents
1175 : 0); 1175 : 0);
1176 else 1176 else
1177 /* If the window has its own display table, we can't use the width 1177 /* If the window has its own display table, we can't use the width
@@ -1337,7 +1337,7 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1337 } 1337 }
1338 1338
1339 if (hscroll || truncate 1339 if (hscroll || truncate
1340 || !NILP (B_ (current_buffer, truncate_lines))) 1340 || !NILP (BVAR (current_buffer, truncate_lines)))
1341 { 1341 {
1342 /* Truncating: skip to newline, unless we are already past 1342 /* Truncating: skip to newline, unless we are already past
1343 TO (we need to go back below). */ 1343 TO (we need to go back below). */
@@ -1838,9 +1838,9 @@ vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w)
1838 EMACS_INT from_byte; 1838 EMACS_INT from_byte;
1839 EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0; 1839 EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0;
1840 int selective 1840 int selective
1841 = (INTEGERP (B_ (current_buffer, selective_display)) 1841 = (INTEGERP (BVAR (current_buffer, selective_display))
1842 ? XINT (B_ (current_buffer, selective_display)) 1842 ? XINT (BVAR (current_buffer, selective_display))
1843 : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0); 1843 : !NILP (BVAR (current_buffer, selective_display)) ? -1 : 0);
1844 Lisp_Object window; 1844 Lisp_Object window;
1845 EMACS_INT start_hpos = 0; 1845 EMACS_INT start_hpos = 0;
1846 int did_motion; 1846 int did_motion;
diff --git a/src/insdel.c b/src/insdel.c
index db997fc938e..7fcf9522a33 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -78,7 +78,7 @@ void
78check_markers (void) 78check_markers (void)
79{ 79{
80 register struct Lisp_Marker *tail; 80 register struct Lisp_Marker *tail;
81 int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 81 int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
82 82
83 for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) 83 for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
84 { 84 {
@@ -703,7 +703,7 @@ insert_char (int c)
703 unsigned char str[MAX_MULTIBYTE_LENGTH]; 703 unsigned char str[MAX_MULTIBYTE_LENGTH];
704 int len; 704 int len;
705 705
706 if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 706 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
707 len = CHAR_STRING (c, str); 707 len = CHAR_STRING (c, str);
708 else 708 else
709 { 709 {
@@ -891,7 +891,7 @@ insert_1_both (const char *string,
891 if (nchars == 0) 891 if (nchars == 0)
892 return; 892 return;
893 893
894 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 894 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
895 nchars = nbytes; 895 nchars = nbytes;
896 896
897 if (prepare) 897 if (prepare)
@@ -1011,7 +1011,7 @@ insert_from_string_1 (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
1011 /* Make OUTGOING_NBYTES describe the text 1011 /* Make OUTGOING_NBYTES describe the text
1012 as it will be inserted in this buffer. */ 1012 as it will be inserted in this buffer. */
1013 1013
1014 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 1014 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
1015 outgoing_nbytes = nchars; 1015 outgoing_nbytes = nchars;
1016 else if (! STRING_MULTIBYTE (string)) 1016 else if (! STRING_MULTIBYTE (string))
1017 outgoing_nbytes 1017 outgoing_nbytes
@@ -1034,7 +1034,7 @@ insert_from_string_1 (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
1034 between single-byte and multibyte. */ 1034 between single-byte and multibyte. */
1035 copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes, 1035 copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes,
1036 STRING_MULTIBYTE (string), 1036 STRING_MULTIBYTE (string),
1037 ! NILP (B_ (current_buffer, enable_multibyte_characters))); 1037 ! NILP (BVAR (current_buffer, enable_multibyte_characters)));
1038 1038
1039#ifdef BYTE_COMBINING_DEBUG 1039#ifdef BYTE_COMBINING_DEBUG
1040 /* We have copied text into the gap, but we have not altered 1040 /* We have copied text into the gap, but we have not altered
@@ -1094,7 +1094,7 @@ insert_from_string_1 (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
1094void 1094void
1095insert_from_gap (EMACS_INT nchars, EMACS_INT nbytes) 1095insert_from_gap (EMACS_INT nchars, EMACS_INT nbytes)
1096{ 1096{
1097 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 1097 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
1098 nchars = nbytes; 1098 nchars = nbytes;
1099 1099
1100 record_insert (GPT, nchars); 1100 record_insert (GPT, nchars);
@@ -1162,9 +1162,9 @@ insert_from_buffer_1 (struct buffer *buf,
1162 /* Make OUTGOING_NBYTES describe the text 1162 /* Make OUTGOING_NBYTES describe the text
1163 as it will be inserted in this buffer. */ 1163 as it will be inserted in this buffer. */
1164 1164
1165 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 1165 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
1166 outgoing_nbytes = nchars; 1166 outgoing_nbytes = nchars;
1167 else if (NILP (B_ (buf, enable_multibyte_characters))) 1167 else if (NILP (BVAR (buf, enable_multibyte_characters)))
1168 { 1168 {
1169 EMACS_INT outgoing_before_gap = 0; 1169 EMACS_INT outgoing_before_gap = 0;
1170 EMACS_INT outgoing_after_gap = 0; 1170 EMACS_INT outgoing_after_gap = 0;
@@ -1215,8 +1215,8 @@ insert_from_buffer_1 (struct buffer *buf,
1215 chunk_expanded 1215 chunk_expanded
1216 = copy_text (BUF_BYTE_ADDRESS (buf, from_byte), 1216 = copy_text (BUF_BYTE_ADDRESS (buf, from_byte),
1217 GPT_ADDR, chunk, 1217 GPT_ADDR, chunk,
1218 ! NILP (B_ (buf, enable_multibyte_characters)), 1218 ! NILP (BVAR (buf, enable_multibyte_characters)),
1219 ! NILP (B_ (current_buffer, enable_multibyte_characters))); 1219 ! NILP (BVAR (current_buffer, enable_multibyte_characters)));
1220 } 1220 }
1221 else 1221 else
1222 chunk_expanded = chunk = 0; 1222 chunk_expanded = chunk = 0;
@@ -1224,8 +1224,8 @@ insert_from_buffer_1 (struct buffer *buf,
1224 if (chunk < incoming_nbytes) 1224 if (chunk < incoming_nbytes)
1225 copy_text (BUF_BYTE_ADDRESS (buf, from_byte + chunk), 1225 copy_text (BUF_BYTE_ADDRESS (buf, from_byte + chunk),
1226 GPT_ADDR + chunk_expanded, incoming_nbytes - chunk, 1226 GPT_ADDR + chunk_expanded, incoming_nbytes - chunk,
1227 ! NILP (B_ (buf, enable_multibyte_characters)), 1227 ! NILP (BVAR (buf, enable_multibyte_characters)),
1228 ! NILP (B_ (current_buffer, enable_multibyte_characters))); 1228 ! NILP (BVAR (current_buffer, enable_multibyte_characters)));
1229 1229
1230#ifdef BYTE_COMBINING_DEBUG 1230#ifdef BYTE_COMBINING_DEBUG
1231 /* We have copied text into the gap, but we have not altered 1231 /* We have copied text into the gap, but we have not altered
@@ -1320,7 +1320,7 @@ adjust_after_replace (EMACS_INT from, EMACS_INT from_byte,
1320 adjust_markers_for_insert (from, from_byte, 1320 adjust_markers_for_insert (from, from_byte,
1321 from + len, from_byte + len_byte, 0); 1321 from + len, from_byte + len_byte, 0);
1322 1322
1323 if (! EQ (B_ (current_buffer, undo_list), Qt)) 1323 if (! EQ (BVAR (current_buffer, undo_list), Qt))
1324 { 1324 {
1325 if (nchars_del > 0) 1325 if (nchars_del > 0)
1326 record_delete (from, prev_text); 1326 record_delete (from, prev_text);
@@ -1481,7 +1481,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new,
1481 /* Make OUTGOING_INSBYTES describe the text 1481 /* Make OUTGOING_INSBYTES describe the text
1482 as it will be inserted in this buffer. */ 1482 as it will be inserted in this buffer. */
1483 1483
1484 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 1484 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
1485 outgoing_insbytes = inschars; 1485 outgoing_insbytes = inschars;
1486 else if (! STRING_MULTIBYTE (new)) 1486 else if (! STRING_MULTIBYTE (new))
1487 outgoing_insbytes 1487 outgoing_insbytes
@@ -1503,7 +1503,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new,
1503 /* Even if we don't record for undo, we must keep the original text 1503 /* Even if we don't record for undo, we must keep the original text
1504 because we may have to recover it because of inappropriate byte 1504 because we may have to recover it because of inappropriate byte
1505 combining. */ 1505 combining. */
1506 if (! EQ (B_ (current_buffer, undo_list), Qt)) 1506 if (! EQ (BVAR (current_buffer, undo_list), Qt))
1507 deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); 1507 deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
1508 1508
1509 GAP_SIZE += nbytes_del; 1509 GAP_SIZE += nbytes_del;
@@ -1530,7 +1530,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new,
1530 between single-byte and multibyte. */ 1530 between single-byte and multibyte. */
1531 copy_text (SDATA (new), GPT_ADDR, insbytes, 1531 copy_text (SDATA (new), GPT_ADDR, insbytes,
1532 STRING_MULTIBYTE (new), 1532 STRING_MULTIBYTE (new),
1533 ! NILP (B_ (current_buffer, enable_multibyte_characters))); 1533 ! NILP (BVAR (current_buffer, enable_multibyte_characters)));
1534 1534
1535#ifdef BYTE_COMBINING_DEBUG 1535#ifdef BYTE_COMBINING_DEBUG
1536 /* We have copied text into the gap, but we have not marked 1536 /* We have copied text into the gap, but we have not marked
@@ -1543,7 +1543,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new,
1543 abort (); 1543 abort ();
1544#endif 1544#endif
1545 1545
1546 if (! EQ (B_ (current_buffer, undo_list), Qt)) 1546 if (! EQ (BVAR (current_buffer, undo_list), Qt))
1547 { 1547 {
1548 /* Record the insertion first, so that when we undo, 1548 /* Record the insertion first, so that when we undo,
1549 the deletion will be undone first. Thus, undo 1549 the deletion will be undone first. Thus, undo
@@ -1886,7 +1886,7 @@ del_range_2 (EMACS_INT from, EMACS_INT from_byte,
1886 abort (); 1886 abort ();
1887#endif 1887#endif
1888 1888
1889 if (ret_string || ! EQ (B_ (current_buffer, undo_list), Qt)) 1889 if (ret_string || ! EQ (BVAR (current_buffer, undo_list), Qt))
1890 deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); 1890 deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
1891 else 1891 else
1892 deletion = Qnil; 1892 deletion = Qnil;
@@ -1897,7 +1897,7 @@ del_range_2 (EMACS_INT from, EMACS_INT from_byte,
1897 so that undo handles this after reinserting the text. */ 1897 so that undo handles this after reinserting the text. */
1898 adjust_markers_for_delete (from, from_byte, to, to_byte); 1898 adjust_markers_for_delete (from, from_byte, to, to_byte);
1899 1899
1900 if (! EQ (B_ (current_buffer, undo_list), Qt)) 1900 if (! EQ (BVAR (current_buffer, undo_list), Qt))
1901 record_delete (from, deletion); 1901 record_delete (from, deletion);
1902 MODIFF++; 1902 MODIFF++;
1903 CHARS_MODIFF = MODIFF; 1903 CHARS_MODIFF = MODIFF;
@@ -1968,7 +1968,7 @@ modify_region (struct buffer *buffer, EMACS_INT start, EMACS_INT end,
1968 if (! preserve_chars_modiff) 1968 if (! preserve_chars_modiff)
1969 CHARS_MODIFF = MODIFF; 1969 CHARS_MODIFF = MODIFF;
1970 1970
1971 B_ (buffer, point_before_scroll) = Qnil; 1971 BVAR (buffer, point_before_scroll) = Qnil;
1972 1972
1973 if (buffer != old_buffer) 1973 if (buffer != old_buffer)
1974 set_buffer_internal (old_buffer); 1974 set_buffer_internal (old_buffer);
@@ -1990,7 +1990,7 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
1990{ 1990{
1991 struct buffer *base_buffer; 1991 struct buffer *base_buffer;
1992 1992
1993 if (!NILP (B_ (current_buffer, read_only))) 1993 if (!NILP (BVAR (current_buffer, read_only)))
1994 Fbarf_if_buffer_read_only (); 1994 Fbarf_if_buffer_read_only ();
1995 1995
1996 /* Let redisplay consider other windows than selected_window 1996 /* Let redisplay consider other windows than selected_window
@@ -2022,32 +2022,32 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
2022 base_buffer = current_buffer; 2022 base_buffer = current_buffer;
2023 2023
2024#ifdef CLASH_DETECTION 2024#ifdef CLASH_DETECTION
2025 if (!NILP (B_ (base_buffer, file_truename)) 2025 if (!NILP (BVAR (base_buffer, file_truename))
2026 /* Make binding buffer-file-name to nil effective. */ 2026 /* Make binding buffer-file-name to nil effective. */
2027 && !NILP (B_ (base_buffer, filename)) 2027 && !NILP (BVAR (base_buffer, filename))
2028 && SAVE_MODIFF >= MODIFF) 2028 && SAVE_MODIFF >= MODIFF)
2029 lock_file (B_ (base_buffer, file_truename)); 2029 lock_file (BVAR (base_buffer, file_truename));
2030#else 2030#else
2031 /* At least warn if this file has changed on disk since it was visited. */ 2031 /* At least warn if this file has changed on disk since it was visited. */
2032 if (!NILP (B_ (base_buffer, filename)) 2032 if (!NILP (BVAR (base_buffer, filename))
2033 && SAVE_MODIFF >= MODIFF 2033 && SAVE_MODIFF >= MODIFF
2034 && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ())) 2034 && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ()))
2035 && !NILP (Ffile_exists_p (B_ (base_buffer, filename)))) 2035 && !NILP (Ffile_exists_p (BVAR (base_buffer, filename))))
2036 call1 (intern ("ask-user-about-supersession-threat"), 2036 call1 (intern ("ask-user-about-supersession-threat"),
2037 B_ (base_buffer,filename)); 2037 BVAR (base_buffer,filename));
2038#endif /* not CLASH_DETECTION */ 2038#endif /* not CLASH_DETECTION */
2039 2039
2040 /* If `select-active-regions' is non-nil, save the region text. */ 2040 /* If `select-active-regions' is non-nil, save the region text. */
2041 if (!NILP (B_ (current_buffer, mark_active)) 2041 if (!NILP (BVAR (current_buffer, mark_active))
2042 && !inhibit_modification_hooks 2042 && !inhibit_modification_hooks
2043 && XMARKER (B_ (current_buffer, mark))->buffer 2043 && XMARKER (BVAR (current_buffer, mark))->buffer
2044 && NILP (Vsaved_region_selection) 2044 && NILP (Vsaved_region_selection)
2045 && (EQ (Vselect_active_regions, Qonly) 2045 && (EQ (Vselect_active_regions, Qonly)
2046 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) 2046 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
2047 : (!NILP (Vselect_active_regions) 2047 : (!NILP (Vselect_active_regions)
2048 && !NILP (Vtransient_mark_mode)))) 2048 && !NILP (Vtransient_mark_mode))))
2049 { 2049 {
2050 EMACS_INT b = XMARKER (B_ (current_buffer, mark))->charpos; 2050 EMACS_INT b = XMARKER (BVAR (current_buffer, mark))->charpos;
2051 EMACS_INT e = PT; 2051 EMACS_INT e = PT;
2052 if (b < e) 2052 if (b < e)
2053 Vsaved_region_selection = make_buffer_string (b, e, 0); 2053 Vsaved_region_selection = make_buffer_string (b, e, 0);
@@ -2290,7 +2290,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
2290 non-nil, and insertion calls a file handler (e.g. through 2290 non-nil, and insertion calls a file handler (e.g. through
2291 lock_file) which scribbles into a temp file -- cyd */ 2291 lock_file) which scribbles into a temp file -- cyd */
2292 if (!BUFFERP (combine_after_change_buffer) 2292 if (!BUFFERP (combine_after_change_buffer)
2293 || NILP (B_ (XBUFFER (combine_after_change_buffer), name))) 2293 || NILP (BVAR (XBUFFER (combine_after_change_buffer), name)))
2294 { 2294 {
2295 combine_after_change_list = Qnil; 2295 combine_after_change_list = Qnil;
2296 return Qnil; 2296 return Qnil;
diff --git a/src/intervals.c b/src/intervals.c
index de5faf6ce75..6aee6e9d7fa 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1978,7 +1978,7 @@ set_point_both (EMACS_INT charpos, EMACS_INT bytepos)
1978 int have_overlays; 1978 int have_overlays;
1979 EMACS_INT original_position; 1979 EMACS_INT original_position;
1980 1980
1981 B_ (current_buffer, point_before_scroll) = Qnil; 1981 BVAR (current_buffer, point_before_scroll) = Qnil;
1982 1982
1983 if (charpos == PT) 1983 if (charpos == PT)
1984 return; 1984 return;
@@ -2342,7 +2342,7 @@ get_local_map (register EMACS_INT position, register struct buffer *buffer,
2342 if (EQ (type, Qkeymap)) 2342 if (EQ (type, Qkeymap))
2343 return Qnil; 2343 return Qnil;
2344 else 2344 else
2345 return B_ (buffer, keymap); 2345 return BVAR (buffer, keymap);
2346} 2346}
2347 2347
2348/* Produce an interval tree reflecting the intervals in 2348/* Produce an interval tree reflecting the intervals in
diff --git a/src/intervals.h b/src/intervals.h
index 3c46c50db79..f6c1c002ce0 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -236,9 +236,9 @@ struct interval
236 and 2 if it is invisible but with an ellipsis. */ 236 and 2 if it is invisible but with an ellipsis. */
237 237
238#define TEXT_PROP_MEANS_INVISIBLE(prop) \ 238#define TEXT_PROP_MEANS_INVISIBLE(prop) \
239 (EQ (B_ (current_buffer, invisibility_spec), Qt) \ 239 (EQ (BVAR (current_buffer, invisibility_spec), Qt) \
240 ? !NILP (prop) \ 240 ? !NILP (prop) \
241 : invisible_p (prop, B_ (current_buffer, invisibility_spec))) 241 : invisible_p (prop, BVAR (current_buffer, invisibility_spec)))
242 242
243/* Declared in alloc.c */ 243/* Declared in alloc.c */
244 244
diff --git a/src/keyboard.c b/src/keyboard.c
index 339d32a838a..e9c6d508fa2 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -461,7 +461,7 @@ echo_char (Lisp_Object c)
461 char *ptr = buffer; 461 char *ptr = buffer;
462 Lisp_Object echo_string; 462 Lisp_Object echo_string;
463 463
464 echo_string = current_kboard->echo_string; 464 echo_string = KVAR (current_kboard, echo_string);
465 465
466 /* If someone has passed us a composite event, use its head symbol. */ 466 /* If someone has passed us a composite event, use its head symbol. */
467 c = EVENT_HEAD (c); 467 c = EVENT_HEAD (c);
@@ -528,7 +528,7 @@ echo_char (Lisp_Object c)
528 else if (STRINGP (echo_string)) 528 else if (STRINGP (echo_string))
529 echo_string = concat2 (echo_string, build_string (" ")); 529 echo_string = concat2 (echo_string, build_string (" "));
530 530
531 current_kboard->echo_string 531 KVAR (current_kboard, echo_string)
532 = concat2 (echo_string, make_string (buffer, ptr - buffer)); 532 = concat2 (echo_string, make_string (buffer, ptr - buffer));
533 533
534 echo_now (); 534 echo_now ();
@@ -542,31 +542,31 @@ void
542echo_dash (void) 542echo_dash (void)
543{ 543{
544 /* Do nothing if not echoing at all. */ 544 /* Do nothing if not echoing at all. */
545 if (NILP (current_kboard->echo_string)) 545 if (NILP (KVAR (current_kboard, echo_string)))
546 return; 546 return;
547 547
548 if (this_command_key_count == 0) 548 if (this_command_key_count == 0)
549 return; 549 return;
550 550
551 if (!current_kboard->immediate_echo 551 if (!current_kboard->immediate_echo
552 && SCHARS (current_kboard->echo_string) == 0) 552 && SCHARS (KVAR (current_kboard, echo_string)) == 0)
553 return; 553 return;
554 554
555 /* Do nothing if we just printed a prompt. */ 555 /* Do nothing if we just printed a prompt. */
556 if (current_kboard->echo_after_prompt 556 if (current_kboard->echo_after_prompt
557 == SCHARS (current_kboard->echo_string)) 557 == SCHARS (KVAR (current_kboard, echo_string)))
558 return; 558 return;
559 559
560 /* Do nothing if we have already put a dash at the end. */ 560 /* Do nothing if we have already put a dash at the end. */
561 if (SCHARS (current_kboard->echo_string) > 1) 561 if (SCHARS (KVAR (current_kboard, echo_string)) > 1)
562 { 562 {
563 Lisp_Object last_char, prev_char, idx; 563 Lisp_Object last_char, prev_char, idx;
564 564
565 idx = make_number (SCHARS (current_kboard->echo_string) - 2); 565 idx = make_number (SCHARS (KVAR (current_kboard, echo_string)) - 2);
566 prev_char = Faref (current_kboard->echo_string, idx); 566 prev_char = Faref (KVAR (current_kboard, echo_string), idx);
567 567
568 idx = make_number (SCHARS (current_kboard->echo_string) - 1); 568 idx = make_number (SCHARS (KVAR (current_kboard, echo_string)) - 1);
569 last_char = Faref (current_kboard->echo_string, idx); 569 last_char = Faref (KVAR (current_kboard, echo_string), idx);
570 570
571 if (XINT (last_char) == '-' && XINT (prev_char) != ' ') 571 if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
572 return; 572 return;
@@ -574,7 +574,7 @@ echo_dash (void)
574 574
575 /* Put a dash at the end of the buffer temporarily, 575 /* Put a dash at the end of the buffer temporarily,
576 but make it go away when the next character is added. */ 576 but make it go away when the next character is added. */
577 current_kboard->echo_string = concat2 (current_kboard->echo_string, 577 KVAR (current_kboard, echo_string) = concat2 (KVAR (current_kboard, echo_string),
578 build_string ("-")); 578 build_string ("-"));
579 echo_now (); 579 echo_now ();
580} 580}
@@ -617,9 +617,9 @@ echo_now (void)
617 } 617 }
618 618
619 echoing = 1; 619 echoing = 1;
620 message3_nolog (current_kboard->echo_string, 620 message3_nolog (KVAR (current_kboard, echo_string),
621 SBYTES (current_kboard->echo_string), 621 SBYTES (KVAR (current_kboard, echo_string)),
622 STRING_MULTIBYTE (current_kboard->echo_string)); 622 STRING_MULTIBYTE (KVAR (current_kboard, echo_string)));
623 echoing = 0; 623 echoing = 0;
624 624
625 /* Record in what buffer we echoed, and from which kboard. */ 625 /* Record in what buffer we echoed, and from which kboard. */
@@ -637,7 +637,7 @@ cancel_echoing (void)
637{ 637{
638 current_kboard->immediate_echo = 0; 638 current_kboard->immediate_echo = 0;
639 current_kboard->echo_after_prompt = -1; 639 current_kboard->echo_after_prompt = -1;
640 current_kboard->echo_string = Qnil; 640 KVAR (current_kboard, echo_string) = Qnil;
641 ok_to_echo_at_next_pause = NULL; 641 ok_to_echo_at_next_pause = NULL;
642 echo_kboard = NULL; 642 echo_kboard = NULL;
643 echo_message_buffer = Qnil; 643 echo_message_buffer = Qnil;
@@ -648,8 +648,8 @@ cancel_echoing (void)
648static int 648static int
649echo_length (void) 649echo_length (void)
650{ 650{
651 return (STRINGP (current_kboard->echo_string) 651 return (STRINGP (KVAR (current_kboard, echo_string))
652 ? SCHARS (current_kboard->echo_string) 652 ? SCHARS (KVAR (current_kboard, echo_string))
653 : 0); 653 : 0);
654} 654}
655 655
@@ -660,9 +660,9 @@ echo_length (void)
660static void 660static void
661echo_truncate (EMACS_INT nchars) 661echo_truncate (EMACS_INT nchars)
662{ 662{
663 if (STRINGP (current_kboard->echo_string)) 663 if (STRINGP (KVAR (current_kboard, echo_string)))
664 current_kboard->echo_string 664 KVAR (current_kboard, echo_string)
665 = Fsubstring (current_kboard->echo_string, 665 = Fsubstring (KVAR (current_kboard, echo_string),
666 make_number (0), make_number (nchars)); 666 make_number (0), make_number (nchars));
667 truncate_echo_area (nchars); 667 truncate_echo_area (nchars);
668} 668}
@@ -993,8 +993,8 @@ cmd_error (Lisp_Object data)
993 Vstandard_input = Qt; 993 Vstandard_input = Qt;
994 Vexecuting_kbd_macro = Qnil; 994 Vexecuting_kbd_macro = Qnil;
995 executing_kbd_macro = Qnil; 995 executing_kbd_macro = Qnil;
996 current_kboard->Vprefix_arg = Qnil; 996 KVAR (current_kboard, Vprefix_arg) = Qnil;
997 current_kboard->Vlast_prefix_arg = Qnil; 997 KVAR (current_kboard, Vlast_prefix_arg) = Qnil;
998 cancel_echoing (); 998 cancel_echoing ();
999 999
1000 /* Avoid unquittable loop if data contains a circular list. */ 1000 /* Avoid unquittable loop if data contains a circular list. */
@@ -1302,8 +1302,8 @@ command_loop_1 (void)
1302#endif 1302#endif
1303 int already_adjusted = 0; 1303 int already_adjusted = 0;
1304 1304
1305 current_kboard->Vprefix_arg = Qnil; 1305 KVAR (current_kboard, Vprefix_arg) = Qnil;
1306 current_kboard->Vlast_prefix_arg = Qnil; 1306 KVAR (current_kboard, Vlast_prefix_arg) = Qnil;
1307 Vdeactivate_mark = Qnil; 1307 Vdeactivate_mark = Qnil;
1308 waiting_for_input = 0; 1308 waiting_for_input = 0;
1309 cancel_echoing (); 1309 cancel_echoing ();
@@ -1331,10 +1331,10 @@ command_loop_1 (void)
1331 } 1331 }
1332 1332
1333 /* Do this after running Vpost_command_hook, for consistency. */ 1333 /* Do this after running Vpost_command_hook, for consistency. */
1334 current_kboard->Vlast_command = Vthis_command; 1334 KVAR (current_kboard, Vlast_command) = Vthis_command;
1335 current_kboard->Vreal_last_command = real_this_command; 1335 KVAR (current_kboard, Vreal_last_command) = real_this_command;
1336 if (!CONSP (last_command_event)) 1336 if (!CONSP (last_command_event))
1337 current_kboard->Vlast_repeatable_command = real_this_command; 1337 KVAR (current_kboard, Vlast_repeatable_command) = real_this_command;
1338 1338
1339 while (1) 1339 while (1)
1340 { 1340 {
@@ -1504,9 +1504,9 @@ command_loop_1 (void)
1504 keys = Fkey_description (keys, Qnil); 1504 keys = Fkey_description (keys, Qnil);
1505 bitch_at_user (); 1505 bitch_at_user ();
1506 message_with_string ("%s is undefined", keys, 0); 1506 message_with_string ("%s is undefined", keys, 0);
1507 current_kboard->defining_kbd_macro = Qnil; 1507 KVAR (current_kboard, defining_kbd_macro) = Qnil;
1508 update_mode_lines = 1; 1508 update_mode_lines = 1;
1509 current_kboard->Vprefix_arg = Qnil; 1509 KVAR (current_kboard, Vprefix_arg) = Qnil;
1510 } 1510 }
1511 else 1511 else
1512 { 1512 {
@@ -1523,7 +1523,7 @@ command_loop_1 (void)
1523 } 1523 }
1524#endif 1524#endif
1525 1525
1526 if (NILP (current_kboard->Vprefix_arg)) /* FIXME: Why? --Stef */ 1526 if (NILP (KVAR (current_kboard, Vprefix_arg))) /* FIXME: Why? --Stef */
1527 Fundo_boundary (); 1527 Fundo_boundary ();
1528 Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil); 1528 Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
1529 1529
@@ -1537,7 +1537,7 @@ command_loop_1 (void)
1537 unbind_to (scount, Qnil); 1537 unbind_to (scount, Qnil);
1538#endif 1538#endif
1539 } 1539 }
1540 current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg; 1540 KVAR (current_kboard, Vlast_prefix_arg) = Vcurrent_prefix_arg;
1541 1541
1542 /* Note that the value cell will never directly contain nil 1542 /* Note that the value cell will never directly contain nil
1543 if the symbol is a local variable. */ 1543 if the symbol is a local variable. */
@@ -1565,19 +1565,19 @@ command_loop_1 (void)
1565 If the command didn't actually create a prefix arg, 1565 If the command didn't actually create a prefix arg,
1566 but is merely a frame event that is transparent to prefix args, 1566 but is merely a frame event that is transparent to prefix args,
1567 then the above doesn't apply. */ 1567 then the above doesn't apply. */
1568 if (NILP (current_kboard->Vprefix_arg) || CONSP (last_command_event)) 1568 if (NILP (KVAR (current_kboard, Vprefix_arg)) || CONSP (last_command_event))
1569 { 1569 {
1570 current_kboard->Vlast_command = Vthis_command; 1570 KVAR (current_kboard, Vlast_command) = Vthis_command;
1571 current_kboard->Vreal_last_command = real_this_command; 1571 KVAR (current_kboard, Vreal_last_command) = real_this_command;
1572 if (!CONSP (last_command_event)) 1572 if (!CONSP (last_command_event))
1573 current_kboard->Vlast_repeatable_command = real_this_command; 1573 KVAR (current_kboard, Vlast_repeatable_command) = real_this_command;
1574 cancel_echoing (); 1574 cancel_echoing ();
1575 this_command_key_count = 0; 1575 this_command_key_count = 0;
1576 this_command_key_count_reset = 0; 1576 this_command_key_count_reset = 0;
1577 this_single_command_key_start = 0; 1577 this_single_command_key_start = 0;
1578 } 1578 }
1579 1579
1580 if (!NILP (B_ (current_buffer, mark_active)) 1580 if (!NILP (BVAR (current_buffer, mark_active))
1581 && !NILP (Vrun_hooks)) 1581 && !NILP (Vrun_hooks))
1582 { 1582 {
1583 /* In Emacs 22, setting transient-mark-mode to `only' was a 1583 /* In Emacs 22, setting transient-mark-mode to `only' was a
@@ -1599,7 +1599,7 @@ command_loop_1 (void)
1599 if (!NILP (Fwindow_system (Qnil)) 1599 if (!NILP (Fwindow_system (Qnil))
1600 /* Even if mark_active is non-nil, the actual buffer 1600 /* Even if mark_active is non-nil, the actual buffer
1601 marker may not have been set yet (Bug#7044). */ 1601 marker may not have been set yet (Bug#7044). */
1602 && XMARKER (B_ (current_buffer, mark))->buffer 1602 && XMARKER (BVAR (current_buffer, mark))->buffer
1603 && (EQ (Vselect_active_regions, Qonly) 1603 && (EQ (Vselect_active_regions, Qonly)
1604 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) 1604 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
1605 : (!NILP (Vselect_active_regions) 1605 : (!NILP (Vselect_active_regions)
@@ -1607,7 +1607,7 @@ command_loop_1 (void)
1607 && !EQ (Vthis_command, Qhandle_switch_frame)) 1607 && !EQ (Vthis_command, Qhandle_switch_frame))
1608 { 1608 {
1609 EMACS_INT beg = 1609 EMACS_INT beg =
1610 XINT (Fmarker_position (B_ (current_buffer, mark))); 1610 XINT (Fmarker_position (BVAR (current_buffer, mark)));
1611 EMACS_INT end = PT; 1611 EMACS_INT end = PT;
1612 if (beg < end) 1612 if (beg < end)
1613 call2 (Qx_set_selection, QPRIMARY, 1613 call2 (Qx_set_selection, QPRIMARY,
@@ -1649,8 +1649,8 @@ command_loop_1 (void)
1649 1649
1650 /* Install chars successfully executed in kbd macro. */ 1650 /* Install chars successfully executed in kbd macro. */
1651 1651
1652 if (!NILP (current_kboard->defining_kbd_macro) 1652 if (!NILP (KVAR (current_kboard, defining_kbd_macro))
1653 && NILP (current_kboard->Vprefix_arg)) 1653 && NILP (KVAR (current_kboard, Vprefix_arg)))
1654 finalize_kbd_macro_chars (); 1654 finalize_kbd_macro_chars ();
1655#if 0 /* This shouldn't be necessary anymore. --lorentey */ 1655#if 0 /* This shouldn't be necessary anymore. --lorentey */
1656 if (!was_locked) 1656 if (!was_locked)
@@ -2461,7 +2461,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2461 KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame)); 2461 KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame));
2462 if (kb != current_kboard) 2462 if (kb != current_kboard)
2463 { 2463 {
2464 Lisp_Object link = kb->kbd_queue; 2464 Lisp_Object link = KVAR (kb, kbd_queue);
2465 /* We shouldn't get here if we were in single-kboard mode! */ 2465 /* We shouldn't get here if we were in single-kboard mode! */
2466 if (single_kboard) 2466 if (single_kboard)
2467 abort (); 2467 abort ();
@@ -2473,7 +2473,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2473 abort (); 2473 abort ();
2474 } 2474 }
2475 if (!CONSP (link)) 2475 if (!CONSP (link))
2476 kb->kbd_queue = Fcons (c, Qnil); 2476 KVAR (kb, kbd_queue) = Fcons (c, Qnil);
2477 else 2477 else
2478 XSETCDR (link, Fcons (c, Qnil)); 2478 XSETCDR (link, Fcons (c, Qnil));
2479 kb->kbd_queue_has_data = 1; 2479 kb->kbd_queue_has_data = 1;
@@ -2645,12 +2645,12 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2645 { 2645 {
2646 if (current_kboard->kbd_queue_has_data) 2646 if (current_kboard->kbd_queue_has_data)
2647 { 2647 {
2648 if (!CONSP (current_kboard->kbd_queue)) 2648 if (!CONSP (KVAR (current_kboard, kbd_queue)))
2649 abort (); 2649 abort ();
2650 c = XCAR (current_kboard->kbd_queue); 2650 c = XCAR (KVAR (current_kboard, kbd_queue));
2651 current_kboard->kbd_queue 2651 KVAR (current_kboard, kbd_queue)
2652 = XCDR (current_kboard->kbd_queue); 2652 = XCDR (KVAR (current_kboard, kbd_queue));
2653 if (NILP (current_kboard->kbd_queue)) 2653 if (NILP (KVAR (current_kboard, kbd_queue)))
2654 current_kboard->kbd_queue_has_data = 0; 2654 current_kboard->kbd_queue_has_data = 0;
2655 input_pending = readable_events (0); 2655 input_pending = readable_events (0);
2656 if (EVENT_HAS_PARAMETERS (c) 2656 if (EVENT_HAS_PARAMETERS (c)
@@ -2712,7 +2712,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2712 2712
2713 if (! NILP (c) && (kb != current_kboard)) 2713 if (! NILP (c) && (kb != current_kboard))
2714 { 2714 {
2715 Lisp_Object link = kb->kbd_queue; 2715 Lisp_Object link = KVAR (kb, kbd_queue);
2716 if (CONSP (link)) 2716 if (CONSP (link))
2717 { 2717 {
2718 while (CONSP (XCDR (link))) 2718 while (CONSP (XCDR (link)))
@@ -2721,7 +2721,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2721 abort (); 2721 abort ();
2722 } 2722 }
2723 if (!CONSP (link)) 2723 if (!CONSP (link))
2724 kb->kbd_queue = Fcons (c, Qnil); 2724 KVAR (kb, kbd_queue) = Fcons (c, Qnil);
2725 else 2725 else
2726 XSETCDR (link, Fcons (c, Qnil)); 2726 XSETCDR (link, Fcons (c, Qnil));
2727 kb->kbd_queue_has_data = 1; 2727 kb->kbd_queue_has_data = 1;
@@ -2829,15 +2829,15 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2829 if (XINT (c) == -1) 2829 if (XINT (c) == -1)
2830 goto exit; 2830 goto exit;
2831 2831
2832 if ((STRINGP (current_kboard->Vkeyboard_translate_table) 2832 if ((STRINGP (KVAR (current_kboard, Vkeyboard_translate_table))
2833 && SCHARS (current_kboard->Vkeyboard_translate_table) > (unsigned) XFASTINT (c)) 2833 && SCHARS (KVAR (current_kboard, Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
2834 || (VECTORP (current_kboard->Vkeyboard_translate_table) 2834 || (VECTORP (KVAR (current_kboard, Vkeyboard_translate_table))
2835 && XVECTOR (current_kboard->Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) 2835 && XVECTOR (KVAR (current_kboard, Vkeyboard_translate_table))->size > (unsigned) XFASTINT (c))
2836 || (CHAR_TABLE_P (current_kboard->Vkeyboard_translate_table) 2836 || (CHAR_TABLE_P (KVAR (current_kboard, Vkeyboard_translate_table))
2837 && CHARACTERP (c))) 2837 && CHARACTERP (c)))
2838 { 2838 {
2839 Lisp_Object d; 2839 Lisp_Object d;
2840 d = Faref (current_kboard->Vkeyboard_translate_table, c); 2840 d = Faref (KVAR (current_kboard, Vkeyboard_translate_table), c);
2841 /* nil in keyboard-translate-table means no translation. */ 2841 /* nil in keyboard-translate-table means no translation. */
2842 if (!NILP (d)) 2842 if (!NILP (d))
2843 c = d; 2843 c = d;
@@ -2918,7 +2918,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2918 /* Save the echo status. */ 2918 /* Save the echo status. */
2919 int saved_immediate_echo = current_kboard->immediate_echo; 2919 int saved_immediate_echo = current_kboard->immediate_echo;
2920 struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause; 2920 struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause;
2921 Lisp_Object saved_echo_string = current_kboard->echo_string; 2921 Lisp_Object saved_echo_string = KVAR (current_kboard, echo_string);
2922 int saved_echo_after_prompt = current_kboard->echo_after_prompt; 2922 int saved_echo_after_prompt = current_kboard->echo_after_prompt;
2923 2923
2924#if 0 2924#if 0
@@ -2973,7 +2973,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2973 2973
2974 cancel_echoing (); 2974 cancel_echoing ();
2975 ok_to_echo_at_next_pause = saved_ok_to_echo; 2975 ok_to_echo_at_next_pause = saved_ok_to_echo;
2976 current_kboard->echo_string = saved_echo_string; 2976 KVAR (current_kboard, echo_string) = saved_echo_string;
2977 current_kboard->echo_after_prompt = saved_echo_after_prompt; 2977 current_kboard->echo_after_prompt = saved_echo_after_prompt;
2978 if (saved_immediate_echo) 2978 if (saved_immediate_echo)
2979 echo_now (); 2979 echo_now ();
@@ -3459,7 +3459,7 @@ kbd_buffer_store_event_hold (register struct input_event *event,
3459 3459
3460 if (single_kboard && kb != current_kboard) 3460 if (single_kboard && kb != current_kboard)
3461 { 3461 {
3462 kb->kbd_queue 3462 KVAR (kb, kbd_queue)
3463 = Fcons (make_lispy_switch_frame (event->frame_or_window), 3463 = Fcons (make_lispy_switch_frame (event->frame_or_window),
3464 Fcons (make_number (c), Qnil)); 3464 Fcons (make_number (c), Qnil));
3465 kb->kbd_queue_has_data = 1; 3465 kb->kbd_queue_has_data = 1;
@@ -5322,13 +5322,13 @@ make_lispy_event (struct input_event *event)
5322 { 5322 {
5323 /* We need to use an alist rather than a vector as the cache 5323 /* We need to use an alist rather than a vector as the cache
5324 since we can't make a vector long enuf. */ 5324 since we can't make a vector long enuf. */
5325 if (NILP (current_kboard->system_key_syms)) 5325 if (NILP (KVAR (current_kboard, system_key_syms)))
5326 current_kboard->system_key_syms = Fcons (Qnil, Qnil); 5326 KVAR (current_kboard, system_key_syms) = Fcons (Qnil, Qnil);
5327 return modify_event_symbol (event->code, 5327 return modify_event_symbol (event->code,
5328 event->modifiers, 5328 event->modifiers,
5329 Qfunction_key, 5329 Qfunction_key,
5330 current_kboard->Vsystem_key_alist, 5330 KVAR (current_kboard, Vsystem_key_alist),
5331 0, &current_kboard->system_key_syms, 5331 0, &KVAR (current_kboard, system_key_syms),
5332 (unsigned) -1); 5332 (unsigned) -1);
5333 } 5333 }
5334 5334
@@ -7360,8 +7360,8 @@ menu_bar_items (Lisp_Object old)
7360 /* Yes, use them (if non-nil) as well as the global map. */ 7360 /* Yes, use them (if non-nil) as well as the global map. */
7361 maps = (Lisp_Object *) alloca (3 * sizeof (maps[0])); 7361 maps = (Lisp_Object *) alloca (3 * sizeof (maps[0]));
7362 nmaps = 0; 7362 nmaps = 0;
7363 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 7363 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
7364 maps[nmaps++] = current_kboard->Voverriding_terminal_local_map; 7364 maps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
7365 if (!NILP (Voverriding_local_map)) 7365 if (!NILP (Voverriding_local_map))
7366 maps[nmaps++] = Voverriding_local_map; 7366 maps[nmaps++] = Voverriding_local_map;
7367 } 7367 }
@@ -7897,8 +7897,8 @@ tool_bar_items (Lisp_Object reuse, int *nitems)
7897 /* Yes, use them (if non-nil) as well as the global map. */ 7897 /* Yes, use them (if non-nil) as well as the global map. */
7898 maps = (Lisp_Object *) alloca (3 * sizeof (maps[0])); 7898 maps = (Lisp_Object *) alloca (3 * sizeof (maps[0]));
7899 nmaps = 0; 7899 nmaps = 0;
7900 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 7900 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
7901 maps[nmaps++] = current_kboard->Voverriding_terminal_local_map; 7901 maps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
7902 if (!NILP (Voverriding_local_map)) 7902 if (!NILP (Voverriding_local_map))
7903 maps[nmaps++] = Voverriding_local_map; 7903 maps[nmaps++] = Voverriding_local_map;
7904 } 7904 }
@@ -8608,18 +8608,18 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
8608 8608
8609 /* Prompt with that and read response. */ 8609 /* Prompt with that and read response. */
8610 message2_nolog (menu, strlen (menu), 8610 message2_nolog (menu, strlen (menu),
8611 ! NILP (B_ (current_buffer, enable_multibyte_characters))); 8611 ! NILP (BVAR (current_buffer, enable_multibyte_characters)));
8612 8612
8613 /* Make believe its not a keyboard macro in case the help char 8613 /* Make believe its not a keyboard macro in case the help char
8614 is pressed. Help characters are not recorded because menu prompting 8614 is pressed. Help characters are not recorded because menu prompting
8615 is not used on replay. 8615 is not used on replay.
8616 */ 8616 */
8617 orig_defn_macro = current_kboard->defining_kbd_macro; 8617 orig_defn_macro = KVAR (current_kboard, defining_kbd_macro);
8618 current_kboard->defining_kbd_macro = Qnil; 8618 KVAR (current_kboard, defining_kbd_macro) = Qnil;
8619 do 8619 do
8620 obj = read_char (commandflag, 0, 0, Qt, 0, NULL); 8620 obj = read_char (commandflag, 0, 0, Qt, 0, NULL);
8621 while (BUFFERP (obj)); 8621 while (BUFFERP (obj));
8622 current_kboard->defining_kbd_macro = orig_defn_macro; 8622 KVAR (current_kboard, defining_kbd_macro) = orig_defn_macro;
8623 8623
8624 if (!INTEGERP (obj)) 8624 if (!INTEGERP (obj))
8625 return obj; 8625 return obj;
@@ -8632,7 +8632,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
8632 && (!INTEGERP (menu_prompt_more_char) 8632 && (!INTEGERP (menu_prompt_more_char)
8633 || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char)))))) 8633 || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char))))))
8634 { 8634 {
8635 if (!NILP (current_kboard->defining_kbd_macro)) 8635 if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
8636 store_kbd_macro_char (obj); 8636 store_kbd_macro_char (obj);
8637 return obj; 8637 return obj;
8638 } 8638 }
@@ -8974,7 +8974,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
8974 /* Install the string STR as the beginning of the string of 8974 /* Install the string STR as the beginning of the string of
8975 echoing, so that it serves as a prompt for the next 8975 echoing, so that it serves as a prompt for the next
8976 character. */ 8976 character. */
8977 current_kboard->echo_string = prompt; 8977 KVAR (current_kboard, echo_string) = prompt;
8978 current_kboard->echo_after_prompt = SCHARS (prompt); 8978 current_kboard->echo_after_prompt = SCHARS (prompt);
8979 echo_now (); 8979 echo_now ();
8980 } 8980 }
@@ -9012,8 +9012,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9012 happens if we switch keyboards between rescans. */ 9012 happens if we switch keyboards between rescans. */
9013 replay_entire_sequence: 9013 replay_entire_sequence:
9014 9014
9015 indec.map = indec.parent = current_kboard->Vinput_decode_map; 9015 indec.map = indec.parent = KVAR (current_kboard, Vinput_decode_map);
9016 fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; 9016 fkey.map = fkey.parent = KVAR (current_kboard, Vlocal_function_key_map);
9017 keytran.map = keytran.parent = Vkey_translation_map; 9017 keytran.map = keytran.parent = Vkey_translation_map;
9018 indec.start = indec.end = 0; 9018 indec.start = indec.end = 0;
9019 fkey.start = fkey.end = 0; 9019 fkey.start = fkey.end = 0;
@@ -9034,7 +9034,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9034 the initial keymaps from the current buffer. */ 9034 the initial keymaps from the current buffer. */
9035 nmaps = 0; 9035 nmaps = 0;
9036 9036
9037 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 9037 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
9038 { 9038 {
9039 if (2 > nmaps_allocated) 9039 if (2 > nmaps_allocated)
9040 { 9040 {
@@ -9042,7 +9042,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9042 defs = (Lisp_Object *) alloca (2 * sizeof (defs[0])); 9042 defs = (Lisp_Object *) alloca (2 * sizeof (defs[0]));
9043 nmaps_allocated = 2; 9043 nmaps_allocated = 2;
9044 } 9044 }
9045 submaps[nmaps++] = current_kboard->Voverriding_terminal_local_map; 9045 submaps[nmaps++] = KVAR (current_kboard, Voverriding_terminal_local_map);
9046 } 9046 }
9047 else if (!NILP (Voverriding_local_map)) 9047 else if (!NILP (Voverriding_local_map))
9048 { 9048 {
@@ -9218,29 +9218,29 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9218 9218
9219 if (!NILP (delayed_switch_frame)) 9219 if (!NILP (delayed_switch_frame))
9220 { 9220 {
9221 interrupted_kboard->kbd_queue 9221 KVAR (interrupted_kboard, kbd_queue)
9222 = Fcons (delayed_switch_frame, 9222 = Fcons (delayed_switch_frame,
9223 interrupted_kboard->kbd_queue); 9223 KVAR (interrupted_kboard, kbd_queue));
9224 delayed_switch_frame = Qnil; 9224 delayed_switch_frame = Qnil;
9225 } 9225 }
9226 9226
9227 while (t > 0) 9227 while (t > 0)
9228 interrupted_kboard->kbd_queue 9228 KVAR (interrupted_kboard, kbd_queue)
9229 = Fcons (keybuf[--t], interrupted_kboard->kbd_queue); 9229 = Fcons (keybuf[--t], KVAR (interrupted_kboard, kbd_queue));
9230 9230
9231 /* If the side queue is non-empty, ensure it begins with a 9231 /* If the side queue is non-empty, ensure it begins with a
9232 switch-frame, so we'll replay it in the right context. */ 9232 switch-frame, so we'll replay it in the right context. */
9233 if (CONSP (interrupted_kboard->kbd_queue) 9233 if (CONSP (KVAR (interrupted_kboard, kbd_queue))
9234 && (key = XCAR (interrupted_kboard->kbd_queue), 9234 && (key = XCAR (KVAR (interrupted_kboard, kbd_queue)),
9235 !(EVENT_HAS_PARAMETERS (key) 9235 !(EVENT_HAS_PARAMETERS (key)
9236 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (key)), 9236 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (key)),
9237 Qswitch_frame)))) 9237 Qswitch_frame))))
9238 { 9238 {
9239 Lisp_Object frame; 9239 Lisp_Object frame;
9240 XSETFRAME (frame, interrupted_frame); 9240 XSETFRAME (frame, interrupted_frame);
9241 interrupted_kboard->kbd_queue 9241 KVAR (interrupted_kboard, kbd_queue)
9242 = Fcons (make_lispy_switch_frame (frame), 9242 = Fcons (make_lispy_switch_frame (frame),
9243 interrupted_kboard->kbd_queue); 9243 KVAR (interrupted_kboard, kbd_queue));
9244 } 9244 }
9245 mock_input = 0; 9245 mock_input = 0;
9246 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); 9246 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
@@ -9870,7 +9870,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9870 /* Treat uppercase keys as shifted. */ 9870 /* Treat uppercase keys as shifted. */
9871 || (INTEGERP (key) 9871 || (INTEGERP (key)
9872 && (KEY_TO_CHAR (key) 9872 && (KEY_TO_CHAR (key)
9873 < XCHAR_TABLE (B_ (current_buffer, downcase_table))->size) 9873 < XCHAR_TABLE (BVAR (current_buffer, downcase_table))->size)
9874 && UPPERCASEP (KEY_TO_CHAR (key)))) 9874 && UPPERCASEP (KEY_TO_CHAR (key))))
9875 { 9875 {
9876 Lisp_Object new_key 9876 Lisp_Object new_key
@@ -10115,9 +10115,9 @@ a special event, so ignore the prefix argument and don't clear it. */)
10115 10115
10116 if (NILP (special)) 10116 if (NILP (special))
10117 { 10117 {
10118 prefixarg = current_kboard->Vprefix_arg; 10118 prefixarg = KVAR (current_kboard, Vprefix_arg);
10119 Vcurrent_prefix_arg = prefixarg; 10119 Vcurrent_prefix_arg = prefixarg;
10120 current_kboard->Vprefix_arg = Qnil; 10120 KVAR (current_kboard, Vprefix_arg) = Qnil;
10121 } 10121 }
10122 else 10122 else
10123 prefixarg = Qnil; 10123 prefixarg = Qnil;
@@ -10251,7 +10251,7 @@ give to the command you invoke, if it asks for an argument. */)
10251 UNGCPRO; 10251 UNGCPRO;
10252 10252
10253 function = Fintern (function, Qnil); 10253 function = Fintern (function, Qnil);
10254 current_kboard->Vprefix_arg = prefixarg; 10254 KVAR (current_kboard, Vprefix_arg) = prefixarg;
10255 Vthis_command = function; 10255 Vthis_command = function;
10256 real_this_command = function; 10256 real_this_command = function;
10257 10257
@@ -10574,7 +10574,7 @@ DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0,
10574Also end any kbd macro being defined. */) 10574Also end any kbd macro being defined. */)
10575 (void) 10575 (void)
10576{ 10576{
10577 if (!NILP (current_kboard->defining_kbd_macro)) 10577 if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
10578 { 10578 {
10579 /* Discard the last command from the macro. */ 10579 /* Discard the last command from the macro. */
10580 Fcancel_kbd_macro_events (); 10580 Fcancel_kbd_macro_events ();
@@ -11224,30 +11224,30 @@ The `posn-' functions access elements of such lists. */)
11224void 11224void
11225init_kboard (KBOARD *kb) 11225init_kboard (KBOARD *kb)
11226{ 11226{
11227 kb->Voverriding_terminal_local_map = Qnil; 11227 KVAR (kb, Voverriding_terminal_local_map) = Qnil;
11228 kb->Vlast_command = Qnil; 11228 KVAR (kb, Vlast_command) = Qnil;
11229 kb->Vreal_last_command = Qnil; 11229 KVAR (kb, Vreal_last_command) = Qnil;
11230 kb->Vkeyboard_translate_table = Qnil; 11230 KVAR (kb, Vkeyboard_translate_table) = Qnil;
11231 kb->Vlast_repeatable_command = Qnil; 11231 KVAR (kb, Vlast_repeatable_command) = Qnil;
11232 kb->Vprefix_arg = Qnil; 11232 KVAR (kb, Vprefix_arg) = Qnil;
11233 kb->Vlast_prefix_arg = Qnil; 11233 KVAR (kb, Vlast_prefix_arg) = Qnil;
11234 kb->kbd_queue = Qnil; 11234 KVAR (kb, kbd_queue) = Qnil;
11235 kb->kbd_queue_has_data = 0; 11235 kb->kbd_queue_has_data = 0;
11236 kb->immediate_echo = 0; 11236 kb->immediate_echo = 0;
11237 kb->echo_string = Qnil; 11237 KVAR (kb, echo_string) = Qnil;
11238 kb->echo_after_prompt = -1; 11238 kb->echo_after_prompt = -1;
11239 kb->kbd_macro_buffer = 0; 11239 kb->kbd_macro_buffer = 0;
11240 kb->kbd_macro_bufsize = 0; 11240 kb->kbd_macro_bufsize = 0;
11241 kb->defining_kbd_macro = Qnil; 11241 KVAR (kb, defining_kbd_macro) = Qnil;
11242 kb->Vlast_kbd_macro = Qnil; 11242 KVAR (kb, Vlast_kbd_macro) = Qnil;
11243 kb->reference_count = 0; 11243 kb->reference_count = 0;
11244 kb->Vsystem_key_alist = Qnil; 11244 KVAR (kb, Vsystem_key_alist) = Qnil;
11245 kb->system_key_syms = Qnil; 11245 KVAR (kb, system_key_syms) = Qnil;
11246 kb->Vwindow_system = Qt; /* Unset. */ 11246 KVAR (kb, Vwindow_system) = Qt; /* Unset. */
11247 kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil); 11247 KVAR (kb, Vinput_decode_map) = Fmake_sparse_keymap (Qnil);
11248 kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil); 11248 KVAR (kb, Vlocal_function_key_map) = Fmake_sparse_keymap (Qnil);
11249 Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map); 11249 Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map);
11250 kb->Vdefault_minibuffer_frame = Qnil; 11250 KVAR (kb, Vdefault_minibuffer_frame) = Qnil;
11251} 11251}
11252 11252
11253/* 11253/*
@@ -11323,7 +11323,7 @@ init_keyboard (void)
11323 init_kboard (current_kboard); 11323 init_kboard (current_kboard);
11324 /* A value of nil for Vwindow_system normally means a tty, but we also use 11324 /* A value of nil for Vwindow_system normally means a tty, but we also use
11325 it for the initial terminal since there is no window system there. */ 11325 it for the initial terminal since there is no window system there. */
11326 current_kboard->Vwindow_system = Qnil; 11326 KVAR (current_kboard, Vwindow_system) = Qnil;
11327 11327
11328 if (!noninteractive) 11328 if (!noninteractive)
11329 { 11329 {
@@ -12266,23 +12266,23 @@ mark_kboards (void)
12266 if (kb->kbd_macro_buffer) 12266 if (kb->kbd_macro_buffer)
12267 for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++) 12267 for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++)
12268 mark_object (*p); 12268 mark_object (*p);
12269 mark_object (kb->Voverriding_terminal_local_map); 12269 mark_object (KVAR (kb, Voverriding_terminal_local_map));
12270 mark_object (kb->Vlast_command); 12270 mark_object (KVAR (kb, Vlast_command));
12271 mark_object (kb->Vreal_last_command); 12271 mark_object (KVAR (kb, Vreal_last_command));
12272 mark_object (kb->Vkeyboard_translate_table); 12272 mark_object (KVAR (kb, Vkeyboard_translate_table));
12273 mark_object (kb->Vlast_repeatable_command); 12273 mark_object (KVAR (kb, Vlast_repeatable_command));
12274 mark_object (kb->Vprefix_arg); 12274 mark_object (KVAR (kb, Vprefix_arg));
12275 mark_object (kb->Vlast_prefix_arg); 12275 mark_object (KVAR (kb, Vlast_prefix_arg));
12276 mark_object (kb->kbd_queue); 12276 mark_object (KVAR (kb, kbd_queue));
12277 mark_object (kb->defining_kbd_macro); 12277 mark_object (KVAR (kb, defining_kbd_macro));
12278 mark_object (kb->Vlast_kbd_macro); 12278 mark_object (KVAR (kb, Vlast_kbd_macro));
12279 mark_object (kb->Vsystem_key_alist); 12279 mark_object (KVAR (kb, Vsystem_key_alist));
12280 mark_object (kb->system_key_syms); 12280 mark_object (KVAR (kb, system_key_syms));
12281 mark_object (kb->Vwindow_system); 12281 mark_object (KVAR (kb, Vwindow_system));
12282 mark_object (kb->Vinput_decode_map); 12282 mark_object (KVAR (kb, Vinput_decode_map));
12283 mark_object (kb->Vlocal_function_key_map); 12283 mark_object (KVAR (kb, Vlocal_function_key_map));
12284 mark_object (kb->Vdefault_minibuffer_frame); 12284 mark_object (KVAR (kb, Vdefault_minibuffer_frame));
12285 mark_object (kb->echo_string); 12285 mark_object (KVAR (kb, echo_string));
12286 } 12286 }
12287 { 12287 {
12288 struct input_event *event; 12288 struct input_event *event;
diff --git a/src/keyboard.h b/src/keyboard.h
index 7b3374ac3bd..10bf16d5c5c 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -19,6 +19,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#include "systime.h" /* for EMACS_TIME */ 19#include "systime.h" /* for EMACS_TIME */
20#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */ 20#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */
21 21
22/* Lisp fields in struct keyboard are hidden from most code and accessed
23 via the KVAR macro, below. Only select pieces of code, like the GC,
24 are allowed to use KBOARD_INTERNAL_FIELD. */
25#define KBOARD_INTERNAL_FIELD(field) field ## _
26
27/* Most code should use this macro to access Lisp fields in struct
28 kboard. */
29#define KVAR(kboard, field) ((kboard)->KBOARD_INTERNAL_FIELD (field))
30
22/* Each KBOARD represents one logical input stream from which Emacs 31/* Each KBOARD represents one logical input stream from which Emacs
23 gets input. If we are using ordinary terminals, it has one KBOARD 32 gets input. If we are using ordinary terminals, it has one KBOARD
24 object for each terminal device. 33 object for each terminal device.
@@ -70,32 +79,32 @@ struct kboard
70 can effectively wait for input in the any-kboard state, and hence 79 can effectively wait for input in the any-kboard state, and hence
71 avoid blocking out the other KBOARDs. See universal-argument in 80 avoid blocking out the other KBOARDs. See universal-argument in
72 lisp/simple.el for an example. */ 81 lisp/simple.el for an example. */
73 Lisp_Object Voverriding_terminal_local_map; 82 Lisp_Object KBOARD_INTERNAL_FIELD (Voverriding_terminal_local_map);
74 83
75 /* Last command executed by the editor command loop, not counting 84 /* Last command executed by the editor command loop, not counting
76 commands that set the prefix argument. */ 85 commands that set the prefix argument. */
77 Lisp_Object Vlast_command; 86 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_command);
78 87
79 /* Normally same as last-command, but never modified by other commands. */ 88 /* Normally same as last-command, but never modified by other commands. */
80 Lisp_Object Vreal_last_command; 89 Lisp_Object KBOARD_INTERNAL_FIELD (Vreal_last_command);
81 90
82 /* User-supplied table to translate input characters through. */ 91 /* User-supplied table to translate input characters through. */
83 Lisp_Object Vkeyboard_translate_table; 92 Lisp_Object KBOARD_INTERNAL_FIELD (Vkeyboard_translate_table);
84 93
85 /* Last command that may be repeated by `repeat'. */ 94 /* Last command that may be repeated by `repeat'. */
86 Lisp_Object Vlast_repeatable_command; 95 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_repeatable_command);
87 96
88 /* The prefix argument for the next command, in raw form. */ 97 /* The prefix argument for the next command, in raw form. */
89 Lisp_Object Vprefix_arg; 98 Lisp_Object KBOARD_INTERNAL_FIELD (Vprefix_arg);
90 99
91 /* Saved prefix argument for the last command, in raw form. */ 100 /* Saved prefix argument for the last command, in raw form. */
92 Lisp_Object Vlast_prefix_arg; 101 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_prefix_arg);
93 102
94 /* Unread events specific to this kboard. */ 103 /* Unread events specific to this kboard. */
95 Lisp_Object kbd_queue; 104 Lisp_Object KBOARD_INTERNAL_FIELD (kbd_queue);
96 105
97 /* Non-nil while a kbd macro is being defined. */ 106 /* Non-nil while a kbd macro is being defined. */
98 Lisp_Object defining_kbd_macro; 107 Lisp_Object KBOARD_INTERNAL_FIELD (defining_kbd_macro);
99 108
100 /* The start of storage for the current keyboard macro. */ 109 /* The start of storage for the current keyboard macro. */
101 Lisp_Object *kbd_macro_buffer; 110 Lisp_Object *kbd_macro_buffer;
@@ -117,28 +126,28 @@ struct kboard
117 int kbd_macro_bufsize; 126 int kbd_macro_bufsize;
118 127
119 /* Last anonymous kbd macro defined. */ 128 /* Last anonymous kbd macro defined. */
120 Lisp_Object Vlast_kbd_macro; 129 Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_kbd_macro);
121 130
122 /* Alist of system-specific X windows key symbols. */ 131 /* Alist of system-specific X windows key symbols. */
123 Lisp_Object Vsystem_key_alist; 132 Lisp_Object KBOARD_INTERNAL_FIELD (Vsystem_key_alist);
124 133
125 /* Cache for modify_event_symbol. */ 134 /* Cache for modify_event_symbol. */
126 Lisp_Object system_key_syms; 135 Lisp_Object KBOARD_INTERNAL_FIELD (system_key_syms);
127 136
128 /* The kind of display: x, w32, ... */ 137 /* The kind of display: x, w32, ... */
129 Lisp_Object Vwindow_system; 138 Lisp_Object KBOARD_INTERNAL_FIELD (Vwindow_system);
130 139
131 /* Keymap mapping keys to alternative preferred forms. 140 /* Keymap mapping keys to alternative preferred forms.
132 See the DEFVAR for more documentation. */ 141 See the DEFVAR for more documentation. */
133 Lisp_Object Vlocal_function_key_map; 142 Lisp_Object KBOARD_INTERNAL_FIELD (Vlocal_function_key_map);
134 143
135 /* Keymap mapping ASCII function key sequences onto their preferred 144 /* Keymap mapping ASCII function key sequences onto their preferred
136 forms. Initialized by the terminal-specific lisp files. See the 145 forms. Initialized by the terminal-specific lisp files. See the
137 DEFVAR for more documentation. */ 146 DEFVAR for more documentation. */
138 Lisp_Object Vinput_decode_map; 147 Lisp_Object KBOARD_INTERNAL_FIELD (Vinput_decode_map);
139 148
140 /* Minibufferless frames on this display use this frame's minibuffer. */ 149 /* Minibufferless frames on this display use this frame's minibuffer. */
141 Lisp_Object Vdefault_minibuffer_frame; 150 Lisp_Object KBOARD_INTERNAL_FIELD (Vdefault_minibuffer_frame);
142 151
143 /* Number of displays using this KBOARD. Normally 1, but can be 152 /* Number of displays using this KBOARD. Normally 1, but can be
144 larger when you have multiple screens on a single X display. */ 153 larger when you have multiple screens on a single X display. */
@@ -146,7 +155,7 @@ struct kboard
146 155
147 /* The text we're echoing in the modeline - partial key sequences, 156 /* The text we're echoing in the modeline - partial key sequences,
148 usually. This is nil when not echoing. */ 157 usually. This is nil when not echoing. */
149 Lisp_Object echo_string; 158 Lisp_Object KBOARD_INTERNAL_FIELD (echo_string);
150 159
151 /* This flag indicates that events were put into kbd_queue 160 /* This flag indicates that events were put into kbd_queue
152 while Emacs was running for some other KBOARD. 161 while Emacs was running for some other KBOARD.
diff --git a/src/keymap.c b/src/keymap.c
index b694deadcba..0e4715e4b8b 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1565,8 +1565,8 @@ like in the respective argument of `key-binding'. */)
1565 1565
1566 if (!NILP (olp)) 1566 if (!NILP (olp))
1567 { 1567 {
1568 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 1568 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
1569 keymaps = Fcons (current_kboard->Voverriding_terminal_local_map, keymaps); 1569 keymaps = Fcons (KVAR (current_kboard, Voverriding_terminal_local_map), keymaps);
1570 /* The doc said that overriding-terminal-local-map should 1570 /* The doc said that overriding-terminal-local-map should
1571 override overriding-local-map. The code used them both, 1571 override overriding-local-map. The code used them both,
1572 but it seems clearer to use just one. rms, jan 2005. */ 1572 but it seems clearer to use just one. rms, jan 2005. */
@@ -1745,9 +1745,9 @@ specified buffer position instead of point are used.
1745 } 1745 }
1746 } 1746 }
1747 1747
1748 if (! NILP (current_kboard->Voverriding_terminal_local_map)) 1748 if (! NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
1749 { 1749 {
1750 value = Flookup_key (current_kboard->Voverriding_terminal_local_map, 1750 value = Flookup_key (KVAR (current_kboard, Voverriding_terminal_local_map),
1751 key, accept_default); 1751 key, accept_default);
1752 if (! NILP (value) && !INTEGERP (value)) 1752 if (! NILP (value) && !INTEGERP (value))
1753 goto done; 1753 goto done;
@@ -1883,7 +1883,7 @@ bindings; see the description of `lookup-key' for more details about this. */)
1883 (Lisp_Object keys, Lisp_Object accept_default) 1883 (Lisp_Object keys, Lisp_Object accept_default)
1884{ 1884{
1885 register Lisp_Object map; 1885 register Lisp_Object map;
1886 map = B_ (current_buffer, keymap); 1886 map = BVAR (current_buffer, keymap);
1887 if (NILP (map)) 1887 if (NILP (map))
1888 return Qnil; 1888 return Qnil;
1889 return Flookup_key (map, keys, accept_default); 1889 return Flookup_key (map, keys, accept_default);
@@ -1988,7 +1988,7 @@ If KEYMAP is nil, that means no local keymap. */)
1988 if (!NILP (keymap)) 1988 if (!NILP (keymap))
1989 keymap = get_keymap (keymap, 1, 1); 1989 keymap = get_keymap (keymap, 1, 1);
1990 1990
1991 B_ (current_buffer, keymap) = keymap; 1991 BVAR (current_buffer, keymap) = keymap;
1992 1992
1993 return Qnil; 1993 return Qnil;
1994} 1994}
@@ -1998,7 +1998,7 @@ DEFUN ("current-local-map", Fcurrent_local_map, Scurrent_local_map, 0, 0, 0,
1998Normally the local keymap is set by the major mode with `use-local-map'. */) 1998Normally the local keymap is set by the major mode with `use-local-map'. */)
1999 (void) 1999 (void)
2000{ 2000{
2001 return B_ (current_buffer, keymap); 2001 return BVAR (current_buffer, keymap);
2002} 2002}
2003 2003
2004DEFUN ("current-global-map", Fcurrent_global_map, Scurrent_global_map, 0, 0, 0, 2004DEFUN ("current-global-map", Fcurrent_global_map, Scurrent_global_map, 0, 0, 0,
@@ -2379,7 +2379,7 @@ push_key_description (register unsigned int c, register char *p, int force_multi
2379 *p++ = 'C'; 2379 *p++ = 'C';
2380 } 2380 }
2381 else if (c < 128 2381 else if (c < 128
2382 || (NILP (B_ (current_buffer, enable_multibyte_characters)) 2382 || (NILP (BVAR (current_buffer, enable_multibyte_characters))
2383 && SINGLE_BYTE_CHAR_P (c) 2383 && SINGLE_BYTE_CHAR_P (c)
2384 && !force_multibyte)) 2384 && !force_multibyte))
2385 { 2385 {
@@ -2388,7 +2388,7 @@ push_key_description (register unsigned int c, register char *p, int force_multi
2388 else 2388 else
2389 { 2389 {
2390 /* Now we are sure that C is a valid character code. */ 2390 /* Now we are sure that C is a valid character code. */
2391 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 2391 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
2392 && ! force_multibyte) 2392 && ! force_multibyte)
2393 *p++ = multibyte_char_to_unibyte (c, Qnil); 2393 *p++ = multibyte_char_to_unibyte (c, Qnil);
2394 else 2394 else
@@ -2941,11 +2941,11 @@ You type Translation\n\
2941 outbuf = Fcurrent_buffer (); 2941 outbuf = Fcurrent_buffer ();
2942 2942
2943 /* Report on alternates for keys. */ 2943 /* Report on alternates for keys. */
2944 if (STRINGP (current_kboard->Vkeyboard_translate_table) && !NILP (prefix)) 2944 if (STRINGP (KVAR (current_kboard, Vkeyboard_translate_table)) && !NILP (prefix))
2945 { 2945 {
2946 int c; 2946 int c;
2947 const unsigned char *translate = SDATA (current_kboard->Vkeyboard_translate_table); 2947 const unsigned char *translate = SDATA (KVAR (current_kboard, Vkeyboard_translate_table));
2948 int translate_len = SCHARS (current_kboard->Vkeyboard_translate_table); 2948 int translate_len = SCHARS (KVAR (current_kboard, Vkeyboard_translate_table));
2949 2949
2950 for (c = 0; c < translate_len; c++) 2950 for (c = 0; c < translate_len; c++)
2951 if (translate[c] != c) 2951 if (translate[c] != c)
@@ -2968,7 +2968,7 @@ You type Translation\n\
2968 insert ("\n", 1); 2968 insert ("\n", 1);
2969 2969
2970 /* Insert calls signal_after_change which may GC. */ 2970 /* Insert calls signal_after_change which may GC. */
2971 translate = SDATA (current_kboard->Vkeyboard_translate_table); 2971 translate = SDATA (KVAR (current_kboard, Vkeyboard_translate_table));
2972 } 2972 }
2973 2973
2974 insert ("\n", 1); 2974 insert ("\n", 1);
@@ -2981,8 +2981,8 @@ You type Translation\n\
2981 2981
2982 /* Print the (major mode) local map. */ 2982 /* Print the (major mode) local map. */
2983 start1 = Qnil; 2983 start1 = Qnil;
2984 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 2984 if (!NILP (KVAR (current_kboard, Voverriding_terminal_local_map)))
2985 start1 = current_kboard->Voverriding_terminal_local_map; 2985 start1 = KVAR (current_kboard, Voverriding_terminal_local_map);
2986 else if (!NILP (Voverriding_local_map)) 2986 else if (!NILP (Voverriding_local_map))
2987 start1 = Voverriding_local_map; 2987 start1 = Voverriding_local_map;
2988 2988
@@ -3048,7 +3048,7 @@ You type Translation\n\
3048 XBUFFER (buffer), Qlocal_map); 3048 XBUFFER (buffer), Qlocal_map);
3049 if (!NILP (start1)) 3049 if (!NILP (start1))
3050 { 3050 {
3051 if (EQ (start1, B_ (XBUFFER (buffer), keymap))) 3051 if (EQ (start1, BVAR (XBUFFER (buffer), keymap)))
3052 describe_map_tree (start1, 1, shadow, prefix, 3052 describe_map_tree (start1, 1, shadow, prefix,
3053 "\f\nMajor Mode Bindings", nomenu, 0, 0, 0); 3053 "\f\nMajor Mode Bindings", nomenu, 0, 0, 0);
3054 else 3054 else
@@ -3064,13 +3064,13 @@ You type Translation\n\
3064 "\f\nGlobal Bindings", nomenu, 0, 1, 0); 3064 "\f\nGlobal Bindings", nomenu, 0, 1, 0);
3065 3065
3066 /* Print the function-key-map translations under this prefix. */ 3066 /* Print the function-key-map translations under this prefix. */
3067 if (!NILP (current_kboard->Vlocal_function_key_map)) 3067 if (!NILP (KVAR (current_kboard, Vlocal_function_key_map)))
3068 describe_map_tree (current_kboard->Vlocal_function_key_map, 0, Qnil, prefix, 3068 describe_map_tree (KVAR (current_kboard, Vlocal_function_key_map), 0, Qnil, prefix,
3069 "\f\nFunction key map translations", nomenu, 1, 0, 0); 3069 "\f\nFunction key map translations", nomenu, 1, 0, 0);
3070 3070
3071 /* Print the input-decode-map translations under this prefix. */ 3071 /* Print the input-decode-map translations under this prefix. */
3072 if (!NILP (current_kboard->Vinput_decode_map)) 3072 if (!NILP (KVAR (current_kboard, Vinput_decode_map)))
3073 describe_map_tree (current_kboard->Vinput_decode_map, 0, Qnil, prefix, 3073 describe_map_tree (KVAR (current_kboard, Vinput_decode_map), 0, Qnil, prefix,
3074 "\f\nInput decoding map translations", nomenu, 1, 0, 0); 3074 "\f\nInput decoding map translations", nomenu, 1, 0, 0);
3075 3075
3076 UNGCPRO; 3076 UNGCPRO;
diff --git a/src/lisp.h b/src/lisp.h
index 0efadd675b0..82c4f65613d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1882,7 +1882,7 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
1882#define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \ 1882#define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \
1883 do { \ 1883 do { \
1884 static struct Lisp_Objfwd o_fwd; \ 1884 static struct Lisp_Objfwd o_fwd; \
1885 defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname ## _); \ 1885 defvar_lisp_nopro (&o_fwd, lname, &BVAR (&buffer_defaults, vname)); \
1886 } while (0) 1886 } while (0)
1887 1887
1888#define DEFVAR_KBOARD(lname, vname, doc) \ 1888#define DEFVAR_KBOARD(lname, vname, doc) \
@@ -1890,7 +1890,7 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
1890 static struct Lisp_Kboard_Objfwd ko_fwd; \ 1890 static struct Lisp_Kboard_Objfwd ko_fwd; \
1891 defvar_kboard (&ko_fwd, \ 1891 defvar_kboard (&ko_fwd, \
1892 lname, \ 1892 lname, \
1893 (int)((char *)(&current_kboard->vname) \ 1893 (int)((char *)(&current_kboard->vname ## _) \
1894 - (char *)current_kboard)); \ 1894 - (char *)current_kboard)); \
1895 } while (0) 1895 } while (0)
1896 1896
@@ -2047,11 +2047,11 @@ extern Lisp_Object case_temp2;
2047 2047
2048/* Current buffer's map from characters to lower-case characters. */ 2048/* Current buffer's map from characters to lower-case characters. */
2049 2049
2050#define DOWNCASE_TABLE B_ (current_buffer, downcase_table) 2050#define DOWNCASE_TABLE BVAR (current_buffer, downcase_table)
2051 2051
2052/* Current buffer's map from characters to upper-case characters. */ 2052/* Current buffer's map from characters to upper-case characters. */
2053 2053
2054#define UPCASE_TABLE B_ (current_buffer, upcase_table) 2054#define UPCASE_TABLE BVAR (current_buffer, upcase_table)
2055 2055
2056/* Downcase a character, or make no change if that cannot be done. */ 2056/* Downcase a character, or make no change if that cannot be done. */
2057 2057
@@ -2145,6 +2145,11 @@ struct gcpro
2145#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE 2145#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE
2146#endif 2146#endif
2147 2147
2148/* Whether we do the stack marking manually. */
2149#define BYTE_MARK_STACK !(GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \
2150 || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS)
2151
2152
2148#if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS 2153#if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
2149 2154
2150/* Do something silly with gcproN vars just so gcc shuts up. */ 2155/* Do something silly with gcproN vars just so gcc shuts up. */
@@ -3253,7 +3258,9 @@ extern Lisp_Object Qbytecode;
3253EXFUN (Fbyte_code, 3); 3258EXFUN (Fbyte_code, 3);
3254extern void syms_of_bytecode (void); 3259extern void syms_of_bytecode (void);
3255extern struct byte_stack *byte_stack_list; 3260extern struct byte_stack *byte_stack_list;
3261#ifdef BYTE_MARK_STACK
3256extern void mark_byte_stack (void); 3262extern void mark_byte_stack (void);
3263#endif
3257extern void unmark_byte_stack (void); 3264extern void unmark_byte_stack (void);
3258 3265
3259/* Defined in macros.c */ 3266/* Defined in macros.c */
diff --git a/src/lread.c b/src/lread.c
index de9c5db95ad..7e410fcc334 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -210,7 +210,7 @@ readchar (Lisp_Object readcharfun, int *multibyte)
210 if (pt_byte >= BUF_ZV_BYTE (inbuffer)) 210 if (pt_byte >= BUF_ZV_BYTE (inbuffer))
211 return -1; 211 return -1;
212 212
213 if (! NILP (B_ (inbuffer, enable_multibyte_characters))) 213 if (! NILP (BVAR (inbuffer, enable_multibyte_characters)))
214 { 214 {
215 /* Fetch the character code from the buffer. */ 215 /* Fetch the character code from the buffer. */
216 unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, pt_byte); 216 unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, pt_byte);
@@ -239,7 +239,7 @@ readchar (Lisp_Object readcharfun, int *multibyte)
239 if (bytepos >= BUF_ZV_BYTE (inbuffer)) 239 if (bytepos >= BUF_ZV_BYTE (inbuffer))
240 return -1; 240 return -1;
241 241
242 if (! NILP (B_ (inbuffer, enable_multibyte_characters))) 242 if (! NILP (BVAR (inbuffer, enable_multibyte_characters)))
243 { 243 {
244 /* Fetch the character code from the buffer. */ 244 /* Fetch the character code from the buffer. */
245 unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, bytepos); 245 unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, bytepos);
@@ -371,7 +371,7 @@ unreadchar (Lisp_Object readcharfun, int c)
371 EMACS_INT bytepos = BUF_PT_BYTE (b); 371 EMACS_INT bytepos = BUF_PT_BYTE (b);
372 372
373 BUF_PT (b)--; 373 BUF_PT (b)--;
374 if (! NILP (B_ (b, enable_multibyte_characters))) 374 if (! NILP (BVAR (b, enable_multibyte_characters)))
375 BUF_DEC_POS (b, bytepos); 375 BUF_DEC_POS (b, bytepos);
376 else 376 else
377 bytepos--; 377 bytepos--;
@@ -384,7 +384,7 @@ unreadchar (Lisp_Object readcharfun, int c)
384 EMACS_INT bytepos = XMARKER (readcharfun)->bytepos; 384 EMACS_INT bytepos = XMARKER (readcharfun)->bytepos;
385 385
386 XMARKER (readcharfun)->charpos--; 386 XMARKER (readcharfun)->charpos--;
387 if (! NILP (B_ (b, enable_multibyte_characters))) 387 if (! NILP (BVAR (b, enable_multibyte_characters)))
388 BUF_DEC_POS (b, bytepos); 388 BUF_DEC_POS (b, bytepos);
389 else 389 else
390 bytepos--; 390 bytepos--;
@@ -1322,7 +1322,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
1322 /* Of course, this could conceivably lose if luser sets 1322 /* Of course, this could conceivably lose if luser sets
1323 default-directory to be something non-absolute... */ 1323 default-directory to be something non-absolute... */
1324 { 1324 {
1325 filename = Fexpand_file_name (filename, B_ (current_buffer, directory)); 1325 filename = Fexpand_file_name (filename, BVAR (current_buffer, directory));
1326 if (!complete_filename_p (filename)) 1326 if (!complete_filename_p (filename))
1327 /* Give up on this path element! */ 1327 /* Give up on this path element! */
1328 continue; 1328 continue;
@@ -1581,7 +1581,7 @@ readevalloop (Lisp_Object readcharfun,
1581 { 1581 {
1582 int count1 = SPECPDL_INDEX (); 1582 int count1 = SPECPDL_INDEX ();
1583 1583
1584 if (b != 0 && NILP (B_ (b, name))) 1584 if (b != 0 && NILP (BVAR (b, name)))
1585 error ("Reading from killed buffer"); 1585 error ("Reading from killed buffer");
1586 1586
1587 if (!NILP (start)) 1587 if (!NILP (start))
@@ -1721,7 +1721,7 @@ This function preserves the position of point. */)
1721 tem = printflag; 1721 tem = printflag;
1722 1722
1723 if (NILP (filename)) 1723 if (NILP (filename))
1724 filename = B_ (XBUFFER (buf), filename); 1724 filename = BVAR (XBUFFER (buf), filename);
1725 1725
1726 specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); 1726 specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
1727 specbind (Qstandard_output, tem); 1727 specbind (Qstandard_output, tem);
@@ -1761,7 +1761,7 @@ This function does not move point. */)
1761 specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list)); 1761 specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list));
1762 1762
1763 /* readevalloop calls functions which check the type of start and end. */ 1763 /* readevalloop calls functions which check the type of start and end. */
1764 readevalloop (cbuf, 0, B_ (XBUFFER (cbuf), filename), Feval, 1764 readevalloop (cbuf, 0, BVAR (XBUFFER (cbuf), filename), Feval,
1765 !NILP (printflag), Qnil, read_function, 1765 !NILP (printflag), Qnil, read_function,
1766 start, end); 1766 start, end);
1767 1767
diff --git a/src/macros.c b/src/macros.c
index 34ac08c3284..d90b31b503f 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -56,7 +56,7 @@ If optional second arg, NO-EXEC, is non-nil, do not re-execute last
56macro before appending to it. */) 56macro before appending to it. */)
57 (Lisp_Object append, Lisp_Object no_exec) 57 (Lisp_Object append, Lisp_Object no_exec)
58{ 58{
59 if (!NILP (current_kboard->defining_kbd_macro)) 59 if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
60 error ("Already defining kbd macro"); 60 error ("Already defining kbd macro");
61 61
62 if (!current_kboard->kbd_macro_buffer) 62 if (!current_kboard->kbd_macro_buffer)
@@ -85,9 +85,9 @@ macro before appending to it. */)
85 int cvt; 85 int cvt;
86 86
87 /* Check the type of last-kbd-macro in case Lisp code changed it. */ 87 /* Check the type of last-kbd-macro in case Lisp code changed it. */
88 CHECK_VECTOR_OR_STRING (current_kboard->Vlast_kbd_macro); 88 CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro));
89 89
90 len = XINT (Flength (current_kboard->Vlast_kbd_macro)); 90 len = XINT (Flength (KVAR (current_kboard, Vlast_kbd_macro)));
91 91
92 /* Copy last-kbd-macro into the buffer, in case the Lisp code 92 /* Copy last-kbd-macro into the buffer, in case the Lisp code
93 has put another macro there. */ 93 has put another macro there. */
@@ -100,11 +100,11 @@ macro before appending to it. */)
100 } 100 }
101 101
102 /* Must convert meta modifier when copying string to vector. */ 102 /* Must convert meta modifier when copying string to vector. */
103 cvt = STRINGP (current_kboard->Vlast_kbd_macro); 103 cvt = STRINGP (KVAR (current_kboard, Vlast_kbd_macro));
104 for (i = 0; i < len; i++) 104 for (i = 0; i < len; i++)
105 { 105 {
106 Lisp_Object c; 106 Lisp_Object c;
107 c = Faref (current_kboard->Vlast_kbd_macro, make_number (i)); 107 c = Faref (KVAR (current_kboard, Vlast_kbd_macro), make_number (i));
108 if (cvt && NATNUMP (c) && (XFASTINT (c) & 0x80)) 108 if (cvt && NATNUMP (c) && (XFASTINT (c) & 0x80))
109 XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80)); 109 XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80));
110 current_kboard->kbd_macro_buffer[i] = c; 110 current_kboard->kbd_macro_buffer[i] = c;
@@ -116,12 +116,12 @@ macro before appending to it. */)
116 /* Re-execute the macro we are appending to, 116 /* Re-execute the macro we are appending to,
117 for consistency of behavior. */ 117 for consistency of behavior. */
118 if (NILP (no_exec)) 118 if (NILP (no_exec))
119 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, 119 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro),
120 make_number (1), Qnil); 120 make_number (1), Qnil);
121 121
122 message ("Appending to kbd macro..."); 122 message ("Appending to kbd macro...");
123 } 123 }
124 current_kboard->defining_kbd_macro = Qt; 124 KVAR (current_kboard, defining_kbd_macro) = Qt;
125 125
126 return Qnil; 126 return Qnil;
127} 127}
@@ -131,9 +131,9 @@ macro before appending to it. */)
131void 131void
132end_kbd_macro (void) 132end_kbd_macro (void)
133{ 133{
134 current_kboard->defining_kbd_macro = Qnil; 134 KVAR (current_kboard, defining_kbd_macro) = Qnil;
135 update_mode_lines++; 135 update_mode_lines++;
136 current_kboard->Vlast_kbd_macro 136 KVAR (current_kboard, Vlast_kbd_macro)
137 = make_event_array ((current_kboard->kbd_macro_end 137 = make_event_array ((current_kboard->kbd_macro_end
138 - current_kboard->kbd_macro_buffer), 138 - current_kboard->kbd_macro_buffer),
139 current_kboard->kbd_macro_buffer); 139 current_kboard->kbd_macro_buffer);
@@ -154,7 +154,7 @@ In Lisp, optional second arg LOOPFUNC may be a function that is called prior to
154each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) 154each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
155 (Lisp_Object repeat, Lisp_Object loopfunc) 155 (Lisp_Object repeat, Lisp_Object loopfunc)
156{ 156{
157 if (NILP (current_kboard->defining_kbd_macro)) 157 if (NILP (KVAR (current_kboard, defining_kbd_macro)))
158 error ("Not defining kbd macro"); 158 error ("Not defining kbd macro");
159 159
160 if (NILP (repeat)) 160 if (NILP (repeat))
@@ -162,19 +162,19 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
162 else 162 else
163 CHECK_NUMBER (repeat); 163 CHECK_NUMBER (repeat);
164 164
165 if (!NILP (current_kboard->defining_kbd_macro)) 165 if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
166 { 166 {
167 end_kbd_macro (); 167 end_kbd_macro ();
168 message ("Keyboard macro defined"); 168 message ("Keyboard macro defined");
169 } 169 }
170 170
171 if (XFASTINT (repeat) == 0) 171 if (XFASTINT (repeat) == 0)
172 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat, loopfunc); 172 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc);
173 else 173 else
174 { 174 {
175 XSETINT (repeat, XINT (repeat)-1); 175 XSETINT (repeat, XINT (repeat)-1);
176 if (XINT (repeat) > 0) 176 if (XINT (repeat) > 0)
177 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, repeat, loopfunc); 177 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc);
178 } 178 }
179 return Qnil; 179 return Qnil;
180} 180}
@@ -186,7 +186,7 @@ store_kbd_macro_char (Lisp_Object c)
186{ 186{
187 struct kboard *kb = current_kboard; 187 struct kboard *kb = current_kboard;
188 188
189 if (!NILP (kb->defining_kbd_macro)) 189 if (!NILP (KVAR (kb, defining_kbd_macro)))
190 { 190 {
191 if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize) 191 if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize)
192 { 192 {
@@ -248,21 +248,21 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
248{ 248{
249 /* Don't interfere with recognition of the previous command 249 /* Don't interfere with recognition of the previous command
250 from before this macro started. */ 250 from before this macro started. */
251 Vthis_command = current_kboard->Vlast_command; 251 Vthis_command = KVAR (current_kboard, Vlast_command);
252 /* C-x z after the macro should repeat the macro. */ 252 /* C-x z after the macro should repeat the macro. */
253 real_this_command = current_kboard->Vlast_kbd_macro; 253 real_this_command = KVAR (current_kboard, Vlast_kbd_macro);
254 254
255 if (! NILP (current_kboard->defining_kbd_macro)) 255 if (! NILP (KVAR (current_kboard, defining_kbd_macro)))
256 error ("Can't execute anonymous macro while defining one"); 256 error ("Can't execute anonymous macro while defining one");
257 else if (NILP (current_kboard->Vlast_kbd_macro)) 257 else if (NILP (KVAR (current_kboard, Vlast_kbd_macro)))
258 error ("No kbd macro has been defined"); 258 error ("No kbd macro has been defined");
259 else 259 else
260 Fexecute_kbd_macro (current_kboard->Vlast_kbd_macro, prefix, loopfunc); 260 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), prefix, loopfunc);
261 261
262 /* command_loop_1 sets this to nil before it returns; 262 /* command_loop_1 sets this to nil before it returns;
263 get back the last command within the macro 263 get back the last command within the macro
264 so that it can be last, again, after we return. */ 264 so that it can be last, again, after we return. */
265 Vthis_command = current_kboard->Vlast_command; 265 Vthis_command = KVAR (current_kboard, Vlast_command);
266 266
267 return Qnil; 267 return Qnil;
268} 268}
@@ -322,7 +322,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
322 executing_kbd_macro = final; 322 executing_kbd_macro = final;
323 executing_kbd_macro_index = 0; 323 executing_kbd_macro_index = 0;
324 324
325 current_kboard->Vprefix_arg = Qnil; 325 KVAR (current_kboard, Vprefix_arg) = Qnil;
326 326
327 if (!NILP (loopfunc)) 327 if (!NILP (loopfunc))
328 { 328 {
diff --git a/src/marker.c b/src/marker.c
index 9b841835646..72c564f420f 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -439,7 +439,7 @@ Returns nil if MARKER points into a dead buffer. */)
439 does not preserve the buffer from being GC'd (it's weak), so 439 does not preserve the buffer from being GC'd (it's weak), so
440 markers have to be unlinked from their buffer as soon as the buffer 440 markers have to be unlinked from their buffer as soon as the buffer
441 is killed. */ 441 is killed. */
442 eassert (!NILP (B_ (XBUFFER (buf), name))); 442 eassert (!NILP (BVAR (XBUFFER (buf), name)));
443 return buf; 443 return buf;
444 } 444 }
445 return Qnil; 445 return Qnil;
@@ -488,7 +488,7 @@ Returns MARKER. */)
488 CHECK_BUFFER (buffer); 488 CHECK_BUFFER (buffer);
489 b = XBUFFER (buffer); 489 b = XBUFFER (buffer);
490 /* If buffer is dead, set marker to point nowhere. */ 490 /* If buffer is dead, set marker to point nowhere. */
491 if (EQ (B_ (b, name), Qnil)) 491 if (EQ (BVAR (b, name), Qnil))
492 { 492 {
493 unchain_marker (m); 493 unchain_marker (m);
494 return marker; 494 return marker;
@@ -563,7 +563,7 @@ set_marker_restricted (Lisp_Object marker, Lisp_Object pos, Lisp_Object buffer)
563 CHECK_BUFFER (buffer); 563 CHECK_BUFFER (buffer);
564 b = XBUFFER (buffer); 564 b = XBUFFER (buffer);
565 /* If buffer is dead, set marker to point nowhere. */ 565 /* If buffer is dead, set marker to point nowhere. */
566 if (EQ (B_ (b, name), Qnil)) 566 if (EQ (BVAR (b, name), Qnil))
567 { 567 {
568 unchain_marker (m); 568 unchain_marker (m);
569 return marker; 569 return marker;
@@ -628,7 +628,7 @@ set_marker_both (Lisp_Object marker, Lisp_Object buffer, EMACS_INT charpos, EMAC
628 CHECK_BUFFER (buffer); 628 CHECK_BUFFER (buffer);
629 b = XBUFFER (buffer); 629 b = XBUFFER (buffer);
630 /* If buffer is dead, set marker to point nowhere. */ 630 /* If buffer is dead, set marker to point nowhere. */
631 if (EQ (B_ (b, name), Qnil)) 631 if (EQ (BVAR (b, name), Qnil))
632 { 632 {
633 unchain_marker (m); 633 unchain_marker (m);
634 return marker; 634 return marker;
@@ -676,7 +676,7 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, EMACS_INT ch
676 CHECK_BUFFER (buffer); 676 CHECK_BUFFER (buffer);
677 b = XBUFFER (buffer); 677 b = XBUFFER (buffer);
678 /* If buffer is dead, set marker to point nowhere. */ 678 /* If buffer is dead, set marker to point nowhere. */
679 if (EQ (B_ (b, name), Qnil)) 679 if (EQ (BVAR (b, name), Qnil))
680 { 680 {
681 unchain_marker (m); 681 unchain_marker (m);
682 return marker; 682 return marker;
@@ -731,7 +731,7 @@ unchain_marker (register struct Lisp_Marker *marker)
731 if (b == 0) 731 if (b == 0)
732 return; 732 return;
733 733
734 if (EQ (B_ (b, name), Qnil)) 734 if (EQ (BVAR (b, name), Qnil))
735 abort (); 735 abort ();
736 736
737 marker->buffer = 0; 737 marker->buffer = 0;
diff --git a/src/minibuf.c b/src/minibuf.c
index 3ed8630c845..4b709bd9cbd 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -415,7 +415,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
415 CHECK_STRING (initial); 415 CHECK_STRING (initial);
416 } 416 }
417 val = Qnil; 417 val = Qnil;
418 ambient_dir = B_ (current_buffer, directory); 418 ambient_dir = BVAR (current_buffer, directory);
419 input_method = Qnil; 419 input_method = Qnil;
420 enable_multibyte = Qnil; 420 enable_multibyte = Qnil;
421 421
@@ -525,7 +525,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
525 /* `current-input-method' is buffer local. So, remember it in 525 /* `current-input-method' is buffer local. So, remember it in
526 INPUT_METHOD before changing the current buffer. */ 526 INPUT_METHOD before changing the current buffer. */
527 input_method = Fsymbol_value (Qcurrent_input_method); 527 input_method = Fsymbol_value (Qcurrent_input_method);
528 enable_multibyte = B_ (current_buffer, enable_multibyte_characters); 528 enable_multibyte = BVAR (current_buffer, enable_multibyte_characters);
529 } 529 }
530 530
531 /* Switch to the minibuffer. */ 531 /* Switch to the minibuffer. */
@@ -535,7 +535,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
535 535
536 /* If appropriate, copy enable-multibyte-characters into the minibuffer. */ 536 /* If appropriate, copy enable-multibyte-characters into the minibuffer. */
537 if (inherit_input_method) 537 if (inherit_input_method)
538 B_ (current_buffer, enable_multibyte_characters) = enable_multibyte; 538 BVAR (current_buffer, enable_multibyte_characters) = enable_multibyte;
539 539
540 /* The current buffer's default directory is usually the right thing 540 /* The current buffer's default directory is usually the right thing
541 for our minibuffer here. However, if you're typing a command at 541 for our minibuffer here. However, if you're typing a command at
@@ -546,7 +546,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
546 you think of something better to do? Find another buffer with a 546 you think of something better to do? Find another buffer with a
547 better directory, and use that one instead. */ 547 better directory, and use that one instead. */
548 if (STRINGP (ambient_dir)) 548 if (STRINGP (ambient_dir))
549 B_ (current_buffer, directory) = ambient_dir; 549 BVAR (current_buffer, directory) = ambient_dir;
550 else 550 else
551 { 551 {
552 Lisp_Object buf_list; 552 Lisp_Object buf_list;
@@ -558,9 +558,9 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
558 Lisp_Object other_buf; 558 Lisp_Object other_buf;
559 559
560 other_buf = XCDR (XCAR (buf_list)); 560 other_buf = XCDR (XCAR (buf_list));
561 if (STRINGP (B_ (XBUFFER (other_buf), directory))) 561 if (STRINGP (BVAR (XBUFFER (other_buf), directory)))
562 { 562 {
563 B_ (current_buffer, directory) = B_ (XBUFFER (other_buf), directory); 563 BVAR (current_buffer, directory) = BVAR (XBUFFER (other_buf), directory);
564 break; 564 break;
565 } 565 }
566 } 566 }
@@ -603,7 +603,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
603 specbind (Qinhibit_modification_hooks, Qt); 603 specbind (Qinhibit_modification_hooks, Qt);
604 Ferase_buffer (); 604 Ferase_buffer ();
605 605
606 if (!NILP (B_ (current_buffer, enable_multibyte_characters)) 606 if (!NILP (BVAR (current_buffer, enable_multibyte_characters))
607 && ! STRING_MULTIBYTE (minibuf_prompt)) 607 && ! STRING_MULTIBYTE (minibuf_prompt))
608 minibuf_prompt = Fstring_make_multibyte (minibuf_prompt); 608 minibuf_prompt = Fstring_make_multibyte (minibuf_prompt);
609 609
@@ -633,7 +633,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
633 } 633 }
634 634
635 clear_message (1, 1); 635 clear_message (1, 1);
636 B_ (current_buffer, keymap) = map; 636 BVAR (current_buffer, keymap) = map;
637 637
638 /* Turn on an input method stored in INPUT_METHOD if any. */ 638 /* Turn on an input method stored in INPUT_METHOD if any. */
639 if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method))) 639 if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method)))
@@ -647,7 +647,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
647 call1 (Vrun_hooks, Qminibuffer_setup_hook); 647 call1 (Vrun_hooks, Qminibuffer_setup_hook);
648 648
649 /* Don't allow the user to undo past this point. */ 649 /* Don't allow the user to undo past this point. */
650 B_ (current_buffer, undo_list) = Qnil; 650 BVAR (current_buffer, undo_list) = Qnil;
651 651
652 recursive_edit_1 (); 652 recursive_edit_1 ();
653 653
@@ -764,7 +764,7 @@ get_minibuffer (int depth)
764 Vminibuffer_list = nconc2 (Vminibuffer_list, tail); 764 Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
765 } 765 }
766 buf = Fcar (tail); 766 buf = Fcar (tail);
767 if (NILP (buf) || NILP (B_ (XBUFFER (buf), name))) 767 if (NILP (buf) || NILP (BVAR (XBUFFER (buf), name)))
768 { 768 {
769 sprintf (name, " *Minibuf-%d*", depth); 769 sprintf (name, " *Minibuf-%d*", depth);
770 buf = Fget_buffer_create (build_string (name)); 770 buf = Fget_buffer_create (build_string (name));
@@ -1096,7 +1096,7 @@ function, instead of the usual behavior. */)
1096 int count = SPECPDL_INDEX (); 1096 int count = SPECPDL_INDEX ();
1097 1097
1098 if (BUFFERP (def)) 1098 if (BUFFERP (def))
1099 def = B_ (XBUFFER (def), name); 1099 def = BVAR (XBUFFER (def), name);
1100 1100
1101 specbind (Qcompletion_ignore_case, 1101 specbind (Qcompletion_ignore_case,
1102 read_buffer_completion_ignore_case ? Qt : Qnil); 1102 read_buffer_completion_ignore_case ? Qt : Qnil);
diff --git a/src/msdos.c b/src/msdos.c
index d37200e700a..8f0f6776aaa 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1317,12 +1317,12 @@ IT_frame_up_to_date (struct frame *f)
1317 { 1317 {
1318 struct buffer *b = XBUFFER (sw->buffer); 1318 struct buffer *b = XBUFFER (sw->buffer);
1319 1319
1320 if (EQ (B_ (b,cursor_type), Qt)) 1320 if (EQ (BVAR (b,cursor_type), Qt))
1321 new_cursor = frame_desired_cursor; 1321 new_cursor = frame_desired_cursor;
1322 else if (NILP (B_ (b, cursor_type))) /* nil means no cursor */ 1322 else if (NILP (BVAR (b, cursor_type))) /* nil means no cursor */
1323 new_cursor = Fcons (Qbar, make_number (0)); 1323 new_cursor = Fcons (Qbar, make_number (0));
1324 else 1324 else
1325 new_cursor = B_ (b, cursor_type); 1325 new_cursor = BVAR (b, cursor_type);
1326 } 1326 }
1327 1327
1328 IT_set_cursor_type (f, new_cursor); 1328 IT_set_cursor_type (f, new_cursor);
@@ -1793,7 +1793,7 @@ internal_terminal_init (void)
1793 } 1793 }
1794 1794
1795 tty = FRAME_TTY (sf); 1795 tty = FRAME_TTY (sf);
1796 current_kboard->Vwindow_system = Qpc; 1796 KVAR (current_kboard, Vwindow_system) = Qpc;
1797 sf->output_method = output_msdos_raw; 1797 sf->output_method = output_msdos_raw;
1798 if (init_needed) 1798 if (init_needed)
1799 { 1799 {
diff --git a/src/nsfns.m b/src/nsfns.m
index c480c834602..6a5adbd7bf3 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -605,8 +605,8 @@ ns_set_name_as_filename (struct frame *f)
605 605
606 BLOCK_INPUT; 606 BLOCK_INPUT;
607 pool = [[NSAutoreleasePool alloc] init]; 607 pool = [[NSAutoreleasePool alloc] init];
608 filename = B_ (XBUFFER (buf), filename); 608 filename = BVAR (XBUFFER (buf), filename);
609 name = B_ (XBUFFER (buf), name); 609 name = BVAR (XBUFFER (buf), name);
610 610
611 if (NILP (name)) 611 if (NILP (name))
612 { 612 {
@@ -1329,9 +1329,9 @@ be shared by the new frame. */)
1329 } 1329 }
1330 1330
1331 if (FRAME_HAS_MINIBUF_P (f) 1331 if (FRAME_HAS_MINIBUF_P (f)
1332 && (!FRAMEP (kb->Vdefault_minibuffer_frame) 1332 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
1333 || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) 1333 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
1334 kb->Vdefault_minibuffer_frame = frame; 1334 KVAR (kb, Vdefault_minibuffer_frame) = frame;
1335 1335
1336 /* All remaining specified parameters, which have not been "used" 1336 /* All remaining specified parameters, which have not been "used"
1337 by x_get_arg and friends, now go in the misc. alist of the frame. */ 1337 by x_get_arg and friends, now go in the misc. alist of the frame. */
@@ -1428,7 +1428,7 @@ Optional arg INIT, if non-nil, provides a default file name to use. */)
1428 NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : 1428 NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil :
1429 [NSString stringWithUTF8String: SDATA (prompt)]; 1429 [NSString stringWithUTF8String: SDATA (prompt)];
1430 NSString *dirS = NILP (dir) || !STRINGP (dir) ? 1430 NSString *dirS = NILP (dir) || !STRINGP (dir) ?
1431 [NSString stringWithUTF8String: SDATA (B_ (current_buffer, directory))] : 1431 [NSString stringWithUTF8String: SDATA (BVAR (current_buffer, directory))] :
1432 [NSString stringWithUTF8String: SDATA (dir)]; 1432 [NSString stringWithUTF8String: SDATA (dir)];
1433 NSString *initS = NILP (init) || !STRINGP (init) ? nil : 1433 NSString *initS = NILP (init) || !STRINGP (init) ? nil :
1434 [NSString stringWithUTF8String: SDATA (init)]; 1434 [NSString stringWithUTF8String: SDATA (init)];
diff --git a/src/nsterm.m b/src/nsterm.m
index 590a76ba16d..a09c95c7d01 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3762,7 +3762,7 @@ ns_term_init (Lisp_Object display_name)
3762 3762
3763 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 3763 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
3764 init_kboard (terminal->kboard); 3764 init_kboard (terminal->kboard);
3765 terminal->kboard->Vwindow_system = Qns; 3765 KVAR (terminal->kboard, Vwindow_system) = Qns;
3766 terminal->kboard->next_kboard = all_kboards; 3766 terminal->kboard->next_kboard = all_kboards;
3767 all_kboards = terminal->kboard; 3767 all_kboards = terminal->kboard;
3768 /* Don't let the initial kboard remain current longer than necessary. 3768 /* Don't let the initial kboard remain current longer than necessary.
diff --git a/src/print.c b/src/print.c
index beb14a8b679..299cfd41814 100644
--- a/src/print.c
+++ b/src/print.c
@@ -111,7 +111,7 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
111 EMACS_INT old_point_byte = -1, start_point_byte = -1; \ 111 EMACS_INT old_point_byte = -1, start_point_byte = -1; \
112 int specpdl_count = SPECPDL_INDEX (); \ 112 int specpdl_count = SPECPDL_INDEX (); \
113 int free_print_buffer = 0; \ 113 int free_print_buffer = 0; \
114 int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); \ 114 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); \
115 Lisp_Object original 115 Lisp_Object original
116 116
117#define PRINTPREPARE \ 117#define PRINTPREPARE \
@@ -144,10 +144,10 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
144 if (NILP (printcharfun)) \ 144 if (NILP (printcharfun)) \
145 { \ 145 { \
146 Lisp_Object string; \ 146 Lisp_Object string; \
147 if (NILP (B_ (current_buffer, enable_multibyte_characters)) \ 147 if (NILP (BVAR (current_buffer, enable_multibyte_characters)) \
148 && ! print_escape_multibyte) \ 148 && ! print_escape_multibyte) \
149 specbind (Qprint_escape_multibyte, Qt); \ 149 specbind (Qprint_escape_multibyte, Qt); \
150 if (! NILP (B_ (current_buffer, enable_multibyte_characters)) \ 150 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)) \
151 && ! print_escape_nonascii) \ 151 && ! print_escape_nonascii) \
152 specbind (Qprint_escape_nonascii, Qt); \ 152 specbind (Qprint_escape_nonascii, Qt); \
153 if (print_buffer != 0) \ 153 if (print_buffer != 0) \
@@ -173,7 +173,7 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
173 if (NILP (printcharfun)) \ 173 if (NILP (printcharfun)) \
174 { \ 174 { \
175 if (print_buffer_pos != print_buffer_pos_byte \ 175 if (print_buffer_pos != print_buffer_pos_byte \
176 && NILP (B_ (current_buffer, enable_multibyte_characters))) \ 176 && NILP (BVAR (current_buffer, enable_multibyte_characters))) \
177 { \ 177 { \
178 unsigned char *temp \ 178 unsigned char *temp \
179 = (unsigned char *) alloca (print_buffer_pos + 1); \ 179 = (unsigned char *) alloca (print_buffer_pos + 1); \
@@ -250,7 +250,7 @@ printchar (unsigned int ch, Lisp_Object fun)
250 else 250 else
251 { 251 {
252 int multibyte_p 252 int multibyte_p
253 = !NILP (B_ (current_buffer, enable_multibyte_characters)); 253 = !NILP (BVAR (current_buffer, enable_multibyte_characters));
254 254
255 setup_echo_area_for_printing (multibyte_p); 255 setup_echo_area_for_printing (multibyte_p);
256 insert_char (ch); 256 insert_char (ch);
@@ -302,7 +302,7 @@ strout (const char *ptr, EMACS_INT size, EMACS_INT size_byte,
302 job. */ 302 job. */
303 int i; 303 int i;
304 int multibyte_p 304 int multibyte_p
305 = !NILP (B_ (current_buffer, enable_multibyte_characters)); 305 = !NILP (BVAR (current_buffer, enable_multibyte_characters));
306 306
307 setup_echo_area_for_printing (multibyte_p); 307 setup_echo_area_for_printing (multibyte_p);
308 message_dolog (ptr, size_byte, 0, multibyte_p); 308 message_dolog (ptr, size_byte, 0, multibyte_p);
@@ -371,8 +371,8 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
371 chars = SCHARS (string); 371 chars = SCHARS (string);
372 else if (! print_escape_nonascii 372 else if (! print_escape_nonascii
373 && (EQ (printcharfun, Qt) 373 && (EQ (printcharfun, Qt)
374 ? ! NILP (B_ (&buffer_defaults, enable_multibyte_characters)) 374 ? ! NILP (BVAR (&buffer_defaults, enable_multibyte_characters))
375 : ! NILP (B_ (current_buffer, enable_multibyte_characters)))) 375 : ! NILP (BVAR (current_buffer, enable_multibyte_characters))))
376 { 376 {
377 /* If unibyte string STRING contains 8-bit codes, we must 377 /* If unibyte string STRING contains 8-bit codes, we must
378 convert STRING to a multibyte string containing the same 378 convert STRING to a multibyte string containing the same
@@ -504,14 +504,14 @@ temp_output_buffer_setup (const char *bufname)
504 504
505 Fkill_all_local_variables (); 505 Fkill_all_local_variables ();
506 delete_all_overlays (current_buffer); 506 delete_all_overlays (current_buffer);
507 B_ (current_buffer, directory) = B_ (old, directory); 507 BVAR (current_buffer, directory) = BVAR (old, directory);
508 B_ (current_buffer, read_only) = Qnil; 508 BVAR (current_buffer, read_only) = Qnil;
509 B_ (current_buffer, filename) = Qnil; 509 BVAR (current_buffer, filename) = Qnil;
510 B_ (current_buffer, undo_list) = Qt; 510 BVAR (current_buffer, undo_list) = Qt;
511 eassert (current_buffer->overlays_before == NULL); 511 eassert (current_buffer->overlays_before == NULL);
512 eassert (current_buffer->overlays_after == NULL); 512 eassert (current_buffer->overlays_after == NULL);
513 B_ (current_buffer, enable_multibyte_characters) 513 BVAR (current_buffer, enable_multibyte_characters)
514 = B_ (&buffer_defaults, enable_multibyte_characters); 514 = BVAR (&buffer_defaults, enable_multibyte_characters);
515 specbind (Qinhibit_read_only, Qt); 515 specbind (Qinhibit_read_only, Qt);
516 specbind (Qinhibit_modification_hooks, Qt); 516 specbind (Qinhibit_modification_hooks, Qt);
517 Ferase_buffer (); 517 Ferase_buffer ();
@@ -1856,7 +1856,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1856 if (!NILP (XWINDOW (obj)->buffer)) 1856 if (!NILP (XWINDOW (obj)->buffer))
1857 { 1857 {
1858 strout (" on ", -1, -1, printcharfun, 0); 1858 strout (" on ", -1, -1, printcharfun, 0);
1859 print_string (B_ (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun); 1859 print_string (BVAR (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun);
1860 } 1860 }
1861 PRINTCHAR ('>'); 1861 PRINTCHAR ('>');
1862 } 1862 }
@@ -1957,16 +1957,16 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1957 } 1957 }
1958 else if (BUFFERP (obj)) 1958 else if (BUFFERP (obj))
1959 { 1959 {
1960 if (NILP (B_ (XBUFFER (obj), name))) 1960 if (NILP (BVAR (XBUFFER (obj), name)))
1961 strout ("#<killed buffer>", -1, -1, printcharfun, 0); 1961 strout ("#<killed buffer>", -1, -1, printcharfun, 0);
1962 else if (escapeflag) 1962 else if (escapeflag)
1963 { 1963 {
1964 strout ("#<buffer ", -1, -1, printcharfun, 0); 1964 strout ("#<buffer ", -1, -1, printcharfun, 0);
1965 print_string (B_ (XBUFFER (obj), name), printcharfun); 1965 print_string (BVAR (XBUFFER (obj), name), printcharfun);
1966 PRINTCHAR ('>'); 1966 PRINTCHAR ('>');
1967 } 1967 }
1968 else 1968 else
1969 print_string (B_ (XBUFFER (obj), name), printcharfun); 1969 print_string (BVAR (XBUFFER (obj), name), printcharfun);
1970 } 1970 }
1971 else if (WINDOW_CONFIGURATIONP (obj)) 1971 else if (WINDOW_CONFIGURATIONP (obj))
1972 { 1972 {
@@ -2078,7 +2078,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
2078 sprintf (buf, "at %ld", (long)marker_position (obj)); 2078 sprintf (buf, "at %ld", (long)marker_position (obj));
2079 strout (buf, -1, -1, printcharfun, 0); 2079 strout (buf, -1, -1, printcharfun, 0);
2080 strout (" in ", -1, -1, printcharfun, 0); 2080 strout (" in ", -1, -1, printcharfun, 0);
2081 print_string (B_ (XMARKER (obj)->buffer, name), printcharfun); 2081 print_string (BVAR (XMARKER (obj)->buffer, name), printcharfun);
2082 } 2082 }
2083 PRINTCHAR ('>'); 2083 PRINTCHAR ('>');
2084 break; 2084 break;
@@ -2093,7 +2093,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
2093 (long)marker_position (OVERLAY_START (obj)), 2093 (long)marker_position (OVERLAY_START (obj)),
2094 (long)marker_position (OVERLAY_END (obj))); 2094 (long)marker_position (OVERLAY_END (obj)));
2095 strout (buf, -1, -1, printcharfun, 0); 2095 strout (buf, -1, -1, printcharfun, 0);
2096 print_string (B_ (XMARKER (OVERLAY_START (obj))->buffer, name), 2096 print_string (BVAR (XMARKER (OVERLAY_START (obj))->buffer, name),
2097 printcharfun); 2097 printcharfun);
2098 } 2098 }
2099 PRINTCHAR ('>'); 2099 PRINTCHAR ('>');
diff --git a/src/process.c b/src/process.c
index ec929a919f8..4a145f7376a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -719,7 +719,7 @@ get_process (register Lisp_Object name)
719 { 719 {
720 proc = Fget_buffer_process (obj); 720 proc = Fget_buffer_process (obj);
721 if (NILP (proc)) 721 if (NILP (proc))
722 error ("Buffer %s has no process", SDATA (B_ (XBUFFER (obj), name))); 722 error ("Buffer %s has no process", SDATA (BVAR (XBUFFER (obj), name)));
723 } 723 }
724 else 724 else
725 { 725 {
@@ -1283,12 +1283,12 @@ list_processes_1 (Lisp_Object query_only)
1283 w_proc = i; 1283 w_proc = i;
1284 if (!NILP (p->buffer)) 1284 if (!NILP (p->buffer))
1285 { 1285 {
1286 if (NILP (B_ (XBUFFER (p->buffer), name))) 1286 if (NILP (BVAR (XBUFFER (p->buffer), name)))
1287 { 1287 {
1288 if (w_buffer < 8) 1288 if (w_buffer < 8)
1289 w_buffer = 8; /* (Killed) */ 1289 w_buffer = 8; /* (Killed) */
1290 } 1290 }
1291 else if ((i = SCHARS (B_ (XBUFFER (p->buffer), name)), (i > w_buffer))) 1291 else if ((i = SCHARS (BVAR (XBUFFER (p->buffer), name)), (i > w_buffer)))
1292 w_buffer = i; 1292 w_buffer = i;
1293 } 1293 }
1294 if (STRINGP (p->tty_name) 1294 if (STRINGP (p->tty_name)
@@ -1312,9 +1312,9 @@ list_processes_1 (Lisp_Object query_only)
1312 XSETFASTINT (minspace, 1); 1312 XSETFASTINT (minspace, 1);
1313 1313
1314 set_buffer_internal (XBUFFER (Vstandard_output)); 1314 set_buffer_internal (XBUFFER (Vstandard_output));
1315 B_ (current_buffer, undo_list) = Qt; 1315 BVAR (current_buffer, undo_list) = Qt;
1316 1316
1317 B_ (current_buffer, truncate_lines) = Qt; 1317 BVAR (current_buffer, truncate_lines) = Qt;
1318 1318
1319 write_string ("Proc", -1); 1319 write_string ("Proc", -1);
1320 Findent_to (i_status, minspace); write_string ("Status", -1); 1320 Findent_to (i_status, minspace); write_string ("Status", -1);
@@ -1397,10 +1397,10 @@ list_processes_1 (Lisp_Object query_only)
1397 Findent_to (i_buffer, minspace); 1397 Findent_to (i_buffer, minspace);
1398 if (NILP (p->buffer)) 1398 if (NILP (p->buffer))
1399 insert_string ("(none)"); 1399 insert_string ("(none)");
1400 else if (NILP (B_ (XBUFFER (p->buffer), name))) 1400 else if (NILP (BVAR (XBUFFER (p->buffer), name)))
1401 insert_string ("(Killed)"); 1401 insert_string ("(Killed)");
1402 else 1402 else
1403 Finsert (1, &B_ (XBUFFER (p->buffer), name)); 1403 Finsert (1, &BVAR (XBUFFER (p->buffer), name));
1404 1404
1405 if (!NILP (i_tty)) 1405 if (!NILP (i_tty))
1406 { 1406 {
@@ -1548,7 +1548,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1548 { 1548 {
1549 struct gcpro gcpro1, gcpro2; 1549 struct gcpro gcpro1, gcpro2;
1550 1550
1551 current_dir = B_ (current_buffer, directory); 1551 current_dir = BVAR (current_buffer, directory);
1552 1552
1553 GCPRO2 (buffer, current_dir); 1553 GCPRO2 (buffer, current_dir);
1554 1554
@@ -1560,7 +1560,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1560 current_dir = expand_and_dir_to_file (current_dir, Qnil); 1560 current_dir = expand_and_dir_to_file (current_dir, Qnil);
1561 if (NILP (Ffile_accessible_directory_p (current_dir))) 1561 if (NILP (Ffile_accessible_directory_p (current_dir)))
1562 report_file_error ("Setting current directory", 1562 report_file_error ("Setting current directory",
1563 Fcons (B_ (current_buffer, directory), Qnil)); 1563 Fcons (BVAR (current_buffer, directory), Qnil));
1564 1564
1565 UNGCPRO; 1565 UNGCPRO;
1566 } 1566 }
@@ -2898,8 +2898,8 @@ usage: (make-serial-process &rest ARGS) */)
2898 } 2898 }
2899 else if (!NILP (Vcoding_system_for_read)) 2899 else if (!NILP (Vcoding_system_for_read))
2900 val = Vcoding_system_for_read; 2900 val = Vcoding_system_for_read;
2901 else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) 2901 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
2902 || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) 2902 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
2903 val = Qnil; 2903 val = Qnil;
2904 p->decode_coding_system = val; 2904 p->decode_coding_system = val;
2905 2905
@@ -2912,8 +2912,8 @@ usage: (make-serial-process &rest ARGS) */)
2912 } 2912 }
2913 else if (!NILP (Vcoding_system_for_write)) 2913 else if (!NILP (Vcoding_system_for_write))
2914 val = Vcoding_system_for_write; 2914 val = Vcoding_system_for_write;
2915 else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) 2915 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
2916 || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) 2916 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
2917 val = Qnil; 2917 val = Qnil;
2918 p->encode_coding_system = val; 2918 p->encode_coding_system = val;
2919 2919
@@ -3723,8 +3723,8 @@ usage: (make-network-process &rest ARGS) */)
3723 } 3723 }
3724 else if (!NILP (Vcoding_system_for_read)) 3724 else if (!NILP (Vcoding_system_for_read))
3725 val = Vcoding_system_for_read; 3725 val = Vcoding_system_for_read;
3726 else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) 3726 else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters)))
3727 || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) 3727 || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
3728 /* We dare not decode end-of-line format by setting VAL to 3728 /* We dare not decode end-of-line format by setting VAL to
3729 Qraw_text, because the existing Emacs Lisp libraries 3729 Qraw_text, because the existing Emacs Lisp libraries
3730 assume that they receive bare code including a sequene of 3730 assume that they receive bare code including a sequene of
@@ -3759,7 +3759,7 @@ usage: (make-network-process &rest ARGS) */)
3759 } 3759 }
3760 else if (!NILP (Vcoding_system_for_write)) 3760 else if (!NILP (Vcoding_system_for_write))
3761 val = Vcoding_system_for_write; 3761 val = Vcoding_system_for_write;
3762 else if (NILP (B_ (current_buffer, enable_multibyte_characters))) 3762 else if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
3763 val = Qnil; 3763 val = Qnil;
3764 else 3764 else
3765 { 3765 {
@@ -5268,7 +5268,7 @@ read_process_output (Lisp_Object proc, register int channel)
5268 /* No need to gcpro these, because all we do with them later 5268 /* No need to gcpro these, because all we do with them later
5269 is test them for EQness, and none of them should be a string. */ 5269 is test them for EQness, and none of them should be a string. */
5270 XSETBUFFER (obuffer, current_buffer); 5270 XSETBUFFER (obuffer, current_buffer);
5271 okeymap = B_ (current_buffer, keymap); 5271 okeymap = BVAR (current_buffer, keymap);
5272 5272
5273 /* We inhibit quit here instead of just catching it so that 5273 /* We inhibit quit here instead of just catching it so that
5274 hitting ^G when a filter happens to be running won't screw 5274 hitting ^G when a filter happens to be running won't screw
@@ -5359,7 +5359,7 @@ read_process_output (Lisp_Object proc, register int channel)
5359 } 5359 }
5360 5360
5361 /* If no filter, write into buffer if it isn't dead. */ 5361 /* If no filter, write into buffer if it isn't dead. */
5362 else if (!NILP (p->buffer) && !NILP (B_ (XBUFFER (p->buffer), name))) 5362 else if (!NILP (p->buffer) && !NILP (BVAR (XBUFFER (p->buffer), name)))
5363 { 5363 {
5364 Lisp_Object old_read_only; 5364 Lisp_Object old_read_only;
5365 EMACS_INT old_begv, old_zv; 5365 EMACS_INT old_begv, old_zv;
@@ -5372,13 +5372,13 @@ read_process_output (Lisp_Object proc, register int channel)
5372 Fset_buffer (p->buffer); 5372 Fset_buffer (p->buffer);
5373 opoint = PT; 5373 opoint = PT;
5374 opoint_byte = PT_BYTE; 5374 opoint_byte = PT_BYTE;
5375 old_read_only = B_ (current_buffer, read_only); 5375 old_read_only = BVAR (current_buffer, read_only);
5376 old_begv = BEGV; 5376 old_begv = BEGV;
5377 old_zv = ZV; 5377 old_zv = ZV;
5378 old_begv_byte = BEGV_BYTE; 5378 old_begv_byte = BEGV_BYTE;
5379 old_zv_byte = ZV_BYTE; 5379 old_zv_byte = ZV_BYTE;
5380 5380
5381 B_ (current_buffer, read_only) = Qnil; 5381 BVAR (current_buffer, read_only) = Qnil;
5382 5382
5383 /* Insert new output into buffer 5383 /* Insert new output into buffer
5384 at the current end-of-output marker, 5384 at the current end-of-output marker,
@@ -5423,7 +5423,7 @@ read_process_output (Lisp_Object proc, register int channel)
5423 p->decoding_carryover = coding->carryover_bytes; 5423 p->decoding_carryover = coding->carryover_bytes;
5424 } 5424 }
5425 /* Adjust the multibyteness of TEXT to that of the buffer. */ 5425 /* Adjust the multibyteness of TEXT to that of the buffer. */
5426 if (NILP (B_ (current_buffer, enable_multibyte_characters)) 5426 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
5427 != ! STRING_MULTIBYTE (text)) 5427 != ! STRING_MULTIBYTE (text))
5428 text = (STRING_MULTIBYTE (text) 5428 text = (STRING_MULTIBYTE (text)
5429 ? Fstring_as_unibyte (text) 5429 ? Fstring_as_unibyte (text)
@@ -5467,7 +5467,7 @@ read_process_output (Lisp_Object proc, register int channel)
5467 Fnarrow_to_region (make_number (old_begv), make_number (old_zv)); 5467 Fnarrow_to_region (make_number (old_begv), make_number (old_zv));
5468 5468
5469 5469
5470 B_ (current_buffer, read_only) = old_read_only; 5470 BVAR (current_buffer, read_only) = old_read_only;
5471 SET_PT_BOTH (opoint, opoint_byte); 5471 SET_PT_BOTH (opoint, opoint_byte);
5472 } 5472 }
5473 /* Handling the process output should not deactivate the mark. */ 5473 /* Handling the process output should not deactivate the mark. */
@@ -5525,7 +5525,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5525 5525
5526 if ((STRINGP (object) && STRING_MULTIBYTE (object)) 5526 if ((STRINGP (object) && STRING_MULTIBYTE (object))
5527 || (BUFFERP (object) 5527 || (BUFFERP (object)
5528 && !NILP (B_ (XBUFFER (object), enable_multibyte_characters))) 5528 && !NILP (BVAR (XBUFFER (object), enable_multibyte_characters)))
5529 || EQ (object, Qt)) 5529 || EQ (object, Qt))
5530 { 5530 {
5531 p->encode_coding_system 5531 p->encode_coding_system
@@ -6564,7 +6564,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6564 is test them for EQness, and none of them should be a string. */ 6564 is test them for EQness, and none of them should be a string. */
6565 odeactivate = Vdeactivate_mark; 6565 odeactivate = Vdeactivate_mark;
6566 XSETBUFFER (obuffer, current_buffer); 6566 XSETBUFFER (obuffer, current_buffer);
6567 okeymap = B_ (current_buffer, keymap); 6567 okeymap = BVAR (current_buffer, keymap);
6568 6568
6569 /* There's no good reason to let sentinels change the current 6569 /* There's no good reason to let sentinels change the current
6570 buffer, and many callers of accept-process-output, sit-for, and 6570 buffer, and many callers of accept-process-output, sit-for, and
@@ -6714,7 +6714,7 @@ status_notify (struct Lisp_Process *deleting_process)
6714 6714
6715 /* Avoid error if buffer is deleted 6715 /* Avoid error if buffer is deleted
6716 (probably that's why the process is dead, too) */ 6716 (probably that's why the process is dead, too) */
6717 if (NILP (B_ (XBUFFER (buffer), name))) 6717 if (NILP (BVAR (XBUFFER (buffer), name)))
6718 continue; 6718 continue;
6719 Fset_buffer (buffer); 6719 Fset_buffer (buffer);
6720 6720
@@ -6731,13 +6731,13 @@ status_notify (struct Lisp_Process *deleting_process)
6731 before = PT; 6731 before = PT;
6732 before_byte = PT_BYTE; 6732 before_byte = PT_BYTE;
6733 6733
6734 tem = B_ (current_buffer, read_only); 6734 tem = BVAR (current_buffer, read_only);
6735 B_ (current_buffer, read_only) = Qnil; 6735 BVAR (current_buffer, read_only) = Qnil;
6736 insert_string ("\nProcess "); 6736 insert_string ("\nProcess ");
6737 Finsert (1, &p->name); 6737 Finsert (1, &p->name);
6738 insert_string (" "); 6738 insert_string (" ");
6739 Finsert (1, &msg); 6739 Finsert (1, &msg);
6740 B_ (current_buffer, read_only) = tem; 6740 BVAR (current_buffer, read_only) = tem;
6741 set_marker_both (p->mark, p->buffer, PT, PT_BYTE); 6741 set_marker_both (p->mark, p->buffer, PT, PT_BYTE);
6742 6742
6743 if (opoint >= before) 6743 if (opoint >= before)
@@ -7136,7 +7136,7 @@ setup_process_coding_systems (Lisp_Object process)
7136 ; 7136 ;
7137 else if (BUFFERP (p->buffer)) 7137 else if (BUFFERP (p->buffer))
7138 { 7138 {
7139 if (NILP (B_ (XBUFFER (p->buffer), enable_multibyte_characters))) 7139 if (NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters)))
7140 coding_system = raw_text_coding_system (coding_system); 7140 coding_system = raw_text_coding_system (coding_system);
7141 } 7141 }
7142 setup_coding_system (coding_system, proc_decode_coding_system[inch]); 7142 setup_coding_system (coding_system, proc_decode_coding_system[inch]);
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 34814687597..8b189baea46 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -181,8 +181,6 @@ struct sigaction {
181#define HAVE_MENUS 1 181#define HAVE_MENUS 1
182#endif 182#endif
183 183
184#define MODE_LINE_BINARY_TEXT(_b_) (NILP (B_(_b_,buffer_file_type)) ? "T" : "B")
185
186/* Get some redefinitions in place. */ 184/* Get some redefinitions in place. */
187 185
188#ifdef emacs 186#ifdef emacs
@@ -348,6 +346,8 @@ extern char *get_emacs_configuration_options (void);
348#endif 346#endif
349#include <string.h> 347#include <string.h>
350 348
349extern int getloadavg (double *, int);
350
351/* We need a little extra space, see ../../lisp/loadup.el. */ 351/* We need a little extra space, see ../../lisp/loadup.el. */
352#define SYSTEM_PURESIZE_EXTRA 50000 352#define SYSTEM_PURESIZE_EXTRA 50000
353 353
diff --git a/src/search.c b/src/search.c
index a80e20a8a8a..1e2036f6dc2 100644
--- a/src/search.c
+++ b/src/search.c
@@ -157,7 +157,7 @@ compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object tra
157 157
158 /* If the compiled pattern hard codes some of the contents of the 158 /* If the compiled pattern hard codes some of the contents of the
159 syntax-table, it can only be reused with *this* syntax table. */ 159 syntax-table, it can only be reused with *this* syntax table. */
160 cp->syntax_table = cp->buf.used_syntax ? B_ (current_buffer, syntax_table) : Qt; 160 cp->syntax_table = cp->buf.used_syntax ? BVAR (current_buffer, syntax_table) : Qt;
161 161
162 re_set_whitespace_regexp (NULL); 162 re_set_whitespace_regexp (NULL);
163 163
@@ -236,7 +236,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object tra
236 && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) 236 && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0)))
237 && cp->posix == posix 237 && cp->posix == posix
238 && (EQ (cp->syntax_table, Qt) 238 && (EQ (cp->syntax_table, Qt)
239 || EQ (cp->syntax_table, B_ (current_buffer, syntax_table))) 239 || EQ (cp->syntax_table, BVAR (current_buffer, syntax_table)))
240 && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp)) 240 && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp))
241 && cp->buf.charset_unibyte == charset_unibyte) 241 && cp->buf.charset_unibyte == charset_unibyte)
242 break; 242 break;
@@ -285,17 +285,17 @@ looking_at_1 (Lisp_Object string, int posix)
285 save_search_regs (); 285 save_search_regs ();
286 286
287 /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ 287 /* This is so set_image_of_range_1 in regex.c can find the EQV table. */
288 XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] 288 XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2]
289 = B_ (current_buffer, case_eqv_table); 289 = BVAR (current_buffer, case_eqv_table);
290 290
291 CHECK_STRING (string); 291 CHECK_STRING (string);
292 bufp = compile_pattern (string, 292 bufp = compile_pattern (string,
293 (NILP (Vinhibit_changing_match_data) 293 (NILP (Vinhibit_changing_match_data)
294 ? &search_regs : NULL), 294 ? &search_regs : NULL),
295 (!NILP (B_ (current_buffer, case_fold_search)) 295 (!NILP (BVAR (current_buffer, case_fold_search))
296 ? B_ (current_buffer, case_canon_table) : Qnil), 296 ? BVAR (current_buffer, case_canon_table) : Qnil),
297 posix, 297 posix,
298 !NILP (B_ (current_buffer, enable_multibyte_characters))); 298 !NILP (BVAR (current_buffer, enable_multibyte_characters)));
299 299
300 immediate_quit = 1; 300 immediate_quit = 1;
301 QUIT; /* Do a pending quit right away, to avoid paradoxical behavior */ 301 QUIT; /* Do a pending quit right away, to avoid paradoxical behavior */
@@ -400,14 +400,14 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, int p
400 } 400 }
401 401
402 /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ 402 /* This is so set_image_of_range_1 in regex.c can find the EQV table. */
403 XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] 403 XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2]
404 = B_ (current_buffer, case_eqv_table); 404 = BVAR (current_buffer, case_eqv_table);
405 405
406 bufp = compile_pattern (regexp, 406 bufp = compile_pattern (regexp,
407 (NILP (Vinhibit_changing_match_data) 407 (NILP (Vinhibit_changing_match_data)
408 ? &search_regs : NULL), 408 ? &search_regs : NULL),
409 (!NILP (B_ (current_buffer, case_fold_search)) 409 (!NILP (BVAR (current_buffer, case_fold_search))
410 ? B_ (current_buffer, case_canon_table) : Qnil), 410 ? BVAR (current_buffer, case_canon_table) : Qnil),
411 posix, 411 posix,
412 STRING_MULTIBYTE (string)); 412 STRING_MULTIBYTE (string));
413 immediate_quit = 1; 413 immediate_quit = 1;
@@ -586,7 +586,7 @@ fast_looking_at (Lisp_Object regexp, EMACS_INT pos, EMACS_INT pos_byte, EMACS_IN
586 s2 = 0; 586 s2 = 0;
587 } 587 }
588 re_match_object = Qnil; 588 re_match_object = Qnil;
589 multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 589 multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
590 } 590 }
591 591
592 buf = compile_pattern (regexp, 0, Qnil, 0, multibyte); 592 buf = compile_pattern (regexp, 0, Qnil, 0, multibyte);
@@ -608,7 +608,7 @@ fast_looking_at (Lisp_Object regexp, EMACS_INT pos, EMACS_INT pos_byte, EMACS_IN
608static void 608static void
609newline_cache_on_off (struct buffer *buf) 609newline_cache_on_off (struct buffer *buf)
610{ 610{
611 if (NILP (B_ (buf, cache_long_line_scans))) 611 if (NILP (BVAR (buf, cache_long_line_scans)))
612 { 612 {
613 /* It should be off. */ 613 /* It should be off. */
614 if (buf->newline_cache) 614 if (buf->newline_cache)
@@ -996,15 +996,15 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror,
996 } 996 }
997 997
998 /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ 998 /* This is so set_image_of_range_1 in regex.c can find the EQV table. */
999 XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] 999 XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2]
1000 = B_ (current_buffer, case_eqv_table); 1000 = BVAR (current_buffer, case_eqv_table);
1001 1001
1002 np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE, 1002 np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE,
1003 (!NILP (B_ (current_buffer, case_fold_search)) 1003 (!NILP (BVAR (current_buffer, case_fold_search))
1004 ? B_ (current_buffer, case_canon_table) 1004 ? BVAR (current_buffer, case_canon_table)
1005 : Qnil), 1005 : Qnil),
1006 (!NILP (B_ (current_buffer, case_fold_search)) 1006 (!NILP (BVAR (current_buffer, case_fold_search))
1007 ? B_ (current_buffer, case_eqv_table) 1007 ? BVAR (current_buffer, case_eqv_table)
1008 : Qnil), 1008 : Qnil),
1009 posix); 1009 posix);
1010 if (np <= 0) 1010 if (np <= 0)
@@ -1133,7 +1133,7 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
1133 (NILP (Vinhibit_changing_match_data) 1133 (NILP (Vinhibit_changing_match_data)
1134 ? &search_regs : &search_regs_1), 1134 ? &search_regs : &search_regs_1),
1135 trt, posix, 1135 trt, posix,
1136 !NILP (B_ (current_buffer, enable_multibyte_characters))); 1136 !NILP (BVAR (current_buffer, enable_multibyte_characters)));
1137 1137
1138 immediate_quit = 1; /* Quit immediately if user types ^G, 1138 immediate_quit = 1; /* Quit immediately if user types ^G,
1139 because letting this function finish 1139 because letting this function finish
@@ -1254,7 +1254,7 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
1254 EMACS_INT raw_pattern_size; 1254 EMACS_INT raw_pattern_size;
1255 EMACS_INT raw_pattern_size_byte; 1255 EMACS_INT raw_pattern_size_byte;
1256 unsigned char *patbuf; 1256 unsigned char *patbuf;
1257 int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); 1257 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
1258 unsigned char *base_pat; 1258 unsigned char *base_pat;
1259 /* Set to positive if we find a non-ASCII char that need 1259 /* Set to positive if we find a non-ASCII char that need
1260 translation. Otherwise set to zero later. */ 1260 translation. Otherwise set to zero later. */
@@ -1451,7 +1451,7 @@ simple_search (EMACS_INT n, unsigned char *pat,
1451 EMACS_INT pos, EMACS_INT pos_byte, 1451 EMACS_INT pos, EMACS_INT pos_byte,
1452 EMACS_INT lim, EMACS_INT lim_byte) 1452 EMACS_INT lim, EMACS_INT lim_byte)
1453{ 1453{
1454 int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 1454 int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
1455 int forward = n > 0; 1455 int forward = n > 0;
1456 /* Number of buffer bytes matched. Note that this may be different 1456 /* Number of buffer bytes matched. Note that this may be different
1457 from len_byte in a multibyte buffer. */ 1457 from len_byte in a multibyte buffer. */
@@ -1671,7 +1671,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
1671 register EMACS_INT i; 1671 register EMACS_INT i;
1672 register int j; 1672 register int j;
1673 unsigned char *pat, *pat_end; 1673 unsigned char *pat, *pat_end;
1674 int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); 1674 int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
1675 1675
1676 unsigned char simple_translate[0400]; 1676 unsigned char simple_translate[0400];
1677 /* These are set to the preceding bytes of a byte to be translated 1677 /* These are set to the preceding bytes of a byte to be translated
@@ -2639,7 +2639,7 @@ since only regular expressions have distinguished subexpressions. */)
2639 EMACS_INT length = SBYTES (newtext); 2639 EMACS_INT length = SBYTES (newtext);
2640 unsigned char *substed; 2640 unsigned char *substed;
2641 EMACS_INT substed_alloc_size, substed_len; 2641 EMACS_INT substed_alloc_size, substed_len;
2642 int buf_multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); 2642 int buf_multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
2643 int str_multibyte = STRING_MULTIBYTE (newtext); 2643 int str_multibyte = STRING_MULTIBYTE (newtext);
2644 Lisp_Object rev_tbl; 2644 Lisp_Object rev_tbl;
2645 int really_changed = 0; 2645 int really_changed = 0;
diff --git a/src/syntax.c b/src/syntax.c
index 9aa34014f91..707c2c19f31 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -277,7 +277,7 @@ update_syntax_table (EMACS_INT charpos, int count, int init,
277 else 277 else
278 { 278 {
279 gl_state.use_global = 0; 279 gl_state.use_global = 0;
280 gl_state.current_syntax_table = B_ (current_buffer, syntax_table); 280 gl_state.current_syntax_table = BVAR (current_buffer, syntax_table);
281 } 281 }
282 } 282 }
283 283
@@ -363,7 +363,7 @@ char_quoted (EMACS_INT charpos, EMACS_INT bytepos)
363static INLINE EMACS_INT 363static INLINE EMACS_INT
364dec_bytepos (EMACS_INT bytepos) 364dec_bytepos (EMACS_INT bytepos)
365{ 365{
366 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 366 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
367 return bytepos - 1; 367 return bytepos - 1;
368 368
369 DEC_POS (bytepos); 369 DEC_POS (bytepos);
@@ -779,7 +779,7 @@ DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0,
779This is the one specified by the current buffer. */) 779This is the one specified by the current buffer. */)
780 (void) 780 (void)
781{ 781{
782 return B_ (current_buffer, syntax_table); 782 return BVAR (current_buffer, syntax_table);
783} 783}
784 784
785DEFUN ("standard-syntax-table", Fstandard_syntax_table, 785DEFUN ("standard-syntax-table", Fstandard_syntax_table,
@@ -824,7 +824,7 @@ One argument, a syntax table. */)
824{ 824{
825 int idx; 825 int idx;
826 check_syntax_table (table); 826 check_syntax_table (table);
827 B_ (current_buffer, syntax_table) = table; 827 BVAR (current_buffer, syntax_table) = table;
828 /* Indicate that this buffer now has a specified syntax table. */ 828 /* Indicate that this buffer now has a specified syntax table. */
829 idx = PER_BUFFER_VAR_IDX (syntax_table); 829 idx = PER_BUFFER_VAR_IDX (syntax_table);
830 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); 830 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
@@ -1035,7 +1035,7 @@ usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */)
1035 CHECK_CHARACTER (c); 1035 CHECK_CHARACTER (c);
1036 1036
1037 if (NILP (syntax_table)) 1037 if (NILP (syntax_table))
1038 syntax_table = B_ (current_buffer, syntax_table); 1038 syntax_table = BVAR (current_buffer, syntax_table);
1039 else 1039 else
1040 check_syntax_table (syntax_table); 1040 check_syntax_table (syntax_table);
1041 1041
@@ -1450,7 +1450,7 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl
1450 if (XINT (lim) < BEGV) 1450 if (XINT (lim) < BEGV)
1451 XSETFASTINT (lim, BEGV); 1451 XSETFASTINT (lim, BEGV);
1452 1452
1453 multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters)) 1453 multibyte = (!NILP (BVAR (current_buffer, enable_multibyte_characters))
1454 && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); 1454 && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
1455 string_multibyte = SBYTES (string) > SCHARS (string); 1455 string_multibyte = SBYTES (string) > SCHARS (string);
1456 1456
@@ -1936,7 +1936,7 @@ skip_syntaxes (int forwardp, Lisp_Object string, Lisp_Object lim)
1936 if (forwardp ? (PT >= XFASTINT (lim)) : (PT <= XFASTINT (lim))) 1936 if (forwardp ? (PT >= XFASTINT (lim)) : (PT <= XFASTINT (lim)))
1937 return make_number (0); 1937 return make_number (0);
1938 1938
1939 multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters)) 1939 multibyte = (!NILP (BVAR (current_buffer, enable_multibyte_characters))
1940 && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); 1940 && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
1941 1941
1942 memset (fastmap, 0, sizeof fastmap); 1942 memset (fastmap, 0, sizeof fastmap);
@@ -2703,7 +2703,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
2703 while (from > stop) 2703 while (from > stop)
2704 { 2704 {
2705 temp_pos = from_byte; 2705 temp_pos = from_byte;
2706 if (! NILP (B_ (current_buffer, enable_multibyte_characters))) 2706 if (! NILP (BVAR (current_buffer, enable_multibyte_characters)))
2707 DEC_POS (temp_pos); 2707 DEC_POS (temp_pos);
2708 else 2708 else
2709 temp_pos--; 2709 temp_pos--;
diff --git a/src/syntax.h b/src/syntax.h
index 75937a7c121..e8726bb28a4 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -24,7 +24,7 @@ extern void update_syntax_table (EMACS_INT, int, int, Lisp_Object);
24 24
25/* The standard syntax table is stored where it will automatically 25/* The standard syntax table is stored where it will automatically
26 be used in all new buffers. */ 26 be used in all new buffers. */
27#define Vstandard_syntax_table B_ (&buffer_defaults, syntax_table) 27#define Vstandard_syntax_table BVAR (&buffer_defaults, syntax_table)
28 28
29/* A syntax table is a chartable whose elements are cons cells 29/* A syntax table is a chartable whose elements are cons cells
30 (CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char 30 (CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char
@@ -79,7 +79,7 @@ enum syntaxcode
79# define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table 79# define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table
80#else 80#else
81# define SYNTAX_ENTRY SYNTAX_ENTRY_INT 81# define SYNTAX_ENTRY SYNTAX_ENTRY_INT
82# define CURRENT_SYNTAX_TABLE B_ (current_buffer, syntax_table) 82# define CURRENT_SYNTAX_TABLE BVAR (current_buffer, syntax_table)
83#endif 83#endif
84 84
85#define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c)) 85#define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c))
@@ -204,7 +204,7 @@ extern char syntax_code_spec[16];
204do \ 204do \
205 { \ 205 { \
206 gl_state.use_global = 0; \ 206 gl_state.use_global = 0; \
207 gl_state.current_syntax_table = B_ (current_buffer, syntax_table); \ 207 gl_state.current_syntax_table = BVAR (current_buffer, syntax_table); \
208 } while (0) 208 } while (0)
209 209
210/* This macro should be called with FROM at the start of forward 210/* This macro should be called with FROM at the start of forward
diff --git a/src/term.c b/src/term.c
index 1aefe02421f..f082bb40e89 100644
--- a/src/term.c
+++ b/src/term.c
@@ -112,10 +112,7 @@ static void vfatal (const char *str, va_list ap) NO_RETURN;
112#define OUTPUT_IF(tty, a) \ 112#define OUTPUT_IF(tty, a) \
113 do { \ 113 do { \
114 if (a) \ 114 if (a) \
115 emacs_tputs ((tty), a, \ 115 OUTPUT (tty, a); \
116 (int) (FRAME_LINES (XFRAME (selected_frame)) \
117 - curY (tty) ), \
118 cmputc); \
119 } while (0) 116 } while (0)
120 117
121#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0) 118#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0)
@@ -1350,14 +1347,14 @@ term_get_fkeys_1 (void)
1350 KBOARD *kboard = term_get_fkeys_kboard; 1347 KBOARD *kboard = term_get_fkeys_kboard;
1351 1348
1352 /* This can happen if CANNOT_DUMP or with strange options. */ 1349 /* This can happen if CANNOT_DUMP or with strange options. */
1353 if (!KEYMAPP (kboard->Vinput_decode_map)) 1350 if (!KEYMAPP (KVAR (kboard, Vinput_decode_map)))
1354 kboard->Vinput_decode_map = Fmake_sparse_keymap (Qnil); 1351 KVAR (kboard, Vinput_decode_map) = Fmake_sparse_keymap (Qnil);
1355 1352
1356 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++) 1353 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
1357 { 1354 {
1358 char *sequence = tgetstr (keys[i].cap, address); 1355 char *sequence = tgetstr (keys[i].cap, address);
1359 if (sequence) 1356 if (sequence)
1360 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), 1357 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence),
1361 Fmake_vector (make_number (1), 1358 Fmake_vector (make_number (1),
1362 intern (keys[i].name))); 1359 intern (keys[i].name)));
1363 } 1360 }
@@ -1377,13 +1374,13 @@ term_get_fkeys_1 (void)
1377 if (k0) 1374 if (k0)
1378 /* Define f0 first, so that f10 takes precedence in case the 1375 /* Define f0 first, so that f10 takes precedence in case the
1379 key sequences happens to be the same. */ 1376 key sequences happens to be the same. */
1380 Fdefine_key (kboard->Vinput_decode_map, build_string (k0), 1377 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0),
1381 Fmake_vector (make_number (1), intern ("f0"))); 1378 Fmake_vector (make_number (1), intern ("f0")));
1382 Fdefine_key (kboard->Vinput_decode_map, build_string (k_semi), 1379 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k_semi),
1383 Fmake_vector (make_number (1), intern ("f10"))); 1380 Fmake_vector (make_number (1), intern ("f10")));
1384 } 1381 }
1385 else if (k0) 1382 else if (k0)
1386 Fdefine_key (kboard->Vinput_decode_map, build_string (k0), 1383 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0),
1387 Fmake_vector (make_number (1), intern (k0_name))); 1384 Fmake_vector (make_number (1), intern (k0_name)));
1388 } 1385 }
1389 1386
@@ -1406,7 +1403,7 @@ term_get_fkeys_1 (void)
1406 if (sequence) 1403 if (sequence)
1407 { 1404 {
1408 sprintf (fkey, "f%d", i); 1405 sprintf (fkey, "f%d", i);
1409 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), 1406 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence),
1410 Fmake_vector (make_number (1), 1407 Fmake_vector (make_number (1),
1411 intern (fkey))); 1408 intern (fkey)));
1412 } 1409 }
@@ -1423,7 +1420,7 @@ term_get_fkeys_1 (void)
1423 { \ 1420 { \
1424 char *sequence = tgetstr (cap2, address); \ 1421 char *sequence = tgetstr (cap2, address); \
1425 if (sequence) \ 1422 if (sequence) \
1426 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), \ 1423 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence), \
1427 Fmake_vector (make_number (1), \ 1424 Fmake_vector (make_number (1), \
1428 intern (sym))); \ 1425 intern (sym))); \
1429 } 1426 }
@@ -3418,7 +3415,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3418 3415
3419 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 3416 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
3420 init_kboard (terminal->kboard); 3417 init_kboard (terminal->kboard);
3421 terminal->kboard->Vwindow_system = Qnil; 3418 KVAR (terminal->kboard, Vwindow_system) = Qnil;
3422 terminal->kboard->next_kboard = all_kboards; 3419 terminal->kboard->next_kboard = all_kboards;
3423 all_kboards = terminal->kboard; 3420 all_kboards = terminal->kboard;
3424 terminal->kboard->reference_count++; 3421 terminal->kboard->reference_count++;
diff --git a/src/undo.c b/src/undo.c
index f6953fabfec..d11cd6f5570 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -73,12 +73,12 @@ record_point (EMACS_INT pt)
73 Fundo_boundary (); 73 Fundo_boundary ();
74 last_undo_buffer = current_buffer; 74 last_undo_buffer = current_buffer;
75 75
76 if (CONSP (B_ (current_buffer, undo_list))) 76 if (CONSP (BVAR (current_buffer, undo_list)))
77 { 77 {
78 /* Set AT_BOUNDARY to 1 only when we have nothing other than 78 /* Set AT_BOUNDARY to 1 only when we have nothing other than
79 marker adjustment before undo boundary. */ 79 marker adjustment before undo boundary. */
80 80
81 Lisp_Object tail = B_ (current_buffer, undo_list), elt; 81 Lisp_Object tail = BVAR (current_buffer, undo_list), elt;
82 82
83 while (1) 83 while (1)
84 { 84 {
@@ -103,8 +103,8 @@ record_point (EMACS_INT pt)
103 if (at_boundary 103 if (at_boundary
104 && current_buffer == last_boundary_buffer 104 && current_buffer == last_boundary_buffer
105 && last_boundary_position != pt) 105 && last_boundary_position != pt)
106 B_ (current_buffer, undo_list) 106 BVAR (current_buffer, undo_list)
107 = Fcons (make_number (last_boundary_position), B_ (current_buffer, undo_list)); 107 = Fcons (make_number (last_boundary_position), BVAR (current_buffer, undo_list));
108} 108}
109 109
110/* Record an insertion that just happened or is about to happen, 110/* Record an insertion that just happened or is about to happen,
@@ -117,17 +117,17 @@ record_insert (EMACS_INT beg, EMACS_INT length)
117{ 117{
118 Lisp_Object lbeg, lend; 118 Lisp_Object lbeg, lend;
119 119
120 if (EQ (B_ (current_buffer, undo_list), Qt)) 120 if (EQ (BVAR (current_buffer, undo_list), Qt))
121 return; 121 return;
122 122
123 record_point (beg); 123 record_point (beg);
124 124
125 /* If this is following another insertion and consecutive with it 125 /* If this is following another insertion and consecutive with it
126 in the buffer, combine the two. */ 126 in the buffer, combine the two. */
127 if (CONSP (B_ (current_buffer, undo_list))) 127 if (CONSP (BVAR (current_buffer, undo_list)))
128 { 128 {
129 Lisp_Object elt; 129 Lisp_Object elt;
130 elt = XCAR (B_ (current_buffer, undo_list)); 130 elt = XCAR (BVAR (current_buffer, undo_list));
131 if (CONSP (elt) 131 if (CONSP (elt)
132 && INTEGERP (XCAR (elt)) 132 && INTEGERP (XCAR (elt))
133 && INTEGERP (XCDR (elt)) 133 && INTEGERP (XCDR (elt))
@@ -140,8 +140,8 @@ record_insert (EMACS_INT beg, EMACS_INT length)
140 140
141 XSETFASTINT (lbeg, beg); 141 XSETFASTINT (lbeg, beg);
142 XSETINT (lend, beg + length); 142 XSETINT (lend, beg + length);
143 B_ (current_buffer, undo_list) = Fcons (Fcons (lbeg, lend), 143 BVAR (current_buffer, undo_list) = Fcons (Fcons (lbeg, lend),
144 B_ (current_buffer, undo_list)); 144 BVAR (current_buffer, undo_list));
145} 145}
146 146
147/* Record that a deletion is about to take place, 147/* Record that a deletion is about to take place,
@@ -152,7 +152,7 @@ record_delete (EMACS_INT beg, Lisp_Object string)
152{ 152{
153 Lisp_Object sbeg; 153 Lisp_Object sbeg;
154 154
155 if (EQ (B_ (current_buffer, undo_list), Qt)) 155 if (EQ (BVAR (current_buffer, undo_list), Qt))
156 return; 156 return;
157 157
158 if (PT == beg + SCHARS (string)) 158 if (PT == beg + SCHARS (string))
@@ -166,8 +166,8 @@ record_delete (EMACS_INT beg, Lisp_Object string)
166 record_point (beg); 166 record_point (beg);
167 } 167 }
168 168
169 B_ (current_buffer, undo_list) 169 BVAR (current_buffer, undo_list)
170 = Fcons (Fcons (string, sbeg), B_ (current_buffer, undo_list)); 170 = Fcons (Fcons (string, sbeg), BVAR (current_buffer, undo_list));
171} 171}
172 172
173/* Record the fact that MARKER is about to be adjusted by ADJUSTMENT. 173/* Record the fact that MARKER is about to be adjusted by ADJUSTMENT.
@@ -178,7 +178,7 @@ record_delete (EMACS_INT beg, Lisp_Object string)
178void 178void
179record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment) 179record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment)
180{ 180{
181 if (EQ (B_ (current_buffer, undo_list), Qt)) 181 if (EQ (BVAR (current_buffer, undo_list), Qt))
182 return; 182 return;
183 183
184 /* Allocate a cons cell to be the undo boundary after this command. */ 184 /* Allocate a cons cell to be the undo boundary after this command. */
@@ -189,9 +189,9 @@ record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment)
189 Fundo_boundary (); 189 Fundo_boundary ();
190 last_undo_buffer = current_buffer; 190 last_undo_buffer = current_buffer;
191 191
192 B_ (current_buffer, undo_list) 192 BVAR (current_buffer, undo_list)
193 = Fcons (Fcons (marker, make_number (adjustment)), 193 = Fcons (Fcons (marker, make_number (adjustment)),
194 B_ (current_buffer, undo_list)); 194 BVAR (current_buffer, undo_list));
195} 195}
196 196
197/* Record that a replacement is about to take place, 197/* Record that a replacement is about to take place,
@@ -215,7 +215,7 @@ record_first_change (void)
215 Lisp_Object high, low; 215 Lisp_Object high, low;
216 struct buffer *base_buffer = current_buffer; 216 struct buffer *base_buffer = current_buffer;
217 217
218 if (EQ (B_ (current_buffer, undo_list), Qt)) 218 if (EQ (BVAR (current_buffer, undo_list), Qt))
219 return; 219 return;
220 220
221 if (current_buffer != last_undo_buffer) 221 if (current_buffer != last_undo_buffer)
@@ -227,7 +227,7 @@ record_first_change (void)
227 227
228 XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff); 228 XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff);
229 XSETFASTINT (low, base_buffer->modtime & 0xffff); 229 XSETFASTINT (low, base_buffer->modtime & 0xffff);
230 B_ (current_buffer, undo_list) = Fcons (Fcons (Qt, Fcons (high, low)), B_ (current_buffer, undo_list)); 230 BVAR (current_buffer, undo_list) = Fcons (Fcons (Qt, Fcons (high, low)), BVAR (current_buffer, undo_list));
231} 231}
232 232
233/* Record a change in property PROP (whose old value was VAL) 233/* Record a change in property PROP (whose old value was VAL)
@@ -242,7 +242,7 @@ record_property_change (EMACS_INT beg, EMACS_INT length,
242 struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer); 242 struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer);
243 int boundary = 0; 243 int boundary = 0;
244 244
245 if (EQ (B_ (buf, undo_list), Qt)) 245 if (EQ (BVAR (buf, undo_list), Qt))
246 return; 246 return;
247 247
248 /* Allocate a cons cell to be the undo boundary after this command. */ 248 /* Allocate a cons cell to be the undo boundary after this command. */
@@ -265,7 +265,7 @@ record_property_change (EMACS_INT beg, EMACS_INT length,
265 XSETINT (lbeg, beg); 265 XSETINT (lbeg, beg);
266 XSETINT (lend, beg + length); 266 XSETINT (lend, beg + length);
267 entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend)))); 267 entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend))));
268 B_ (current_buffer, undo_list) = Fcons (entry, B_ (current_buffer, undo_list)); 268 BVAR (current_buffer, undo_list) = Fcons (entry, BVAR (current_buffer, undo_list));
269 269
270 current_buffer = obuf; 270 current_buffer = obuf;
271} 271}
@@ -277,9 +277,9 @@ but another undo command will undo to the previous boundary. */)
277 (void) 277 (void)
278{ 278{
279 Lisp_Object tem; 279 Lisp_Object tem;
280 if (EQ (B_ (current_buffer, undo_list), Qt)) 280 if (EQ (BVAR (current_buffer, undo_list), Qt))
281 return Qnil; 281 return Qnil;
282 tem = Fcar (B_ (current_buffer, undo_list)); 282 tem = Fcar (BVAR (current_buffer, undo_list));
283 if (!NILP (tem)) 283 if (!NILP (tem))
284 { 284 {
285 /* One way or another, cons nil onto the front of the undo list. */ 285 /* One way or another, cons nil onto the front of the undo list. */
@@ -287,12 +287,12 @@ but another undo command will undo to the previous boundary. */)
287 { 287 {
288 /* If we have preallocated the cons cell to use here, 288 /* If we have preallocated the cons cell to use here,
289 use that one. */ 289 use that one. */
290 XSETCDR (pending_boundary, B_ (current_buffer, undo_list)); 290 XSETCDR (pending_boundary, BVAR (current_buffer, undo_list));
291 B_ (current_buffer, undo_list) = pending_boundary; 291 BVAR (current_buffer, undo_list) = pending_boundary;
292 pending_boundary = Qnil; 292 pending_boundary = Qnil;
293 } 293 }
294 else 294 else
295 B_ (current_buffer, undo_list) = Fcons (Qnil, B_ (current_buffer, undo_list)); 295 BVAR (current_buffer, undo_list) = Fcons (Qnil, BVAR (current_buffer, undo_list));
296 } 296 }
297 last_boundary_position = PT; 297 last_boundary_position = PT;
298 last_boundary_buffer = current_buffer; 298 last_boundary_buffer = current_buffer;
@@ -321,7 +321,7 @@ truncate_undo_list (struct buffer *b)
321 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 321 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
322 set_buffer_internal (b); 322 set_buffer_internal (b);
323 323
324 list = B_ (b, undo_list); 324 list = BVAR (b, undo_list);
325 325
326 prev = Qnil; 326 prev = Qnil;
327 next = list; 327 next = list;
@@ -433,7 +433,7 @@ truncate_undo_list (struct buffer *b)
433 XSETCDR (last_boundary, Qnil); 433 XSETCDR (last_boundary, Qnil);
434 /* There's nothing we decided to keep, so clear it out. */ 434 /* There's nothing we decided to keep, so clear it out. */
435 else 435 else
436 B_ (b, undo_list) = Qnil; 436 BVAR (b, undo_list) = Qnil;
437 437
438 unbind_to (count, Qnil); 438 unbind_to (count, Qnil);
439} 439}
@@ -470,13 +470,13 @@ Return what remains of the list. */)
470 470
471 /* In a writable buffer, enable undoing read-only text that is so 471 /* In a writable buffer, enable undoing read-only text that is so
472 because of text properties. */ 472 because of text properties. */
473 if (NILP (B_ (current_buffer, read_only))) 473 if (NILP (BVAR (current_buffer, read_only)))
474 specbind (Qinhibit_read_only, Qt); 474 specbind (Qinhibit_read_only, Qt);
475 475
476 /* Don't let `intangible' properties interfere with undo. */ 476 /* Don't let `intangible' properties interfere with undo. */
477 specbind (Qinhibit_point_motion_hooks, Qt); 477 specbind (Qinhibit_point_motion_hooks, Qt);
478 478
479 oldlist = B_ (current_buffer, undo_list); 479 oldlist = BVAR (current_buffer, undo_list);
480 480
481 while (arg > 0) 481 while (arg > 0)
482 { 482 {
@@ -631,9 +631,9 @@ Return what remains of the list. */)
631 so the test in `undo' for continuing an undo series 631 so the test in `undo' for continuing an undo series
632 will work right. */ 632 will work right. */
633 if (did_apply 633 if (did_apply
634 && EQ (oldlist, B_ (current_buffer, undo_list))) 634 && EQ (oldlist, BVAR (current_buffer, undo_list)))
635 B_ (current_buffer, undo_list) 635 BVAR (current_buffer, undo_list)
636 = Fcons (list3 (Qapply, Qcdr, Qnil), B_ (current_buffer, undo_list)); 636 = Fcons (list3 (Qapply, Qcdr, Qnil), BVAR (current_buffer, undo_list));
637 637
638 UNGCPRO; 638 UNGCPRO;
639 return unbind_to (count, list); 639 return unbind_to (count, list);
diff --git a/src/w32fns.c b/src/w32fns.c
index 64e073bedb7..ec48397657a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4348,9 +4348,9 @@ This function is an internal primitive--use `make-frame' instead. */)
4348 /* Initialize `default-minibuffer-frame' in case this is the first 4348 /* Initialize `default-minibuffer-frame' in case this is the first
4349 frame on this terminal. */ 4349 frame on this terminal. */
4350 if (FRAME_HAS_MINIBUF_P (f) 4350 if (FRAME_HAS_MINIBUF_P (f)
4351 && (!FRAMEP (kb->Vdefault_minibuffer_frame) 4351 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
4352 || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) 4352 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
4353 kb->Vdefault_minibuffer_frame = frame; 4353 KVAR (kb, Vdefault_minibuffer_frame) = frame;
4354 4354
4355 /* All remaining specified parameters, which have not been "used" 4355 /* All remaining specified parameters, which have not been "used"
4356 by x_get_arg and friends, now go in the misc. alist of the frame. */ 4356 by x_get_arg and friends, now go in the misc. alist of the frame. */
@@ -5225,7 +5225,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5225 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); 5225 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
5226 old_buffer = current_buffer; 5226 old_buffer = current_buffer;
5227 set_buffer_internal_1 (XBUFFER (buffer)); 5227 set_buffer_internal_1 (XBUFFER (buffer));
5228 B_ (current_buffer, truncate_lines) = Qnil; 5228 BVAR (current_buffer, truncate_lines) = Qnil;
5229 specbind (Qinhibit_read_only, Qt); 5229 specbind (Qinhibit_read_only, Qt);
5230 specbind (Qinhibit_modification_hooks, Qt); 5230 specbind (Qinhibit_modification_hooks, Qt);
5231 Ferase_buffer (); 5231 Ferase_buffer ();
@@ -5655,7 +5655,7 @@ Text larger than the specified size is clipped. */)
5655 /* Display the tooltip text in a temporary buffer. */ 5655 /* Display the tooltip text in a temporary buffer. */
5656 old_buffer = current_buffer; 5656 old_buffer = current_buffer;
5657 set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); 5657 set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
5658 B_ (current_buffer, truncate_lines) = Qnil; 5658 BVAR (current_buffer, truncate_lines) = Qnil;
5659 clear_glyph_matrix (w->desired_matrix); 5659 clear_glyph_matrix (w->desired_matrix);
5660 clear_glyph_matrix (w->current_matrix); 5660 clear_glyph_matrix (w->current_matrix);
5661 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); 5661 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
@@ -6162,7 +6162,7 @@ an integer representing a ShowWindow flag:
6162 CHECK_STRING (document); 6162 CHECK_STRING (document);
6163 6163
6164 /* Encode filename, current directory and parameters. */ 6164 /* Encode filename, current directory and parameters. */
6165 current_dir = ENCODE_FILE (B_ (current_buffer, directory)); 6165 current_dir = ENCODE_FILE (BVAR (current_buffer, directory));
6166 document = ENCODE_FILE (document); 6166 document = ENCODE_FILE (document);
6167 if (STRINGP (parameters)) 6167 if (STRINGP (parameters))
6168 parameters = ENCODE_SYSTEM (parameters); 6168 parameters = ENCODE_SYSTEM (parameters);
diff --git a/src/w32term.c b/src/w32term.c
index cd4ee54fd2c..692130b5140 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6082,7 +6082,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
6082 terminal like X does. */ 6082 terminal like X does. */
6083 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 6083 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
6084 init_kboard (terminal->kboard); 6084 init_kboard (terminal->kboard);
6085 terminal->kboard->Vwindow_system = intern ("w32"); 6085 KVAR (terminal->kboard, Vwindow_system) = intern ("w32");
6086 terminal->kboard->next_kboard = all_kboards; 6086 terminal->kboard->next_kboard = all_kboards;
6087 all_kboards = terminal->kboard; 6087 all_kboards = terminal->kboard;
6088 /* Don't let the initial kboard remain current longer than necessary. 6088 /* Don't let the initial kboard remain current longer than necessary.
diff --git a/src/window.c b/src/window.c
index 4d700cfad5e..7965269f0e7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1359,8 +1359,8 @@ window_display_table (struct window *w)
1359 { 1359 {
1360 struct buffer *b = XBUFFER (w->buffer); 1360 struct buffer *b = XBUFFER (w->buffer);
1361 1361
1362 if (DISP_TABLE_P (B_ (b, display_table))) 1362 if (DISP_TABLE_P (BVAR (b, display_table)))
1363 dp = XCHAR_TABLE (B_ (b, display_table)); 1363 dp = XCHAR_TABLE (BVAR (b, display_table));
1364 else if (DISP_TABLE_P (Vstandard_display_table)) 1364 else if (DISP_TABLE_P (Vstandard_display_table))
1365 dp = XCHAR_TABLE (Vstandard_display_table); 1365 dp = XCHAR_TABLE (Vstandard_display_table);
1366 } 1366 }
@@ -1414,9 +1414,9 @@ unshow_buffer (register struct window *w)
1414 So don't clobber point in that buffer. */ 1414 So don't clobber point in that buffer. */
1415 if (! EQ (buf, XWINDOW (selected_window)->buffer) 1415 if (! EQ (buf, XWINDOW (selected_window)->buffer)
1416 /* This line helps to fix Horsley's testbug.el bug. */ 1416 /* This line helps to fix Horsley's testbug.el bug. */
1417 && !(WINDOWP (B_ (b, last_selected_window)) 1417 && !(WINDOWP (BVAR (b, last_selected_window))
1418 && w != XWINDOW (B_ (b, last_selected_window)) 1418 && w != XWINDOW (BVAR (b, last_selected_window))
1419 && EQ (buf, XWINDOW (B_ (b, last_selected_window))->buffer))) 1419 && EQ (buf, XWINDOW (BVAR (b, last_selected_window))->buffer)))
1420 temp_set_point_both (b, 1420 temp_set_point_both (b,
1421 clip_to_bounds (BUF_BEGV (b), 1421 clip_to_bounds (BUF_BEGV (b),
1422 XMARKER (w->pointm)->charpos, 1422 XMARKER (w->pointm)->charpos,
@@ -1425,9 +1425,9 @@ unshow_buffer (register struct window *w)
1425 marker_byte_position (w->pointm), 1425 marker_byte_position (w->pointm),
1426 BUF_ZV_BYTE (b))); 1426 BUF_ZV_BYTE (b)));
1427 1427
1428 if (WINDOWP (B_ (b, last_selected_window)) 1428 if (WINDOWP (BVAR (b, last_selected_window))
1429 && w == XWINDOW (B_ (b, last_selected_window))) 1429 && w == XWINDOW (BVAR (b, last_selected_window)))
1430 B_ (b, last_selected_window) = Qnil; 1430 BVAR (b, last_selected_window) = Qnil;
1431} 1431}
1432 1432
1433/* Put replacement into the window structure in place of old. */ 1433/* Put replacement into the window structure in place of old. */
@@ -2325,7 +2325,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2325 /* Check for a window that has a killed buffer. */ 2325 /* Check for a window that has a killed buffer. */
2326 case CHECK_ALL_WINDOWS: 2326 case CHECK_ALL_WINDOWS:
2327 if (! NILP (w->buffer) 2327 if (! NILP (w->buffer)
2328 && NILP (B_ (XBUFFER (w->buffer), name))) 2328 && NILP (BVAR (XBUFFER (w->buffer), name)))
2329 abort (); 2329 abort ();
2330 break; 2330 break;
2331 2331
@@ -2729,7 +2729,7 @@ window_min_size_2 (struct window *w, int width_p, int safe_p)
2729 { 2729 {
2730 int safe_size = (MIN_SAFE_WINDOW_HEIGHT 2730 int safe_size = (MIN_SAFE_WINDOW_HEIGHT
2731 + ((BUFFERP (w->buffer) 2731 + ((BUFFERP (w->buffer)
2732 && !NILP (B_ (XBUFFER (w->buffer), mode_line_format))) 2732 && !NILP (BVAR (XBUFFER (w->buffer), mode_line_format)))
2733 ? 1 : 0)); 2733 ? 1 : 0));
2734 2734
2735 return safe_p ? safe_size : max (window_min_height, safe_size); 2735 return safe_p ? safe_size : max (window_min_height, safe_size);
@@ -3360,15 +3360,15 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3360 w->buffer = buffer; 3360 w->buffer = buffer;
3361 3361
3362 if (EQ (window, selected_window)) 3362 if (EQ (window, selected_window))
3363 B_ (b, last_selected_window) = window; 3363 BVAR (b, last_selected_window) = window;
3364 3364
3365 /* Let redisplay errors through. */ 3365 /* Let redisplay errors through. */
3366 b->display_error_modiff = 0; 3366 b->display_error_modiff = 0;
3367 3367
3368 /* Update time stamps of buffer display. */ 3368 /* Update time stamps of buffer display. */
3369 if (INTEGERP (B_ (b, display_count))) 3369 if (INTEGERP (BVAR (b, display_count)))
3370 XSETINT (B_ (b, display_count), XINT (B_ (b, display_count)) + 1); 3370 XSETINT (BVAR (b, display_count), XINT (BVAR (b, display_count)) + 1);
3371 B_ (b, display_time) = Fcurrent_time (); 3371 BVAR (b, display_time) = Fcurrent_time ();
3372 3372
3373 XSETFASTINT (w->window_end_pos, 0); 3373 XSETFASTINT (w->window_end_pos, 0);
3374 XSETFASTINT (w->window_end_vpos, 0); 3374 XSETFASTINT (w->window_end_vpos, 0);
@@ -3421,18 +3421,18 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3421 w->left_margin_cols = w->right_margin_cols = Qnil; 3421 w->left_margin_cols = w->right_margin_cols = Qnil;
3422 3422
3423 Fset_window_fringes (window, 3423 Fset_window_fringes (window,
3424 B_ (b, left_fringe_width), B_ (b, right_fringe_width), 3424 BVAR (b, left_fringe_width), BVAR (b, right_fringe_width),
3425 B_ (b, fringes_outside_margins)); 3425 BVAR (b, fringes_outside_margins));
3426 3426
3427 Fset_window_scroll_bars (window, 3427 Fset_window_scroll_bars (window,
3428 B_ (b, scroll_bar_width), 3428 BVAR (b, scroll_bar_width),
3429 B_ (b, vertical_scroll_bar_type), Qnil); 3429 BVAR (b, vertical_scroll_bar_type), Qnil);
3430 3430
3431 w->left_margin_cols = save_left; 3431 w->left_margin_cols = save_left;
3432 w->right_margin_cols = save_right; 3432 w->right_margin_cols = save_right;
3433 3433
3434 Fset_window_margins (window, 3434 Fset_window_margins (window,
3435 B_ (b, left_margin_cols), B_ (b, right_margin_cols)); 3435 BVAR (b, left_margin_cols), BVAR (b, right_margin_cols));
3436 } 3436 }
3437 3437
3438 if (run_hooks_p) 3438 if (run_hooks_p)
@@ -3469,7 +3469,7 @@ This function runs `window-scroll-functions' before running
3469 XSETWINDOW (window, w); 3469 XSETWINDOW (window, w);
3470 buffer = Fget_buffer (buffer_or_name); 3470 buffer = Fget_buffer (buffer_or_name);
3471 CHECK_BUFFER (buffer); 3471 CHECK_BUFFER (buffer);
3472 if (NILP (B_ (XBUFFER (buffer), name))) 3472 if (NILP (BVAR (XBUFFER (buffer), name)))
3473 error ("Attempt to display deleted buffer"); 3473 error ("Attempt to display deleted buffer");
3474 3474
3475 tem = w->buffer; 3475 tem = w->buffer;
@@ -3481,7 +3481,7 @@ This function runs `window-scroll-functions' before running
3481 if (EQ (tem, buffer)) 3481 if (EQ (tem, buffer))
3482 return Qnil; 3482 return Qnil;
3483 else if (EQ (w->dedicated, Qt)) 3483 else if (EQ (w->dedicated, Qt))
3484 error ("Window is dedicated to `%s'", SDATA (B_ (XBUFFER (tem), name))); 3484 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name)));
3485 else 3485 else
3486 w->dedicated = Qnil; 3486 w->dedicated = Qnil;
3487 3487
@@ -3552,7 +3552,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
3552 3552
3553 Fset_buffer (w->buffer); 3553 Fset_buffer (w->buffer);
3554 3554
3555 B_ (XBUFFER (w->buffer), last_selected_window) = window; 3555 BVAR (XBUFFER (w->buffer), last_selected_window) = window;
3556 3556
3557 /* Go to the point recorded in the window. 3557 /* Go to the point recorded in the window.
3558 This is important when the buffer is in more 3558 This is important when the buffer is in more
@@ -3640,7 +3640,7 @@ displaying that buffer. */)
3640 3640
3641 if (STRINGP (object)) 3641 if (STRINGP (object))
3642 object = Fget_buffer (object); 3642 object = Fget_buffer (object);
3643 if (BUFFERP (object) && !NILP (B_ (XBUFFER (object), name))) 3643 if (BUFFERP (object) && !NILP (BVAR (XBUFFER (object), name)))
3644 { 3644 {
3645 /* Walk all windows looking for buffer, and force update 3645 /* Walk all windows looking for buffer, and force update
3646 of each of those windows. */ 3646 of each of those windows. */
@@ -3663,7 +3663,7 @@ temp_output_buffer_show (register Lisp_Object buf)
3663 register Lisp_Object window; 3663 register Lisp_Object window;
3664 register struct window *w; 3664 register struct window *w;
3665 3665
3666 B_ (XBUFFER (buf), directory) = B_ (current_buffer, directory); 3666 BVAR (XBUFFER (buf), directory) = BVAR (current_buffer, directory);
3667 3667
3668 Fset_buffer (buf); 3668 Fset_buffer (buf);
3669 BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF; 3669 BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF;
@@ -4834,8 +4834,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4834 possibility of point becoming "stuck" on a tall line when 4834 possibility of point becoming "stuck" on a tall line when
4835 scrolling by one line. */ 4835 scrolling by one line. */
4836 if (window_scroll_pixel_based_preserve_y < 0 4836 if (window_scroll_pixel_based_preserve_y < 0
4837 || !SYMBOLP (current_kboard->Vlast_command) 4837 || !SYMBOLP (KVAR (current_kboard, Vlast_command))
4838 || NILP (Fget (current_kboard->Vlast_command, Qscroll_command))) 4838 || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command)))
4839 { 4839 {
4840 start_display (&it, w, start); 4840 start_display (&it, w, start);
4841 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 4841 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
@@ -5091,8 +5091,8 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
5091 if (!NILP (Vscroll_preserve_screen_position)) 5091 if (!NILP (Vscroll_preserve_screen_position))
5092 { 5092 {
5093 if (window_scroll_preserve_vpos <= 0 5093 if (window_scroll_preserve_vpos <= 0
5094 || !SYMBOLP (current_kboard->Vlast_command) 5094 || !SYMBOLP (KVAR (current_kboard, Vlast_command))
5095 || NILP (Fget (current_kboard->Vlast_command, Qscroll_command))) 5095 || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command)))
5096 { 5096 {
5097 struct position posit 5097 struct position posit
5098 = *compute_motion (startpos, 0, 0, 0, 5098 = *compute_motion (startpos, 0, 0, 0,
@@ -5878,7 +5878,7 @@ the return value is nil. Otherwise the value is t. */)
5878 saved_windows = XVECTOR (data->saved_windows); 5878 saved_windows = XVECTOR (data->saved_windows);
5879 5879
5880 new_current_buffer = data->current_buffer; 5880 new_current_buffer = data->current_buffer;
5881 if (NILP (B_ (XBUFFER (new_current_buffer), name))) 5881 if (NILP (BVAR (XBUFFER (new_current_buffer), name)))
5882 new_current_buffer = Qnil; 5882 new_current_buffer = Qnil;
5883 else 5883 else
5884 { 5884 {
@@ -6063,14 +6063,14 @@ the return value is nil. Otherwise the value is t. */)
6063 w->buffer = p->buffer; 6063 w->buffer = p->buffer;
6064 else 6064 else
6065 { 6065 {
6066 if (!NILP (B_ (XBUFFER (p->buffer), name))) 6066 if (!NILP (BVAR (XBUFFER (p->buffer), name)))
6067 /* If saved buffer is alive, install it. */ 6067 /* If saved buffer is alive, install it. */
6068 { 6068 {
6069 w->buffer = p->buffer; 6069 w->buffer = p->buffer;
6070 w->start_at_line_beg = p->start_at_line_beg; 6070 w->start_at_line_beg = p->start_at_line_beg;
6071 set_marker_restricted (w->start, p->start, w->buffer); 6071 set_marker_restricted (w->start, p->start, w->buffer);
6072 set_marker_restricted (w->pointm, p->pointm, w->buffer); 6072 set_marker_restricted (w->pointm, p->pointm, w->buffer);
6073 Fset_marker (B_ (XBUFFER (w->buffer), mark), 6073 Fset_marker (BVAR (XBUFFER (w->buffer), mark),
6074 p->mark, w->buffer); 6074 p->mark, w->buffer);
6075 6075
6076 /* As documented in Fcurrent_window_configuration, don't 6076 /* As documented in Fcurrent_window_configuration, don't
@@ -6080,7 +6080,7 @@ the return value is nil. Otherwise the value is t. */)
6080 && XBUFFER (p->buffer) == current_buffer) 6080 && XBUFFER (p->buffer) == current_buffer)
6081 Fgoto_char (w->pointm); 6081 Fgoto_char (w->pointm);
6082 } 6082 }
6083 else if (NILP (w->buffer) || NILP (B_ (XBUFFER (w->buffer), name))) 6083 else if (NILP (w->buffer) || NILP (BVAR (XBUFFER (w->buffer), name)))
6084 /* Else unless window has a live buffer, get one. */ 6084 /* Else unless window has a live buffer, get one. */
6085 { 6085 {
6086 w->buffer = Fcdr (Fcar (Vbuffer_alist)); 6086 w->buffer = Fcdr (Fcar (Vbuffer_alist));
@@ -6121,7 +6121,7 @@ the return value is nil. Otherwise the value is t. */)
6121 has been restored into it. We already swapped out that point 6121 has been restored into it. We already swapped out that point
6122 from that window's old buffer. */ 6122 from that window's old buffer. */
6123 select_window (data->current_window, Qnil, 1); 6123 select_window (data->current_window, Qnil, 1);
6124 B_ (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window) 6124 BVAR (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window)
6125 = selected_window; 6125 = selected_window;
6126 6126
6127 if (NILP (data->focus_frame) 6127 if (NILP (data->focus_frame)
@@ -6322,7 +6322,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
6322 p->start = Fcopy_marker (w->start, Qnil); 6322 p->start = Fcopy_marker (w->start, Qnil);
6323 p->start_at_line_beg = w->start_at_line_beg; 6323 p->start_at_line_beg = w->start_at_line_beg;
6324 6324
6325 tem = B_ (XBUFFER (w->buffer), mark); 6325 tem = BVAR (XBUFFER (w->buffer), mark);
6326 p->mark = Fcopy_marker (tem, Qnil); 6326 p->mark = Fcopy_marker (tem, Qnil);
6327 } 6327 }
6328 else 6328 else
diff --git a/src/xdisp.c b/src/xdisp.c
index 68f7835f0d7..37fd9e4aaab 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1210,12 +1210,12 @@ pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y,
1210 if (WINDOW_WANTS_MODELINE_P (w)) 1210 if (WINDOW_WANTS_MODELINE_P (w))
1211 current_mode_line_height 1211 current_mode_line_height
1212 = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w), 1212 = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
1213 B_ (current_buffer, mode_line_format)); 1213 BVAR (current_buffer, mode_line_format));
1214 1214
1215 if (WINDOW_WANTS_HEADER_LINE_P (w)) 1215 if (WINDOW_WANTS_HEADER_LINE_P (w))
1216 current_header_line_height 1216 current_header_line_height
1217 = display_mode_line (w, HEADER_LINE_FACE_ID, 1217 = display_mode_line (w, HEADER_LINE_FACE_ID,
1218 B_ (current_buffer, header_line_format)); 1218 BVAR (current_buffer, header_line_format));
1219 1219
1220 start_display (&it, w, top); 1220 start_display (&it, w, top);
1221 move_it_to (&it, charpos, -1, it.last_visible_y-1, -1, 1221 move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
@@ -2405,10 +2405,10 @@ init_iterator (struct it *it, struct window *w,
2405 if (base_face_id == DEFAULT_FACE_ID 2405 if (base_face_id == DEFAULT_FACE_ID
2406 && FRAME_WINDOW_P (it->f)) 2406 && FRAME_WINDOW_P (it->f))
2407 { 2407 {
2408 if (NATNUMP (B_ (current_buffer, extra_line_spacing))) 2408 if (NATNUMP (BVAR (current_buffer, extra_line_spacing)))
2409 it->extra_line_spacing = XFASTINT (B_ (current_buffer, extra_line_spacing)); 2409 it->extra_line_spacing = XFASTINT (BVAR (current_buffer, extra_line_spacing));
2410 else if (FLOATP (B_ (current_buffer, extra_line_spacing))) 2410 else if (FLOATP (BVAR (current_buffer, extra_line_spacing)))
2411 it->extra_line_spacing = (XFLOAT_DATA (B_ (current_buffer, extra_line_spacing)) 2411 it->extra_line_spacing = (XFLOAT_DATA (BVAR (current_buffer, extra_line_spacing))
2412 * FRAME_LINE_HEIGHT (it->f)); 2412 * FRAME_LINE_HEIGHT (it->f));
2413 else if (it->f->extra_line_spacing > 0) 2413 else if (it->f->extra_line_spacing > 0)
2414 it->extra_line_spacing = it->f->extra_line_spacing; 2414 it->extra_line_spacing = it->f->extra_line_spacing;
@@ -2431,36 +2431,36 @@ init_iterator (struct it *it, struct window *w,
2431 it->override_ascent = -1; 2431 it->override_ascent = -1;
2432 2432
2433 /* Are control characters displayed as `^C'? */ 2433 /* Are control characters displayed as `^C'? */
2434 it->ctl_arrow_p = !NILP (B_ (current_buffer, ctl_arrow)); 2434 it->ctl_arrow_p = !NILP (BVAR (current_buffer, ctl_arrow));
2435 2435
2436 /* -1 means everything between a CR and the following line end 2436 /* -1 means everything between a CR and the following line end
2437 is invisible. >0 means lines indented more than this value are 2437 is invisible. >0 means lines indented more than this value are
2438 invisible. */ 2438 invisible. */
2439 it->selective = (INTEGERP (B_ (current_buffer, selective_display)) 2439 it->selective = (INTEGERP (BVAR (current_buffer, selective_display))
2440 ? XFASTINT (B_ (current_buffer, selective_display)) 2440 ? XFASTINT (BVAR (current_buffer, selective_display))
2441 : (!NILP (B_ (current_buffer, selective_display)) 2441 : (!NILP (BVAR (current_buffer, selective_display))
2442 ? -1 : 0)); 2442 ? -1 : 0));
2443 it->selective_display_ellipsis_p 2443 it->selective_display_ellipsis_p
2444 = !NILP (B_ (current_buffer, selective_display_ellipses)); 2444 = !NILP (BVAR (current_buffer, selective_display_ellipses));
2445 2445
2446 /* Display table to use. */ 2446 /* Display table to use. */
2447 it->dp = window_display_table (w); 2447 it->dp = window_display_table (w);
2448 2448
2449 /* Are multibyte characters enabled in current_buffer? */ 2449 /* Are multibyte characters enabled in current_buffer? */
2450 it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); 2450 it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
2451 2451
2452 /* Do we need to reorder bidirectional text? Not if this is a 2452 /* Do we need to reorder bidirectional text? Not if this is a
2453 unibyte buffer: by definition, none of the single-byte characters 2453 unibyte buffer: by definition, none of the single-byte characters
2454 are strong R2L, so no reordering is needed. And bidi.c doesn't 2454 are strong R2L, so no reordering is needed. And bidi.c doesn't
2455 support unibyte buffers anyway. */ 2455 support unibyte buffers anyway. */
2456 it->bidi_p 2456 it->bidi_p
2457 = !NILP (B_ (current_buffer, bidi_display_reordering)) && it->multibyte_p; 2457 = !NILP (BVAR (current_buffer, bidi_display_reordering)) && it->multibyte_p;
2458 2458
2459 /* Non-zero if we should highlight the region. */ 2459 /* Non-zero if we should highlight the region. */
2460 highlight_region_p 2460 highlight_region_p
2461 = (!NILP (Vtransient_mark_mode) 2461 = (!NILP (Vtransient_mark_mode)
2462 && !NILP (B_ (current_buffer, mark_active)) 2462 && !NILP (BVAR (current_buffer, mark_active))
2463 && XMARKER (B_ (current_buffer, mark))->buffer != 0); 2463 && XMARKER (BVAR (current_buffer, mark))->buffer != 0);
2464 2464
2465 /* Set IT->region_beg_charpos and IT->region_end_charpos to the 2465 /* Set IT->region_beg_charpos and IT->region_end_charpos to the
2466 start and end of a visible region in window IT->w. Set both to 2466 start and end of a visible region in window IT->w. Set both to
@@ -2477,7 +2477,7 @@ init_iterator (struct it *it, struct window *w,
2477 && WINDOWP (minibuf_selected_window) 2477 && WINDOWP (minibuf_selected_window)
2478 && w == XWINDOW (minibuf_selected_window)))) 2478 && w == XWINDOW (minibuf_selected_window))))
2479 { 2479 {
2480 EMACS_INT charpos = marker_position (B_ (current_buffer, mark)); 2480 EMACS_INT charpos = marker_position (BVAR (current_buffer, mark));
2481 it->region_beg_charpos = min (PT, charpos); 2481 it->region_beg_charpos = min (PT, charpos);
2482 it->region_end_charpos = max (PT, charpos); 2482 it->region_end_charpos = max (PT, charpos);
2483 } 2483 }
@@ -2494,7 +2494,7 @@ init_iterator (struct it *it, struct window *w,
2494 it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger); 2494 it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger);
2495 2495
2496 /* Correct bogus values of tab_width. */ 2496 /* Correct bogus values of tab_width. */
2497 it->tab_width = XINT (B_ (current_buffer, tab_width)); 2497 it->tab_width = XINT (BVAR (current_buffer, tab_width));
2498 if (it->tab_width <= 0 || it->tab_width > 1000) 2498 if (it->tab_width <= 0 || it->tab_width > 1000)
2499 it->tab_width = 8; 2499 it->tab_width = 8;
2500 2500
@@ -2508,8 +2508,8 @@ init_iterator (struct it *it, struct window *w,
2508 && (WINDOW_TOTAL_COLS (it->w) 2508 && (WINDOW_TOTAL_COLS (it->w)
2509 < XINT (Vtruncate_partial_width_windows)))))) 2509 < XINT (Vtruncate_partial_width_windows))))))
2510 it->line_wrap = TRUNCATE; 2510 it->line_wrap = TRUNCATE;
2511 else if (NILP (B_ (current_buffer, truncate_lines))) 2511 else if (NILP (BVAR (current_buffer, truncate_lines)))
2512 it->line_wrap = NILP (B_ (current_buffer, word_wrap)) 2512 it->line_wrap = NILP (BVAR (current_buffer, word_wrap))
2513 ? WINDOW_WRAP : WORD_WRAP; 2513 ? WINDOW_WRAP : WORD_WRAP;
2514 else 2514 else
2515 it->line_wrap = TRUNCATE; 2515 it->line_wrap = TRUNCATE;
@@ -2611,9 +2611,9 @@ init_iterator (struct it *it, struct window *w,
2611 { 2611 {
2612 /* Note the paragraph direction that this buffer wants to 2612 /* Note the paragraph direction that this buffer wants to
2613 use. */ 2613 use. */
2614 if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qleft_to_right)) 2614 if (EQ (BVAR (current_buffer, bidi_paragraph_direction), Qleft_to_right))
2615 it->paragraph_embedding = L2R; 2615 it->paragraph_embedding = L2R;
2616 else if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qright_to_left)) 2616 else if (EQ (BVAR (current_buffer, bidi_paragraph_direction), Qright_to_left))
2617 it->paragraph_embedding = R2L; 2617 it->paragraph_embedding = R2L;
2618 else 2618 else
2619 it->paragraph_embedding = NEUTRAL_DIR; 2619 it->paragraph_embedding = NEUTRAL_DIR;
@@ -5411,7 +5411,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
5411 it->method = GET_FROM_BUFFER; 5411 it->method = GET_FROM_BUFFER;
5412 it->object = it->w->buffer; 5412 it->object = it->w->buffer;
5413 it->area = TEXT_AREA; 5413 it->area = TEXT_AREA;
5414 it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); 5414 it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
5415 it->sp = 0; 5415 it->sp = 0;
5416 it->string_from_display_prop_p = 0; 5416 it->string_from_display_prop_p = 0;
5417 it->face_before_selective_p = 0; 5417 it->face_before_selective_p = 0;
@@ -7919,7 +7919,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
7919 old_deactivate_mark = Vdeactivate_mark; 7919 old_deactivate_mark = Vdeactivate_mark;
7920 oldbuf = current_buffer; 7920 oldbuf = current_buffer;
7921 Fset_buffer (Fget_buffer_create (Vmessages_buffer_name)); 7921 Fset_buffer (Fget_buffer_create (Vmessages_buffer_name));
7922 B_ (current_buffer, undo_list) = Qt; 7922 BVAR (current_buffer, undo_list) = Qt;
7923 7923
7924 oldpoint = message_dolog_marker1; 7924 oldpoint = message_dolog_marker1;
7925 set_marker_restricted (oldpoint, make_number (PT), Qnil); 7925 set_marker_restricted (oldpoint, make_number (PT), Qnil);
@@ -7943,7 +7943,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
7943 /* Insert the string--maybe converting multibyte to single byte 7943 /* Insert the string--maybe converting multibyte to single byte
7944 or vice versa, so that all the text fits the buffer. */ 7944 or vice versa, so that all the text fits the buffer. */
7945 if (multibyte 7945 if (multibyte
7946 && NILP (B_ (current_buffer, enable_multibyte_characters))) 7946 && NILP (BVAR (current_buffer, enable_multibyte_characters)))
7947 { 7947 {
7948 EMACS_INT i; 7948 EMACS_INT i;
7949 int c, char_bytes; 7949 int c, char_bytes;
@@ -7961,7 +7961,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
7961 } 7961 }
7962 } 7962 }
7963 else if (! multibyte 7963 else if (! multibyte
7964 && ! NILP (B_ (current_buffer, enable_multibyte_characters))) 7964 && ! NILP (BVAR (current_buffer, enable_multibyte_characters)))
7965 { 7965 {
7966 EMACS_INT i; 7966 EMACS_INT i;
7967 int c, char_bytes; 7967 int c, char_bytes;
@@ -8460,7 +8460,7 @@ update_echo_area (void)
8460 Lisp_Object string; 8460 Lisp_Object string;
8461 string = Fcurrent_message (); 8461 string = Fcurrent_message ();
8462 message3 (string, SBYTES (string), 8462 message3 (string, SBYTES (string),
8463 !NILP (B_ (current_buffer, enable_multibyte_characters))); 8463 !NILP (BVAR (current_buffer, enable_multibyte_characters)));
8464 } 8464 }
8465} 8465}
8466 8466
@@ -8475,7 +8475,7 @@ ensure_echo_area_buffers (void)
8475 8475
8476 for (i = 0; i < 2; ++i) 8476 for (i = 0; i < 2; ++i)
8477 if (!BUFFERP (echo_buffer[i]) 8477 if (!BUFFERP (echo_buffer[i])
8478 || NILP (B_ (XBUFFER (echo_buffer[i]), name))) 8478 || NILP (BVAR (XBUFFER (echo_buffer[i]), name)))
8479 { 8479 {
8480 char name[30]; 8480 char name[30];
8481 Lisp_Object old_buffer; 8481 Lisp_Object old_buffer;
@@ -8484,7 +8484,7 @@ ensure_echo_area_buffers (void)
8484 old_buffer = echo_buffer[i]; 8484 old_buffer = echo_buffer[i];
8485 sprintf (name, " *Echo Area %d*", i); 8485 sprintf (name, " *Echo Area %d*", i);
8486 echo_buffer[i] = Fget_buffer_create (build_string (name)); 8486 echo_buffer[i] = Fget_buffer_create (build_string (name));
8487 B_ (XBUFFER (echo_buffer[i]), truncate_lines) = Qnil; 8487 BVAR (XBUFFER (echo_buffer[i]), truncate_lines) = Qnil;
8488 /* to force word wrap in echo area - 8488 /* to force word wrap in echo area -
8489 it was decided to postpone this*/ 8489 it was decided to postpone this*/
8490 /* XBUFFER (echo_buffer[i])->word_wrap = Qt; */ 8490 /* XBUFFER (echo_buffer[i])->word_wrap = Qt; */
@@ -8577,8 +8577,8 @@ with_echo_area_buffer (struct window *w, int which,
8577 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); 8577 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
8578 } 8578 }
8579 8579
8580 B_ (current_buffer, undo_list) = Qt; 8580 BVAR (current_buffer, undo_list) = Qt;
8581 B_ (current_buffer, read_only) = Qnil; 8581 BVAR (current_buffer, read_only) = Qnil;
8582 specbind (Qinhibit_read_only, Qt); 8582 specbind (Qinhibit_read_only, Qt);
8583 specbind (Qinhibit_modification_hooks, Qt); 8583 specbind (Qinhibit_modification_hooks, Qt);
8584 8584
@@ -8691,7 +8691,7 @@ setup_echo_area_for_printing (int multibyte_p)
8691 8691
8692 /* Switch to that buffer and clear it. */ 8692 /* Switch to that buffer and clear it. */
8693 set_buffer_internal (XBUFFER (echo_area_buffer[0])); 8693 set_buffer_internal (XBUFFER (echo_area_buffer[0]));
8694 B_ (current_buffer, truncate_lines) = Qnil; 8694 BVAR (current_buffer, truncate_lines) = Qnil;
8695 8695
8696 if (Z > BEG) 8696 if (Z > BEG)
8697 { 8697 {
@@ -8705,7 +8705,7 @@ setup_echo_area_for_printing (int multibyte_p)
8705 8705
8706 /* Set up the buffer for the multibyteness we need. */ 8706 /* Set up the buffer for the multibyteness we need. */
8707 if (multibyte_p 8707 if (multibyte_p
8708 != !NILP (B_ (current_buffer, enable_multibyte_characters))) 8708 != !NILP (BVAR (current_buffer, enable_multibyte_characters)))
8709 Fset_buffer_multibyte (multibyte_p ? Qt : Qnil); 8709 Fset_buffer_multibyte (multibyte_p ? Qt : Qnil);
8710 8710
8711 /* Raise the frame containing the echo area. */ 8711 /* Raise the frame containing the echo area. */
@@ -8734,7 +8734,7 @@ setup_echo_area_for_printing (int multibyte_p)
8734 { 8734 {
8735 /* Someone switched buffers between print requests. */ 8735 /* Someone switched buffers between print requests. */
8736 set_buffer_internal (XBUFFER (echo_area_buffer[0])); 8736 set_buffer_internal (XBUFFER (echo_area_buffer[0]));
8737 B_ (current_buffer, truncate_lines) = Qnil; 8737 BVAR (current_buffer, truncate_lines) = Qnil;
8738 } 8738 }
8739 } 8739 }
8740} 8740}
@@ -9177,12 +9177,12 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby
9177 9177
9178 /* Change multibyteness of the echo buffer appropriately. */ 9178 /* Change multibyteness of the echo buffer appropriately. */
9179 if (message_enable_multibyte 9179 if (message_enable_multibyte
9180 != !NILP (B_ (current_buffer, enable_multibyte_characters))) 9180 != !NILP (BVAR (current_buffer, enable_multibyte_characters)))
9181 Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); 9181 Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil);
9182 9182
9183 B_ (current_buffer, truncate_lines) = message_truncate_lines ? Qt : Qnil; 9183 BVAR (current_buffer, truncate_lines) = message_truncate_lines ? Qt : Qnil;
9184 if (!NILP (B_ (current_buffer, bidi_display_reordering))) 9184 if (!NILP (BVAR (current_buffer, bidi_display_reordering)))
9185 B_ (current_buffer, bidi_paragraph_direction) = Qleft_to_right; 9185 BVAR (current_buffer, bidi_paragraph_direction) = Qleft_to_right;
9186 9186
9187 /* Insert new message at BEG. */ 9187 /* Insert new message at BEG. */
9188 TEMP_SET_PT_BOTH (BEG, BEG_BYTE); 9188 TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
@@ -9205,7 +9205,7 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby
9205 if (nbytes == 0) 9205 if (nbytes == 0)
9206 nbytes = strlen (s); 9206 nbytes = strlen (s);
9207 9207
9208 if (multibyte_p && NILP (B_ (current_buffer, enable_multibyte_characters))) 9208 if (multibyte_p && NILP (BVAR (current_buffer, enable_multibyte_characters)))
9209 { 9209 {
9210 /* Convert from multi-byte to single-byte. */ 9210 /* Convert from multi-byte to single-byte. */
9211 EMACS_INT i; 9211 EMACS_INT i;
@@ -9223,7 +9223,7 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby
9223 } 9223 }
9224 } 9224 }
9225 else if (!multibyte_p 9225 else if (!multibyte_p
9226 && !NILP (B_ (current_buffer, enable_multibyte_characters))) 9226 && !NILP (BVAR (current_buffer, enable_multibyte_characters)))
9227 { 9227 {
9228 /* Convert from single-byte to multi-byte. */ 9228 /* Convert from single-byte to multi-byte. */
9229 EMACS_INT i; 9229 EMACS_INT i;
@@ -9808,7 +9808,7 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
9808 < BUF_MODIFF (XBUFFER (w->buffer))) 9808 < BUF_MODIFF (XBUFFER (w->buffer)))
9809 != !NILP (w->last_had_star)) 9809 != !NILP (w->last_had_star))
9810 || ((!NILP (Vtransient_mark_mode) 9810 || ((!NILP (Vtransient_mark_mode)
9811 && !NILP (B_ (XBUFFER (w->buffer), mark_active))) 9811 && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
9812 != !NILP (w->region_showing))) 9812 != !NILP (w->region_showing)))
9813 { 9813 {
9814 struct buffer *prev = current_buffer; 9814 struct buffer *prev = current_buffer;
@@ -10006,7 +10006,7 @@ update_tool_bar (struct frame *f, int save_match_data)
10006 < BUF_MODIFF (XBUFFER (w->buffer))) 10006 < BUF_MODIFF (XBUFFER (w->buffer)))
10007 != !NILP (w->last_had_star)) 10007 != !NILP (w->last_had_star))
10008 || ((!NILP (Vtransient_mark_mode) 10008 || ((!NILP (Vtransient_mark_mode)
10009 && !NILP (B_ (XBUFFER (w->buffer), mark_active))) 10009 && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
10010 != !NILP (w->region_showing))) 10010 != !NILP (w->region_showing)))
10011 { 10011 {
10012 struct buffer *prev = current_buffer; 10012 struct buffer *prev = current_buffer;
@@ -11097,8 +11097,8 @@ text_outside_line_unchanged_p (struct window *w,
11097 /* If selective display, can't optimize if changes start at the 11097 /* If selective display, can't optimize if changes start at the
11098 beginning of the line. */ 11098 beginning of the line. */
11099 if (unchanged_p 11099 if (unchanged_p
11100 && INTEGERP (B_ (current_buffer, selective_display)) 11100 && INTEGERP (BVAR (current_buffer, selective_display))
11101 && XINT (B_ (current_buffer, selective_display)) > 0 11101 && XINT (BVAR (current_buffer, selective_display)) > 0
11102 && (BEG_UNCHANGED < start || GPT <= start)) 11102 && (BEG_UNCHANGED < start || GPT <= start))
11103 unchanged_p = 0; 11103 unchanged_p = 0;
11104 11104
@@ -11126,8 +11126,8 @@ text_outside_line_unchanged_p (struct window *w,
11126 require to redisplay the whole paragraph. It might be worthwhile 11126 require to redisplay the whole paragraph. It might be worthwhile
11127 to find the paragraph limits and widen the range of redisplayed 11127 to find the paragraph limits and widen the range of redisplayed
11128 lines to that, but for now just give up this optimization. */ 11128 lines to that, but for now just give up this optimization. */
11129 if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) 11129 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
11130 && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction))) 11130 && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction)))
11131 unchanged_p = 0; 11131 unchanged_p = 0;
11132 } 11132 }
11133 11133
@@ -11419,6 +11419,7 @@ static void
11419redisplay_internal (int preserve_echo_area) 11419redisplay_internal (int preserve_echo_area)
11420{ 11420{
11421 struct window *w = XWINDOW (selected_window); 11421 struct window *w = XWINDOW (selected_window);
11422 struct window *sw;
11422 struct frame *f; 11423 struct frame *f;
11423 int pause; 11424 int pause;
11424 int must_finish = 0; 11425 int must_finish = 0;
@@ -11479,6 +11480,9 @@ redisplay_internal (int preserve_echo_area)
11479 } 11480 }
11480 11481
11481 retry: 11482 retry:
11483 /* Remember the currently selected window. */
11484 sw = w;
11485
11482 if (!EQ (old_frame, selected_frame) 11486 if (!EQ (old_frame, selected_frame)
11483 && FRAME_LIVE_P (XFRAME (old_frame))) 11487 && FRAME_LIVE_P (XFRAME (old_frame)))
11484 /* When running redisplay, we play a bit fast-and-loose and allow e.g. 11488 /* When running redisplay, we play a bit fast-and-loose and allow e.g.
@@ -11546,6 +11550,14 @@ redisplay_internal (int preserve_echo_area)
11546 /* Notice any pending interrupt request to change frame size. */ 11550 /* Notice any pending interrupt request to change frame size. */
11547 do_pending_window_change (1); 11551 do_pending_window_change (1);
11548 11552
11553 /* do_pending_window_change could change the selected_window due to
11554 frame resizing which makes the selected window too small. */
11555 if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw)
11556 {
11557 sw = w;
11558 reconsider_clip_changes (w, current_buffer);
11559 }
11560
11549 /* Clear frames marked as garbaged. */ 11561 /* Clear frames marked as garbaged. */
11550 if (frame_garbaged) 11562 if (frame_garbaged)
11551 clear_garbaged_frames (); 11563 clear_garbaged_frames ();
@@ -11662,11 +11674,11 @@ redisplay_internal (int preserve_echo_area)
11662 the whole window. The assignment to this_line_start_pos prevents 11674 the whole window. The assignment to this_line_start_pos prevents
11663 the optimization directly below this if-statement. */ 11675 the optimization directly below this if-statement. */
11664 if (((!NILP (Vtransient_mark_mode) 11676 if (((!NILP (Vtransient_mark_mode)
11665 && !NILP (B_ (XBUFFER (w->buffer), mark_active))) 11677 && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
11666 != !NILP (w->region_showing)) 11678 != !NILP (w->region_showing))
11667 || (!NILP (w->region_showing) 11679 || (!NILP (w->region_showing)
11668 && !EQ (w->region_showing, 11680 && !EQ (w->region_showing,
11669 Fmarker_position (B_ (XBUFFER (w->buffer), mark))))) 11681 Fmarker_position (BVAR (XBUFFER (w->buffer), mark)))))
11670 CHARPOS (this_line_start_pos) = 0; 11682 CHARPOS (this_line_start_pos) = 0;
11671 11683
11672 /* Optimize the case that only the line containing the cursor in the 11684 /* Optimize the case that only the line containing the cursor in the
@@ -11815,6 +11827,10 @@ redisplay_internal (int preserve_echo_area)
11815 if (!must_finish) 11827 if (!must_finish)
11816 { 11828 {
11817 do_pending_window_change (1); 11829 do_pending_window_change (1);
11830 /* If selected_window changed, redisplay again. */
11831 if (WINDOWP (selected_window)
11832 && (w = XWINDOW (selected_window)) != sw)
11833 goto retry;
11818 11834
11819 /* We used to always goto end_of_redisplay here, but this 11835 /* We used to always goto end_of_redisplay here, but this
11820 isn't enough if we have a blinking cursor. */ 11836 isn't enough if we have a blinking cursor. */
@@ -11826,8 +11842,8 @@ redisplay_internal (int preserve_echo_area)
11826 /* If highlighting the region, or if the cursor is in the echo area, 11842 /* If highlighting the region, or if the cursor is in the echo area,
11827 then we can't just move the cursor. */ 11843 then we can't just move the cursor. */
11828 else if (! (!NILP (Vtransient_mark_mode) 11844 else if (! (!NILP (Vtransient_mark_mode)
11829 && !NILP (B_ (current_buffer, mark_active))) 11845 && !NILP (BVAR (current_buffer, mark_active)))
11830 && (EQ (selected_window, B_ (current_buffer, last_selected_window)) 11846 && (EQ (selected_window, BVAR (current_buffer, last_selected_window))
11831 || highlight_nonselected_windows) 11847 || highlight_nonselected_windows)
11832 && NILP (w->region_showing) 11848 && NILP (w->region_showing)
11833 && NILP (Vshow_trailing_whitespace) 11849 && NILP (Vshow_trailing_whitespace)
@@ -12109,8 +12125,9 @@ redisplay_internal (int preserve_echo_area)
12109 do_pending_window_change (1); 12125 do_pending_window_change (1);
12110 12126
12111 /* If we just did a pending size change, or have additional 12127 /* If we just did a pending size change, or have additional
12112 visible frames, redisplay again. */ 12128 visible frames, or selected_window changed, redisplay again. */
12113 if (windows_or_buffers_changed && !pause) 12129 if ((windows_or_buffers_changed && !pause)
12130 || (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw))
12114 goto retry; 12131 goto retry;
12115 12132
12116 /* Clear the face and image caches. 12133 /* Clear the face and image caches.
@@ -13033,8 +13050,8 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
13033 scroll_max = (max (scroll_step, 13050 scroll_max = (max (scroll_step,
13034 max (arg_scroll_conservatively, temp_scroll_step)) 13051 max (arg_scroll_conservatively, temp_scroll_step))
13035 * FRAME_LINE_HEIGHT (f)); 13052 * FRAME_LINE_HEIGHT (f));
13036 else if (NUMBERP (B_ (current_buffer, scroll_down_aggressively)) 13053 else if (NUMBERP (BVAR (current_buffer, scroll_down_aggressively))
13037 || NUMBERP (B_ (current_buffer, scroll_up_aggressively))) 13054 || NUMBERP (BVAR (current_buffer, scroll_up_aggressively)))
13038 /* We're trying to scroll because of aggressive scrolling but no 13055 /* We're trying to scroll because of aggressive scrolling but no
13039 scroll_step is set. Choose an arbitrary one. */ 13056 scroll_step is set. Choose an arbitrary one. */
13040 scroll_max = 10 * FRAME_LINE_HEIGHT (f); 13057 scroll_max = 10 * FRAME_LINE_HEIGHT (f);
@@ -13099,7 +13116,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
13099 amount_to_scroll = scroll_max; 13116 amount_to_scroll = scroll_max;
13100 else 13117 else
13101 { 13118 {
13102 aggressive = B_ (current_buffer, scroll_up_aggressively); 13119 aggressive = BVAR (current_buffer, scroll_up_aggressively);
13103 height = WINDOW_BOX_TEXT_HEIGHT (w); 13120 height = WINDOW_BOX_TEXT_HEIGHT (w);
13104 if (NUMBERP (aggressive)) 13121 if (NUMBERP (aggressive))
13105 { 13122 {
@@ -13182,7 +13199,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
13182 amount_to_scroll = scroll_max; 13199 amount_to_scroll = scroll_max;
13183 else 13200 else
13184 { 13201 {
13185 aggressive = B_ (current_buffer, scroll_down_aggressively); 13202 aggressive = BVAR (current_buffer, scroll_down_aggressively);
13186 height = WINDOW_BOX_TEXT_HEIGHT (w); 13203 height = WINDOW_BOX_TEXT_HEIGHT (w);
13187 if (NUMBERP (aggressive)) 13204 if (NUMBERP (aggressive))
13188 { 13205 {
@@ -13363,7 +13380,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
13363 region exists, cursor movement has to do more than just 13380 region exists, cursor movement has to do more than just
13364 set the cursor. */ 13381 set the cursor. */
13365 && !(!NILP (Vtransient_mark_mode) 13382 && !(!NILP (Vtransient_mark_mode)
13366 && !NILP (B_ (current_buffer, mark_active))) 13383 && !NILP (BVAR (current_buffer, mark_active)))
13367 && NILP (w->region_showing) 13384 && NILP (w->region_showing)
13368 && NILP (Vshow_trailing_whitespace) 13385 && NILP (Vshow_trailing_whitespace)
13369 /* Right after splitting windows, last_point may be nil. */ 13386 /* Right after splitting windows, last_point may be nil. */
@@ -13518,7 +13535,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
13518 must_scroll = 1; 13535 must_scroll = 1;
13519 } 13536 }
13520 else if (rc != CURSOR_MOVEMENT_SUCCESS 13537 else if (rc != CURSOR_MOVEMENT_SUCCESS
13521 && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) 13538 && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
13522 { 13539 {
13523 /* If rows are bidi-reordered and point moved, back up 13540 /* If rows are bidi-reordered and point moved, back up
13524 until we find a row that does not belong to a 13541 until we find a row that does not belong to a
@@ -13576,7 +13593,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
13576 else if (scroll_p) 13593 else if (scroll_p)
13577 rc = CURSOR_MOVEMENT_MUST_SCROLL; 13594 rc = CURSOR_MOVEMENT_MUST_SCROLL;
13578 else if (rc != CURSOR_MOVEMENT_SUCCESS 13595 else if (rc != CURSOR_MOVEMENT_SUCCESS
13579 && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) 13596 && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
13580 { 13597 {
13581 /* With bidi-reordered rows, there could be more than 13598 /* With bidi-reordered rows, there could be more than
13582 one candidate row whose start and end positions 13599 one candidate row whose start and end positions
@@ -13876,7 +13893,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
13876 struct Lisp_Char_Table *disptab = buffer_display_table (); 13893 struct Lisp_Char_Table *disptab = buffer_display_table ();
13877 13894
13878 if (! disptab_matches_widthtab (disptab, 13895 if (! disptab_matches_widthtab (disptab,
13879 XVECTOR (B_ (current_buffer, width_table)))) 13896 XVECTOR (BVAR (current_buffer, width_table))))
13880 { 13897 {
13881 invalidate_region_cache (current_buffer, 13898 invalidate_region_cache (current_buffer,
13882 current_buffer->width_run_cache, 13899 current_buffer->width_run_cache,
@@ -13998,7 +14015,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
13998 /* If we are highlighting the region, then we just changed 14015 /* If we are highlighting the region, then we just changed
13999 the region, so redisplay to show it. */ 14016 the region, so redisplay to show it. */
14000 if (!NILP (Vtransient_mark_mode) 14017 if (!NILP (Vtransient_mark_mode)
14001 && !NILP (B_ (current_buffer, mark_active))) 14018 && !NILP (BVAR (current_buffer, mark_active)))
14002 { 14019 {
14003 clear_glyph_matrix (w->desired_matrix); 14020 clear_glyph_matrix (w->desired_matrix);
14004 if (!try_window (window, startp, 0)) 14021 if (!try_window (window, startp, 0))
@@ -14161,8 +14178,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14161 if ((scroll_conservatively 14178 if ((scroll_conservatively
14162 || emacs_scroll_step 14179 || emacs_scroll_step
14163 || temp_scroll_step 14180 || temp_scroll_step
14164 || NUMBERP (B_ (current_buffer, scroll_up_aggressively)) 14181 || NUMBERP (BVAR (current_buffer, scroll_up_aggressively))
14165 || NUMBERP (B_ (current_buffer, scroll_down_aggressively))) 14182 || NUMBERP (BVAR (current_buffer, scroll_down_aggressively)))
14166 && !current_buffer->clip_changed 14183 && !current_buffer->clip_changed
14167 && CHARPOS (startp) >= BEGV 14184 && CHARPOS (startp) >= BEGV
14168 && CHARPOS (startp) <= ZV) 14185 && CHARPOS (startp) <= ZV)
@@ -14605,7 +14622,7 @@ try_window_reusing_current_matrix (struct window *w)
14605 14622
14606 /* Can't do this if region may have changed. */ 14623 /* Can't do this if region may have changed. */
14607 if ((!NILP (Vtransient_mark_mode) 14624 if ((!NILP (Vtransient_mark_mode)
14608 && !NILP (B_ (current_buffer, mark_active))) 14625 && !NILP (BVAR (current_buffer, mark_active)))
14609 || !NILP (w->region_showing) 14626 || !NILP (w->region_showing)
14610 || !NILP (Vshow_trailing_whitespace)) 14627 || !NILP (Vshow_trailing_whitespace))
14611 return 0; 14628 return 0;
@@ -14948,7 +14965,7 @@ try_window_reusing_current_matrix (struct window *w)
14948 14965
14949 /* Can't use this optimization with bidi-reordered glyph 14966 /* Can't use this optimization with bidi-reordered glyph
14950 rows, unless cursor is already at point. */ 14967 rows, unless cursor is already at point. */
14951 if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) 14968 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
14952 { 14969 {
14953 if (!(w->cursor.hpos >= 0 14970 if (!(w->cursor.hpos >= 0
14954 && w->cursor.hpos < row->used[TEXT_AREA] 14971 && w->cursor.hpos < row->used[TEXT_AREA]
@@ -15262,7 +15279,7 @@ row_containing_pos (struct window *w, EMACS_INT charpos,
15262 { 15279 {
15263 struct glyph *g; 15280 struct glyph *g;
15264 15281
15265 if (NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) 15282 if (NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
15266 || (!best_row && !row->continued_p)) 15283 || (!best_row && !row->continued_p))
15267 return row; 15284 return row;
15268 /* In bidi-reordered rows, there could be several rows 15285 /* In bidi-reordered rows, there could be several rows
@@ -15409,7 +15426,7 @@ try_window_id (struct window *w)
15409 /* Can't use this if highlighting a region because a cursor movement 15426 /* Can't use this if highlighting a region because a cursor movement
15410 will do more than just set the cursor. */ 15427 will do more than just set the cursor. */
15411 if (!NILP (Vtransient_mark_mode) 15428 if (!NILP (Vtransient_mark_mode)
15412 && !NILP (B_ (current_buffer, mark_active))) 15429 && !NILP (BVAR (current_buffer, mark_active)))
15413 GIVE_UP (9); 15430 GIVE_UP (9);
15414 15431
15415 /* Likewise if highlighting trailing whitespace. */ 15432 /* Likewise if highlighting trailing whitespace. */
@@ -15429,7 +15446,7 @@ try_window_id (struct window *w)
15429 wrapped line can change the wrap position, altering the line 15446 wrapped line can change the wrap position, altering the line
15430 above it. It might be worthwhile to handle this more 15447 above it. It might be worthwhile to handle this more
15431 intelligently, but for now just redisplay from scratch. */ 15448 intelligently, but for now just redisplay from scratch. */
15432 if (!NILP (B_ (XBUFFER (w->buffer), word_wrap))) 15449 if (!NILP (BVAR (XBUFFER (w->buffer), word_wrap)))
15433 GIVE_UP (21); 15450 GIVE_UP (21);
15434 15451
15435 /* Under bidi reordering, adding or deleting a character in the 15452 /* Under bidi reordering, adding or deleting a character in the
@@ -15440,8 +15457,8 @@ try_window_id (struct window *w)
15440 to find the paragraph limits and widen the range of redisplayed 15457 to find the paragraph limits and widen the range of redisplayed
15441 lines to that, but for now just give up this optimization and 15458 lines to that, but for now just give up this optimization and
15442 redisplay from scratch. */ 15459 redisplay from scratch. */
15443 if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) 15460 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
15444 && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction))) 15461 && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction)))
15445 GIVE_UP (22); 15462 GIVE_UP (22);
15446 15463
15447 /* Make sure beg_unchanged and end_unchanged are up to date. Do it 15464 /* Make sure beg_unchanged and end_unchanged are up to date. Do it
@@ -16412,7 +16429,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
16412 it.glyph_row->used[TEXT_AREA] = 0; 16429 it.glyph_row->used[TEXT_AREA] = 0;
16413 SET_TEXT_POS (it.position, 0, 0); 16430 SET_TEXT_POS (it.position, 0, 0);
16414 16431
16415 multibyte_p = !NILP (B_ (buffer, enable_multibyte_characters)); 16432 multibyte_p = !NILP (BVAR (buffer, enable_multibyte_characters));
16416 p = arrow_string; 16433 p = arrow_string;
16417 while (p < arrow_end) 16434 while (p < arrow_end)
16418 { 16435 {
@@ -17347,7 +17364,7 @@ display_line (struct it *it)
17347 row->glyphs[TEXT_AREA]->charpos = -1; 17364 row->glyphs[TEXT_AREA]->charpos = -1;
17348 row->displays_text_p = 0; 17365 row->displays_text_p = 0;
17349 17366
17350 if (!NILP (B_ (XBUFFER (it->w->buffer), indicate_empty_lines)) 17367 if (!NILP (BVAR (XBUFFER (it->w->buffer), indicate_empty_lines))
17351 && (!MINI_WINDOW_P (it->w) 17368 && (!MINI_WINDOW_P (it->w)
17352 || (minibuf_level && EQ (it->window, minibuf_window)))) 17369 || (minibuf_level && EQ (it->window, minibuf_window))))
17353 row->indicate_empty_line_p = 1; 17370 row->indicate_empty_line_p = 1;
@@ -17925,10 +17942,10 @@ See also `bidi-paragraph-direction'. */)
17925 old = current_buffer; 17942 old = current_buffer;
17926 } 17943 }
17927 17944
17928 if (NILP (B_ (buf, bidi_display_reordering))) 17945 if (NILP (BVAR (buf, bidi_display_reordering)))
17929 return Qleft_to_right; 17946 return Qleft_to_right;
17930 else if (!NILP (B_ (buf, bidi_paragraph_direction))) 17947 else if (!NILP (BVAR (buf, bidi_paragraph_direction)))
17931 return B_ (buf, bidi_paragraph_direction); 17948 return BVAR (buf, bidi_paragraph_direction);
17932 else 17949 else
17933 { 17950 {
17934 /* Determine the direction from buffer text. We could try to 17951 /* Determine the direction from buffer text. We could try to
@@ -18187,14 +18204,14 @@ display_mode_lines (struct window *w)
18187 18204
18188 /* Select mode line face based on the real selected window. */ 18205 /* Select mode line face based on the real selected window. */
18189 display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w), 18206 display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w),
18190 B_ (current_buffer, mode_line_format)); 18207 BVAR (current_buffer, mode_line_format));
18191 ++n; 18208 ++n;
18192 } 18209 }
18193 18210
18194 if (WINDOW_WANTS_HEADER_LINE_P (w)) 18211 if (WINDOW_WANTS_HEADER_LINE_P (w))
18195 { 18212 {
18196 display_mode_line (w, HEADER_LINE_FACE_ID, 18213 display_mode_line (w, HEADER_LINE_FACE_ID,
18197 B_ (current_buffer, header_line_format)); 18214 BVAR (current_buffer, header_line_format));
18198 ++n; 18215 ++n;
18199 } 18216 }
18200 18217
@@ -19129,7 +19146,7 @@ static char *
19129decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag) 19146decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag)
19130{ 19147{
19131 Lisp_Object val; 19148 Lisp_Object val;
19132 int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); 19149 int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
19133 const unsigned char *eol_str; 19150 const unsigned char *eol_str;
19134 int eol_str_len; 19151 int eol_str_len;
19135 /* The EOL conversion we are using. */ 19152 /* The EOL conversion we are using. */
@@ -19225,7 +19242,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19225 switch (c) 19242 switch (c)
19226 { 19243 {
19227 case '*': 19244 case '*':
19228 if (!NILP (B_ (b, read_only))) 19245 if (!NILP (BVAR (b, read_only)))
19229 return "%"; 19246 return "%";
19230 if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) 19247 if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
19231 return "*"; 19248 return "*";
@@ -19235,7 +19252,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19235 /* This differs from %* only for a modified read-only buffer. */ 19252 /* This differs from %* only for a modified read-only buffer. */
19236 if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) 19253 if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
19237 return "*"; 19254 return "*";
19238 if (!NILP (B_ (b, read_only))) 19255 if (!NILP (BVAR (b, read_only)))
19239 return "%"; 19256 return "%";
19240 return "-"; 19257 return "-";
19241 19258
@@ -19297,7 +19314,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19297 } 19314 }
19298 19315
19299 case 'b': 19316 case 'b':
19300 obj = B_ (b, name); 19317 obj = BVAR (b, name);
19301 break; 19318 break;
19302 19319
19303 case 'c': 19320 case 'c':
@@ -19337,7 +19354,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19337 return "Emacs"; 19354 return "Emacs";
19338 19355
19339 case 'f': 19356 case 'f':
19340 obj = B_ (b, filename); 19357 obj = BVAR (b, filename);
19341 break; 19358 break;
19342 19359
19343 case 'i': 19360 case 'i':
@@ -19473,7 +19490,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19473 break; 19490 break;
19474 19491
19475 case 'm': 19492 case 'm':
19476 obj = B_ (b, mode_name); 19493 obj = BVAR (b, mode_name);
19477 break; 19494 break;
19478 19495
19479 case 'n': 19496 case 'n':
@@ -19558,7 +19575,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19558 { 19575 {
19559 int count = inhibit_garbage_collection (); 19576 int count = inhibit_garbage_collection ();
19560 Lisp_Object val = call1 (intern ("file-remote-p"), 19577 Lisp_Object val = call1 (intern ("file-remote-p"),
19561 B_ (current_buffer, directory)); 19578 BVAR (current_buffer, directory));
19562 unbind_to (count, Qnil); 19579 unbind_to (count, Qnil);
19563 19580
19564 if (NILP (val)) 19581 if (NILP (val))
@@ -19568,11 +19585,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19568 } 19585 }
19569 19586
19570 case 't': /* indicate TEXT or BINARY */ 19587 case 't': /* indicate TEXT or BINARY */
19571#ifdef MODE_LINE_BINARY_TEXT
19572 return MODE_LINE_BINARY_TEXT (b);
19573#else
19574 return "T"; 19588 return "T";
19575#endif
19576 19589
19577 case 'z': 19590 case 'z':
19578 /* coding-system (not including end-of-line format) */ 19591 /* coding-system (not including end-of-line format) */
@@ -19593,7 +19606,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
19593 (FRAME_TERMINAL_CODING (f)->id), 19606 (FRAME_TERMINAL_CODING (f)->id),
19594 p, 0); 19607 p, 0);
19595 } 19608 }
19596 p = decode_mode_spec_coding (B_ (b, buffer_file_coding_system), 19609 p = decode_mode_spec_coding (BVAR (b, buffer_file_coding_system),
19597 p, eol_flag); 19610 p, eol_flag);
19598 19611
19599#if 0 /* This proves to be annoying; I think we can do without. -- rms. */ 19612#if 0 /* This proves to be annoying; I think we can do without. -- rms. */
@@ -19643,8 +19656,8 @@ display_count_lines (EMACS_INT start, EMACS_INT start_byte,
19643 19656
19644 /* If we are not in selective display mode, 19657 /* If we are not in selective display mode,
19645 check only for newlines. */ 19658 check only for newlines. */
19646 int selective_display = (!NILP (B_ (current_buffer, selective_display)) 19659 int selective_display = (!NILP (BVAR (current_buffer, selective_display))
19647 && !INTEGERP (B_ (current_buffer, selective_display))); 19660 && !INTEGERP (BVAR (current_buffer, selective_display)));
19648 19661
19649 if (count > 0) 19662 if (count > 0)
19650 { 19663 {
@@ -23291,13 +23304,13 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
23291 { 23304 {
23292 if (w == XWINDOW (echo_area_window)) 23305 if (w == XWINDOW (echo_area_window))
23293 { 23306 {
23294 if (EQ (B_ (b, cursor_type), Qt) || NILP (B_ (b, cursor_type))) 23307 if (EQ (BVAR (b, cursor_type), Qt) || NILP (BVAR (b, cursor_type)))
23295 { 23308 {
23296 *width = FRAME_CURSOR_WIDTH (f); 23309 *width = FRAME_CURSOR_WIDTH (f);
23297 return FRAME_DESIRED_CURSOR (f); 23310 return FRAME_DESIRED_CURSOR (f);
23298 } 23311 }
23299 else 23312 else
23300 return get_specified_cursor_type (B_ (b, cursor_type), width); 23313 return get_specified_cursor_type (BVAR (b, cursor_type), width);
23301 } 23314 }
23302 23315
23303 *active_cursor = 0; 23316 *active_cursor = 0;
@@ -23317,23 +23330,23 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
23317 } 23330 }
23318 23331
23319 /* Never display a cursor in a window in which cursor-type is nil. */ 23332 /* Never display a cursor in a window in which cursor-type is nil. */
23320 if (NILP (B_ (b, cursor_type))) 23333 if (NILP (BVAR (b, cursor_type)))
23321 return NO_CURSOR; 23334 return NO_CURSOR;
23322 23335
23323 /* Get the normal cursor type for this window. */ 23336 /* Get the normal cursor type for this window. */
23324 if (EQ (B_ (b, cursor_type), Qt)) 23337 if (EQ (BVAR (b, cursor_type), Qt))
23325 { 23338 {
23326 cursor_type = FRAME_DESIRED_CURSOR (f); 23339 cursor_type = FRAME_DESIRED_CURSOR (f);
23327 *width = FRAME_CURSOR_WIDTH (f); 23340 *width = FRAME_CURSOR_WIDTH (f);
23328 } 23341 }
23329 else 23342 else
23330 cursor_type = get_specified_cursor_type (B_ (b, cursor_type), width); 23343 cursor_type = get_specified_cursor_type (BVAR (b, cursor_type), width);
23331 23344
23332 /* Use cursor-in-non-selected-windows instead 23345 /* Use cursor-in-non-selected-windows instead
23333 for non-selected window or frame. */ 23346 for non-selected window or frame. */
23334 if (non_selected) 23347 if (non_selected)
23335 { 23348 {
23336 alt_cursor = B_ (b, cursor_in_non_selected_windows); 23349 alt_cursor = BVAR (b, cursor_in_non_selected_windows);
23337 if (!EQ (Qt, alt_cursor)) 23350 if (!EQ (Qt, alt_cursor))
23338 return get_specified_cursor_type (alt_cursor, width); 23351 return get_specified_cursor_type (alt_cursor, width);
23339 /* t means modify the normal cursor type. */ 23352 /* t means modify the normal cursor type. */
@@ -23380,7 +23393,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
23380 /* Cursor is blinked off, so determine how to "toggle" it. */ 23393 /* Cursor is blinked off, so determine how to "toggle" it. */
23381 23394
23382 /* First look for an entry matching the buffer's cursor-type in blink-cursor-alist. */ 23395 /* First look for an entry matching the buffer's cursor-type in blink-cursor-alist. */
23383 if ((alt_cursor = Fassoc (B_ (b, cursor_type), Vblink_cursor_alist), !NILP (alt_cursor))) 23396 if ((alt_cursor = Fassoc (BVAR (b, cursor_type), Vblink_cursor_alist), !NILP (alt_cursor)))
23384 return get_specified_cursor_type (XCDR (alt_cursor), width); 23397 return get_specified_cursor_type (XCDR (alt_cursor), width);
23385 23398
23386 /* Then see if frame has specified a specific blink off cursor type. */ 23399 /* Then see if frame has specified a specific blink off cursor type. */
@@ -25496,11 +25509,11 @@ note_mouse_highlight (struct frame *f, int x, int y)
25496 necessarily display the character whose position 25509 necessarily display the character whose position
25497 is the smallest. */ 25510 is the smallest. */
25498 Lisp_Object lim1 = 25511 Lisp_Object lim1 =
25499 NILP (B_ (XBUFFER (buffer), bidi_display_reordering)) 25512 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
25500 ? Fmarker_position (w->start) 25513 ? Fmarker_position (w->start)
25501 : Qnil; 25514 : Qnil;
25502 Lisp_Object lim2 = 25515 Lisp_Object lim2 =
25503 NILP (B_ (XBUFFER (buffer), bidi_display_reordering)) 25516 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
25504 ? make_number (BUF_Z (XBUFFER (buffer)) 25517 ? make_number (BUF_Z (XBUFFER (buffer))
25505 - XFASTINT (w->window_end_pos)) 25518 - XFASTINT (w->window_end_pos))
25506 : Qnil; 25519 : Qnil;
diff --git a/src/xfaces.c b/src/xfaces.c
index 9ae35a74bd1..4cc47c85050 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5970,7 +5970,7 @@ compute_char_face (struct frame *f, int ch, Lisp_Object prop)
5970{ 5970{
5971 int face_id; 5971 int face_id;
5972 5972
5973 if (NILP (B_ (current_buffer, enable_multibyte_characters))) 5973 if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
5974 ch = 0; 5974 ch = 0;
5975 5975
5976 if (NILP (prop)) 5976 if (NILP (prop))
diff --git a/src/xfns.c b/src/xfns.c
index 062bb105d0a..deb0e192a54 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3473,9 +3473,9 @@ This function is an internal primitive--use `make-frame' instead. */)
3473 /* Initialize `default-minibuffer-frame' in case this is the first 3473 /* Initialize `default-minibuffer-frame' in case this is the first
3474 frame on this terminal. */ 3474 frame on this terminal. */
3475 if (FRAME_HAS_MINIBUF_P (f) 3475 if (FRAME_HAS_MINIBUF_P (f)
3476 && (!FRAMEP (kb->Vdefault_minibuffer_frame) 3476 && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
3477 || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) 3477 || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
3478 kb->Vdefault_minibuffer_frame = frame; 3478 KVAR (kb, Vdefault_minibuffer_frame) = frame;
3479 3479
3480 /* All remaining specified parameters, which have not been "used" 3480 /* All remaining specified parameters, which have not been "used"
3481 by x_get_arg and friends, now go in the misc. alist of the frame. */ 3481 by x_get_arg and friends, now go in the misc. alist of the frame. */
@@ -4610,7 +4610,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4610 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); 4610 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
4611 old_buffer = current_buffer; 4611 old_buffer = current_buffer;
4612 set_buffer_internal_1 (XBUFFER (buffer)); 4612 set_buffer_internal_1 (XBUFFER (buffer));
4613 B_ (current_buffer, truncate_lines) = Qnil; 4613 BVAR (current_buffer, truncate_lines) = Qnil;
4614 specbind (Qinhibit_read_only, Qt); 4614 specbind (Qinhibit_read_only, Qt);
4615 specbind (Qinhibit_modification_hooks, Qt); 4615 specbind (Qinhibit_modification_hooks, Qt);
4616 Ferase_buffer (); 4616 Ferase_buffer ();
@@ -5106,7 +5106,7 @@ Text larger than the specified size is clipped. */)
5106 /* Display the tooltip text in a temporary buffer. */ 5106 /* Display the tooltip text in a temporary buffer. */
5107 old_buffer = current_buffer; 5107 old_buffer = current_buffer;
5108 set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); 5108 set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
5109 B_ (current_buffer, truncate_lines) = Qnil; 5109 BVAR (current_buffer, truncate_lines) = Qnil;
5110 clear_glyph_matrix (w->desired_matrix); 5110 clear_glyph_matrix (w->desired_matrix);
5111 clear_glyph_matrix (w->current_matrix); 5111 clear_glyph_matrix (w->current_matrix);
5112 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); 5112 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
diff --git a/src/xterm.c b/src/xterm.c
index 52d79e8dad7..909b6978f5a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7727,7 +7727,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7727 { 7727 {
7728 /* Set this to t so that delete_frame won't get confused 7728 /* Set this to t so that delete_frame won't get confused
7729 trying to find a replacement. */ 7729 trying to find a replacement. */
7730 FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt; 7730 KVAR (FRAME_KBOARD (XFRAME (frame)), Vdefault_minibuffer_frame) = Qt;
7731 delete_frame (frame, Qnoelisp); 7731 delete_frame (frame, Qnoelisp);
7732 } 7732 }
7733 7733
@@ -9966,7 +9966,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9966 { 9966 {
9967 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 9967 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
9968 init_kboard (terminal->kboard); 9968 init_kboard (terminal->kboard);
9969 terminal->kboard->Vwindow_system = Qx; 9969 KVAR (terminal->kboard, Vwindow_system) = Qx;
9970 9970
9971 /* Add the keyboard to the list before running Lisp code (via 9971 /* Add the keyboard to the list before running Lisp code (via
9972 Qvendor_specific_keysyms below), since these are not traced 9972 Qvendor_specific_keysyms below), since these are not traced
@@ -9988,7 +9988,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9988 /* Temporarily hide the partially initialized terminal. */ 9988 /* Temporarily hide the partially initialized terminal. */
9989 terminal_list = terminal->next_terminal; 9989 terminal_list = terminal->next_terminal;
9990 UNBLOCK_INPUT; 9990 UNBLOCK_INPUT;
9991 terminal->kboard->Vsystem_key_alist 9991 KVAR (terminal->kboard, Vsystem_key_alist)
9992 = call1 (Qvendor_specific_keysyms, 9992 = call1 (Qvendor_specific_keysyms,
9993 vendor ? build_string (vendor) : empty_unibyte_string); 9993 vendor ? build_string (vendor) : empty_unibyte_string);
9994 BLOCK_INPUT; 9994 BLOCK_INPUT;