summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-02-14 08:39:19 -0700
committerTom Tromey <tromey@redhat.com>2011-02-14 08:39:19 -0700
commit5d8ea1203d1e659bc77d953784a85a6e7da0ce95 (patch)
tree1da71b86f9592b2f3390f0cd4d30ce41e74fbb55 /src
parent42f6055717e74ea9541c5cf6fd0fc6501bd907fd (diff)
downloademacs-5d8ea1203d1e659bc77d953784a85a6e7da0ce95.tar.gz
Hide implementation of `struct buffer'
* composite.c (fill_gstring_header) (composition_compute_stop_pos, composition_adjust_point) (Ffind_composition_internal): Use B_. * intervals.c (set_point_both, get_local_map): Use B_. * callproc.c (Fcall_process, Fcall_process_region): Use B_. * process.c (get_process, list_processes_1, Fstart_process) (Fmake_serial_process, Fmake_network_process) (read_process_output, send_process, exec_sentinel) (status_notify, setup_process_coding_systems): Use B_. * bytecode.c (Fbyte_code): Use B_. * syntax.c (update_syntax_table, dec_bytepos, Fsyntax_table) (Fset_syntax_table, Fmodify_syntax_entry, skip_chars) (skip_syntaxes, scan_lists): Use B_. * lread.c (readchar, unreadchar, openp, readevalloop) (Feval_buffer, Feval_region): Use B_. * print.c (printchar, strout, print_string, PRINTDECLARE) (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup) (print_object): Use B_. * font.c (font_at): Use B_. * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use B_. * callint.c (check_mark, Fcall_interactively): Use B_. * editfns.c (region_limit, Fmark_marker, save_excursion_save) (save_excursion_restore, Fprevious_char, Fchar_before) (general_insert_function, Finsert_char, Finsert_byte) (make_buffer_string_both, Finsert_buffer_substring) (Fcompare_buffer_substrings, subst_char_in_region_unwind) (subst_char_in_region_unwind_1, Fsubst_char_in_region) (Ftranslate_region_internal, save_restriction_restore) (Fchar_equal): Use B_. * data.c (swap_in_symval_forwarding, set_internal) (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p): Use B_. * undo.c (record_point, record_insert, record_delete) (record_marker_adjustment, record_first_change) (record_property_change, Fundo_boundary, truncate_undo_list) (Fprimitive_undo): Use B_. * search.c (compile_pattern_1, compile_pattern, looking_at_1) (string_match_1, fast_looking_at, newline_cache_on_off) (search_command, search_buffer, simple_search, boyer_moore) (Freplace_match): Use B_. * indent.c (buffer_display_table, recompute_width_table) (width_run_cache_on_off, current_column, scan_for_column) (Findent_to, position_indentation, compute_motion, vmotion): Use B_. * casefiddle.c (casify_object, casify_region): Use B_. * casetab.c (Fcurrent_case_table, set_case_table): Use B_. * cmds.c (Fself_insert_command, internal_self_insert): Use B_. * fileio.c (Fexpand_file_name, Ffile_directory_p) (Ffile_regular_p, Ffile_selinux_context) (Fset_file_selinux_context, Ffile_modes, Fset_file_modes) (Fset_file_times, Ffile_newer_than_file_p, decide_coding_unwind) (Finsert_file_contents, choose_write_coding_system) (Fwrite_region, build_annotations, Fverify_visited_file_modtime) (Fset_visited_file_modtime, auto_save_error, auto_save_1) (Fdo_auto_save, Fset_buffer_auto_saved): Use B_. * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_. * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) (set_marker_both, set_marker_restricted_both, unchain_marker): Use B_. * insdel.c (check_markers, insert_char, insert_1_both) (insert_from_string_1, insert_from_gap, insert_from_buffer_1) (adjust_after_replace, replace_range, del_range_2) (modify_region, prepare_to_modify_buffer) (Fcombine_after_change_execute): Use B_. * filelock.c (unlock_all_files, Flock_buffer, Funlock_buffer) (unlock_buffer): Use B_. * keymap.c (Flocal_key_binding, Fuse_local_map) (Fcurrent_local_map, push_key_description) (Fdescribe_buffer_bindings): Use B_. * keyboard.c (command_loop_1, read_char_minibuf_menu_prompt) (read_key_sequence): Use B_. * fringe.c (get_logical_cursor_bitmap) (get_logical_fringe_bitmap, update_window_fringes): Use B_. * xfns.c (x_create_tip_frame, Fx_show_tip): Use B_. * xfaces.c (compute_char_face): Use B_. * character.c (chars_in_text, Fget_byte): Use B_. * category.c (check_category_table, Fcategory_table) (Fset_category_table, char_category_set): Use B_. * coding.c (decode_coding, encode_coding) (make_conversion_work_buffer, decode_coding_gap) (decode_coding_object, encode_coding_object) (Fdetect_coding_region, Ffind_coding_systems_region_internal) (Funencodable_char_position, Fcheck_coding_systems_region): Use B_. * charset.c (Ffind_charset_region): Use B_. * window.c (window_display_table, unshow_buffer, window_loop) (window_min_size_2, set_window_buffer, Fset_window_buffer) (select_window, Fforce_window_update, temp_output_buffer_show) (Fset_window_configuration, save_window_save): Use B_. * xdisp.c (pos_visible_p, init_iterator, reseat_1) (message_dolog, update_echo_area, ensure_echo_area_buffers) (with_echo_area_buffer, setup_echo_area_for_printing) (set_message_1, update_menu_bar, update_tool_bar) (text_outside_line_unchanged_p, redisplay_internal) (try_scrolling, try_cursor_movement, redisplay_window) (try_window_reusing_current_matrix, row_containing_pos) (try_window_id, get_overlay_arrow_glyph_row, display_line) (Fcurrent_bidi_paragraph_direction, display_mode_lines) (decode_mode_spec_coding, decode_mode_spec, display_count_lines) (get_window_cursor_type, note_mouse_highlight): Use B_. * frame.c (make_frame_visible_1): Use B_. * dispnew.c (Fframe_or_buffer_changed_p): Use B_. * dispextern.h (WINDOW_WANTS_HEADER_LINE_P) (WINDOW_WANTS_MODELINE_P): Use B_. * syntax.h (Vstandard_syntax_table): Update. (CURRENT_SYNTAX_TABLE, SETUP_BUFFER_SYNTAX_TABLE): Use B_. * intervals.h (TEXT_PROP_MEANS_INVISIBLE): Update. (TEXT_PROP_MEANS_INVISIBLE): Use B_. * character.h (FETCH_CHAR_ADVANCE): Update. (INC_BOTH, ASCII_CHAR_WIDTH, DEC_BOTH): Use B_. * category.h (Vstandard_category_table): Update. * lisp.h (DEFVAR_BUFFER_DEFAULTS): Update for change to field names. (DOWNCASE_TABLE, UPCASE_TABLE): Use B_. * buffer.c (swapfield_): New macro. (Fbuffer_swap_text): Use swapfield_ where appropriate. (Fbuffer_live_p, Fget_file_buffer, get_truename_buffer) (Fget_buffer_create, clone_per_buffer_values) (Fmake_indirect_buffer, reset_buffer) (reset_buffer_local_variables, Fbuffer_name, Fbuffer_file_name) (Fbuffer_local_value, buffer_lisp_local_variables) (Fset_buffer_modified_p, Frestore_buffer_modified_p) (Frename_buffer, Fother_buffer, Fbuffer_enable_undo) (Fkill_buffer, Fset_buffer_major_mode, set_buffer_internal_1) (set_buffer_temp, Fset_buffer, set_buffer_if_live) (Fbarf_if_buffer_read_only, Fbury_buffer, Ferase_buffer) (Fbuffer_swap_text, Fset_buffer_multibyte) (swap_out_buffer_local_variables, record_overlay_string) (overlay_strings, init_buffer_once, init_buffer, syms_of_buffer): Use B_. * buffer.h (struct buffer): Rename all Lisp_Object fields. (BUFFER_INTERNAL_FIELD, B_): New macro. (FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE): Use B_.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog137
-rw-r--r--src/alloc.c16
-rw-r--r--src/buffer.c680
-rw-r--r--src/buffer.h151
-rw-r--r--src/bytecode.c2
-rw-r--r--src/callint.c16
-rw-r--r--src/callproc.c12
-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.c22
-rw-r--r--src/coding.c36
-rw-r--r--src/composite.c8
-rw-r--r--src/data.c24
-rw-r--r--src/dispextern.h6
-rw-r--r--src/dispnew.c8
-rw-r--r--src/editfns.c74
-rw-r--r--src/fileio.c174
-rw-r--r--src/filelock.c14
-rw-r--r--src/fns.c12
-rw-r--r--src/font.c2
-rw-r--r--src/frame.c2
-rw-r--r--src/fringe.c18
-rw-r--r--src/indent.c62
-rw-r--r--src/insdel.c56
-rw-r--r--src/intervals.c4
-rw-r--r--src/intervals.h4
-rw-r--r--src/keyboard.c10
-rw-r--r--src/keymap.c12
-rw-r--r--src/lisp.h6
-rw-r--r--src/lread.c16
-rw-r--r--src/marker.c12
-rw-r--r--src/minibuf.c22
-rw-r--r--src/print.c40
-rw-r--r--src/process.c58
-rw-r--r--src/search.c48
-rw-r--r--src/syntax.c16
-rw-r--r--src/syntax.h6
-rw-r--r--src/undo.c62
-rw-r--r--src/window.c60
-rw-r--r--src/xdisp.c186
-rw-r--r--src/xfaces.c2
-rw-r--r--src/xfns.c4
47 files changed, 1151 insertions, 999 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 721bb93dfda..550ed88efc2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,140 @@
+2011-02-14 Tom Tromey <tromey@parfait>
+
+ * composite.c (fill_gstring_header)
+ (composition_compute_stop_pos, composition_adjust_point)
+ (Ffind_composition_internal): Use B_.
+ * intervals.c (set_point_both, get_local_map): Use B_.
+ * callproc.c (Fcall_process, Fcall_process_region): Use B_.
+ * process.c (get_process, list_processes_1, Fstart_process)
+ (Fmake_serial_process, Fmake_network_process)
+ (read_process_output, send_process, exec_sentinel)
+ (status_notify, setup_process_coding_systems): Use B_.
+ * bytecode.c (Fbyte_code): Use B_.
+ * syntax.c (update_syntax_table, dec_bytepos, Fsyntax_table)
+ (Fset_syntax_table, Fmodify_syntax_entry, skip_chars)
+ (skip_syntaxes, scan_lists): Use B_.
+ * lread.c (readchar, unreadchar, openp, readevalloop)
+ (Feval_buffer, Feval_region): Use B_.
+ * print.c (printchar, strout, print_string, PRINTDECLARE)
+ (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup)
+ (print_object): Use B_.
+ * font.c (font_at): Use B_.
+ * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use
+ B_.
+ * callint.c (check_mark, Fcall_interactively): Use B_.
+ * editfns.c (region_limit, Fmark_marker, save_excursion_save)
+ (save_excursion_restore, Fprevious_char, Fchar_before)
+ (general_insert_function, Finsert_char, Finsert_byte)
+ (make_buffer_string_both, Finsert_buffer_substring)
+ (Fcompare_buffer_substrings, subst_char_in_region_unwind)
+ (subst_char_in_region_unwind_1, Fsubst_char_in_region)
+ (Ftranslate_region_internal, save_restriction_restore)
+ (Fchar_equal): Use B_.
+ * data.c (swap_in_symval_forwarding, set_internal)
+ (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p):
+ Use B_.
+ * undo.c (record_point, record_insert, record_delete)
+ (record_marker_adjustment, record_first_change)
+ (record_property_change, Fundo_boundary, truncate_undo_list)
+ (Fprimitive_undo): Use B_.
+ * search.c (compile_pattern_1, compile_pattern, looking_at_1)
+ (string_match_1, fast_looking_at, newline_cache_on_off)
+ (search_command, search_buffer, simple_search, boyer_moore)
+ (Freplace_match): Use B_.
+ * indent.c (buffer_display_table, recompute_width_table)
+ (width_run_cache_on_off, current_column, scan_for_column)
+ (Findent_to, position_indentation, compute_motion, vmotion): Use
+ B_.
+ * casefiddle.c (casify_object, casify_region): Use B_.
+ * casetab.c (Fcurrent_case_table, set_case_table): Use B_.
+ * cmds.c (Fself_insert_command, internal_self_insert): Use B_.
+ * fileio.c (Fexpand_file_name, Ffile_directory_p)
+ (Ffile_regular_p, Ffile_selinux_context)
+ (Fset_file_selinux_context, Ffile_modes, Fset_file_modes)
+ (Fset_file_times, Ffile_newer_than_file_p, decide_coding_unwind)
+ (Finsert_file_contents, choose_write_coding_system)
+ (Fwrite_region, build_annotations, Fverify_visited_file_modtime)
+ (Fset_visited_file_modtime, auto_save_error, auto_save_1)
+ (Fdo_auto_save, Fset_buffer_auto_saved): Use B_.
+ * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_.
+ * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted)
+ (set_marker_both, set_marker_restricted_both, unchain_marker): Use
+ B_.
+ * insdel.c (check_markers, insert_char, insert_1_both)
+ (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
+ (adjust_after_replace, replace_range, del_range_2)
+ (modify_region, prepare_to_modify_buffer)
+ (Fcombine_after_change_execute): Use B_.
+ * filelock.c (unlock_all_files, Flock_buffer, Funlock_buffer)
+ (unlock_buffer): Use B_.
+ * keymap.c (Flocal_key_binding, Fuse_local_map)
+ (Fcurrent_local_map, push_key_description)
+ (Fdescribe_buffer_bindings): Use B_.
+ * keyboard.c (command_loop_1, read_char_minibuf_menu_prompt)
+ (read_key_sequence): Use B_.
+ * fringe.c (get_logical_cursor_bitmap)
+ (get_logical_fringe_bitmap, update_window_fringes): Use B_.
+ * xfns.c (x_create_tip_frame, Fx_show_tip): Use B_.
+ * xfaces.c (compute_char_face): Use B_.
+ * character.c (chars_in_text, Fget_byte): Use B_.
+ * category.c (check_category_table, Fcategory_table)
+ (Fset_category_table, char_category_set): Use B_.
+ * coding.c (decode_coding, encode_coding)
+ (make_conversion_work_buffer, decode_coding_gap)
+ (decode_coding_object, encode_coding_object)
+ (Fdetect_coding_region, Ffind_coding_systems_region_internal)
+ (Funencodable_char_position, Fcheck_coding_systems_region): Use
+ B_.
+ * charset.c (Ffind_charset_region): Use B_.
+ * window.c (window_display_table, unshow_buffer, window_loop)
+ (window_min_size_2, set_window_buffer, Fset_window_buffer)
+ (select_window, Fforce_window_update, temp_output_buffer_show)
+ (Fset_window_configuration, save_window_save): Use B_.
+ * xdisp.c (pos_visible_p, init_iterator, reseat_1)
+ (message_dolog, update_echo_area, ensure_echo_area_buffers)
+ (with_echo_area_buffer, setup_echo_area_for_printing)
+ (set_message_1, update_menu_bar, update_tool_bar)
+ (text_outside_line_unchanged_p, redisplay_internal)
+ (try_scrolling, try_cursor_movement, redisplay_window)
+ (try_window_reusing_current_matrix, row_containing_pos)
+ (try_window_id, get_overlay_arrow_glyph_row, display_line)
+ (Fcurrent_bidi_paragraph_direction, display_mode_lines)
+ (decode_mode_spec_coding, decode_mode_spec, display_count_lines)
+ (get_window_cursor_type, note_mouse_highlight): Use B_.
+ * frame.c (make_frame_visible_1): Use B_.
+ * dispnew.c (Fframe_or_buffer_changed_p): Use B_.
+ * dispextern.h (WINDOW_WANTS_HEADER_LINE_P)
+ (WINDOW_WANTS_MODELINE_P): Use B_.
+ * syntax.h (Vstandard_syntax_table): Update.
+ (CURRENT_SYNTAX_TABLE, SETUP_BUFFER_SYNTAX_TABLE): Use B_.
+ * intervals.h (TEXT_PROP_MEANS_INVISIBLE): Update.
+ (TEXT_PROP_MEANS_INVISIBLE): Use B_.
+ * character.h (FETCH_CHAR_ADVANCE): Update.
+ (INC_BOTH, ASCII_CHAR_WIDTH, DEC_BOTH): Use B_.
+ * category.h (Vstandard_category_table): Update.
+ * lisp.h (DEFVAR_BUFFER_DEFAULTS): Update for change to field
+ names.
+ (DOWNCASE_TABLE, UPCASE_TABLE): Use B_.
+ * buffer.c (swapfield_): New macro.
+ (Fbuffer_swap_text): Use swapfield_ where appropriate.
+ (Fbuffer_live_p, Fget_file_buffer, get_truename_buffer)
+ (Fget_buffer_create, clone_per_buffer_values)
+ (Fmake_indirect_buffer, reset_buffer)
+ (reset_buffer_local_variables, Fbuffer_name, Fbuffer_file_name)
+ (Fbuffer_local_value, buffer_lisp_local_variables)
+ (Fset_buffer_modified_p, Frestore_buffer_modified_p)
+ (Frename_buffer, Fother_buffer, Fbuffer_enable_undo)
+ (Fkill_buffer, Fset_buffer_major_mode, set_buffer_internal_1)
+ (set_buffer_temp, Fset_buffer, set_buffer_if_live)
+ (Fbarf_if_buffer_read_only, Fbury_buffer, Ferase_buffer)
+ (Fbuffer_swap_text, Fset_buffer_multibyte)
+ (swap_out_buffer_local_variables, record_overlay_string)
+ (overlay_strings, init_buffer_once, init_buffer, syms_of_buffer):
+ Use B_.
+ * buffer.h (struct buffer): Rename all Lisp_Object fields.
+ (BUFFER_INTERNAL_FIELD, B_): New macro.
+ (FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE): Use B_.
+
2011-02-14 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (xg_tool_bar_menu_proxy): Handle case when tool bar label
diff --git a/src/alloc.c b/src/alloc.c
index f75903aab5a..566c6fe00b9 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3886,7 +3886,7 @@ live_buffer_p (struct mem_node *m, void *p)
must not have been killed. */
return (m->type == MEM_TYPE_BUFFER
&& p == m->start
- && !NILP (((struct buffer *) p)->name));
+ && !NILP (((struct buffer *) p)->BUFFER_INTERNAL_FIELD (name)));
}
#endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */
@@ -4872,11 +4872,11 @@ returns nil, because real GC can't be done. */)
turned off in that buffer. Calling truncate_undo_list on
Qt tends to return NULL, which effectively turns undo back on.
So don't call truncate_undo_list if undo_list is Qt. */
- if (! NILP (nextb->name) && ! EQ (nextb->undo_list, Qt))
+ if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt))
truncate_undo_list (nextb);
/* Shrink buffer gaps, but skip indirect and dead buffers. */
- if (nextb->base_buffer == 0 && !NILP (nextb->name)
+ if (nextb->base_buffer == 0 && !NILP (nextb->BUFFER_INTERNAL_FIELD (name))
&& ! nextb->text->inhibit_shrinking)
{
/* If a buffer's gap size is more than 10% of the buffer
@@ -5009,10 +5009,10 @@ returns nil, because real GC can't be done. */)
turned off in that buffer. Calling truncate_undo_list on
Qt tends to return NULL, which effectively turns undo back on.
So don't call truncate_undo_list if undo_list is Qt. */
- if (! EQ (nextb->undo_list, Qt))
+ if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt))
{
Lisp_Object tail, prev;
- tail = nextb->undo_list;
+ tail = nextb->BUFFER_INTERNAL_FIELD (undo_list);
prev = Qnil;
while (CONSP (tail))
{
@@ -5021,7 +5021,7 @@ returns nil, because real GC can't be done. */)
&& !XMARKER (XCAR (XCAR (tail)))->gcmarkbit)
{
if (NILP (prev))
- nextb->undo_list = tail = XCDR (tail);
+ nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail);
else
{
tail = XCDR (tail);
@@ -5037,7 +5037,7 @@ returns nil, because real GC can't be done. */)
}
/* Now that we have stripped the elements that need not be in the
undo_list any more, we can finally mark the list. */
- mark_object (nextb->undo_list);
+ mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list));
nextb = nextb->next;
}
@@ -5595,7 +5595,7 @@ mark_buffer (Lisp_Object buf)
/* buffer-local Lisp variables start at `undo_list',
tho only the ones from `name' on are GC'd normally. */
- for (ptr = &buffer->name;
+ for (ptr = &buffer->BUFFER_INTERNAL_FIELD (name);
(char *)ptr < (char *)buffer + sizeof (struct buffer);
ptr++)
mark_object (*ptr);
diff --git a/src/buffer.c b/src/buffer.c
index 05cc12eea6f..fc2dd3a4691 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,
Value is nil if OBJECT is not a buffer or if it has been killed. */)
(Lisp_Object object)
{
- return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name))
+ return ((BUFFERP (object) && ! NILP (B_ (XBUFFER (object), name)))
? Qt : Qnil);
}
@@ -266,8 +266,8 @@ See also `find-buffer-visiting'. */)
{
buf = Fcdr (XCAR (tail));
if (!BUFFERP (buf)) continue;
- if (!STRINGP (XBUFFER (buf)->filename)) continue;
- tem = Fstring_equal (XBUFFER (buf)->filename, filename);
+ if (!STRINGP (B_ (XBUFFER (buf), filename))) continue;
+ tem = Fstring_equal (B_ (XBUFFER (buf), filename), filename);
if (!NILP (tem))
return buf;
}
@@ -283,8 +283,8 @@ get_truename_buffer (register Lisp_Object filename)
{
buf = Fcdr (XCAR (tail));
if (!BUFFERP (buf)) continue;
- if (!STRINGP (XBUFFER (buf)->file_truename)) continue;
- tem = Fstring_equal (XBUFFER (buf)->file_truename, filename);
+ if (!STRINGP (B_ (XBUFFER (buf), file_truename))) continue;
+ tem = Fstring_equal (B_ (XBUFFER (buf), file_truename), filename);
if (!NILP (tem))
return buf;
}
@@ -353,7 +353,7 @@ even if it is dead. The return value is never nil. */)
b->newline_cache = 0;
b->width_run_cache = 0;
- b->width_table = Qnil;
+ B_ (b, width_table) = Qnil;
b->prevent_redisplay_optimizations_p = 1;
/* 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. */)
/* An ordinary buffer normally doesn't need markers
to handle BEGV and ZV. */
- b->pt_marker = Qnil;
- b->begv_marker = Qnil;
- b->zv_marker = Qnil;
+ B_ (b, pt_marker) = Qnil;
+ B_ (b, begv_marker) = Qnil;
+ B_ (b, zv_marker) = Qnil;
name = Fcopy_sequence (buffer_or_name);
STRING_SET_INTERVALS (name, NULL_INTERVAL);
- b->name = name;
+ B_ (b, name) = name;
- b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt;
+ B_ (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt;
reset_buffer (b);
reset_buffer_local_variables (b, 1);
- b->mark = Fmake_marker ();
+ B_ (b, mark) = Fmake_marker ();
BUF_MARKERS (b) = NULL;
- b->name = name;
+ B_ (b, name) = name;
/* Put this in the alist of all live buffers. */
XSETBUFFER (buffer, b);
@@ -486,7 +486,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
/* Get (a copy of) the alist of Lisp-level local variables of FROM
and install that in TO. */
- to->local_var_alist = buffer_lisp_local_variables (from);
+ B_ (to, local_var_alist) = buffer_lisp_local_variables (from);
}
DEFUN ("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. */)
base_buffer = Fget_buffer (base_buffer);
if (NILP (base_buffer))
error ("No such buffer: `%s'", SDATA (tem));
- if (NILP (XBUFFER (base_buffer)->name))
+ if (NILP (B_ (XBUFFER (base_buffer), name)))
error ("Base buffer has been killed");
if (SCHARS (name) == 0)
@@ -536,7 +536,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
b->newline_cache = 0;
b->width_run_cache = 0;
- b->width_table = Qnil;
+ B_ (b, width_table) = Qnil;
/* Put this on the chain of all buffers including killed ones. */
b->next = all_buffers;
@@ -544,7 +544,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
name = Fcopy_sequence (name);
STRING_SET_INTERVALS (name, NULL_INTERVAL);
- b->name = name;
+ B_ (b, name) = name;
reset_buffer (b);
reset_buffer_local_variables (b, 1);
@@ -553,57 +553,57 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
XSETBUFFER (buf, b);
Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
- b->mark = Fmake_marker ();
- b->name = name;
+ B_ (b, mark) = Fmake_marker ();
+ B_ (b, name) = name;
/* The multibyte status belongs to the base buffer. */
- b->enable_multibyte_characters = b->base_buffer->enable_multibyte_characters;
+ B_ (b, enable_multibyte_characters) = B_ (b->base_buffer, enable_multibyte_characters);
/* Make sure the base buffer has markers for its narrowing. */
- if (NILP (b->base_buffer->pt_marker))
+ if (NILP (B_ (b->base_buffer, pt_marker)))
{
- b->base_buffer->pt_marker = Fmake_marker ();
- set_marker_both (b->base_buffer->pt_marker, base_buffer,
+ B_ (b->base_buffer, pt_marker) = Fmake_marker ();
+ set_marker_both (B_ (b->base_buffer, pt_marker), base_buffer,
BUF_PT (b->base_buffer),
BUF_PT_BYTE (b->base_buffer));
}
- if (NILP (b->base_buffer->begv_marker))
+ if (NILP (B_ (b->base_buffer, begv_marker)))
{
- b->base_buffer->begv_marker = Fmake_marker ();
- set_marker_both (b->base_buffer->begv_marker, base_buffer,
+ B_ (b->base_buffer, begv_marker) = Fmake_marker ();
+ set_marker_both (B_ (b->base_buffer, begv_marker), base_buffer,
BUF_BEGV (b->base_buffer),
BUF_BEGV_BYTE (b->base_buffer));
}
- if (NILP (b->base_buffer->zv_marker))
+ if (NILP (B_ (b->base_buffer, zv_marker)))
{
- b->base_buffer->zv_marker = Fmake_marker ();
- set_marker_both (b->base_buffer->zv_marker, base_buffer,
+ B_ (b->base_buffer, zv_marker) = Fmake_marker ();
+ set_marker_both (B_ (b->base_buffer, zv_marker), base_buffer,
BUF_ZV (b->base_buffer),
BUF_ZV_BYTE (b->base_buffer));
- XMARKER (b->base_buffer->zv_marker)->insertion_type = 1;
+ XMARKER (B_ (b->base_buffer, zv_marker))->insertion_type = 1;
}
if (NILP (clone))
{
/* Give the indirect buffer markers for its narrowing. */
- b->pt_marker = Fmake_marker ();
- set_marker_both (b->pt_marker, buf, BUF_PT (b), BUF_PT_BYTE (b));
- b->begv_marker = Fmake_marker ();
- set_marker_both (b->begv_marker, buf, BUF_BEGV (b), BUF_BEGV_BYTE (b));
- b->zv_marker = Fmake_marker ();
- set_marker_both (b->zv_marker, buf, BUF_ZV (b), BUF_ZV_BYTE (b));
- XMARKER (b->zv_marker)->insertion_type = 1;
+ B_ (b, pt_marker) = Fmake_marker ();
+ set_marker_both (B_ (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b));
+ B_ (b, begv_marker) = Fmake_marker ();
+ set_marker_both (B_ (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b));
+ B_ (b, zv_marker) = Fmake_marker ();
+ set_marker_both (B_ (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b));
+ XMARKER (B_ (b, zv_marker))->insertion_type = 1;
}
else
{
struct buffer *old_b = current_buffer;
clone_per_buffer_values (b->base_buffer, b);
- b->filename = Qnil;
- b->file_truename = Qnil;
- b->display_count = make_number (0);
- b->backed_up = Qnil;
- b->auto_save_file_name = Qnil;
+ B_ (b, filename) = Qnil;
+ B_ (b, file_truename) = Qnil;
+ B_ (b, display_count) = make_number (0);
+ B_ (b, backed_up) = Qnil;
+ B_ (b, auto_save_file_name) = Qnil;
set_buffer_internal_1 (b);
Fset (intern ("buffer-save-without-query"), Qnil);
Fset (intern ("buffer-file-number"), Qnil);
@@ -647,34 +647,34 @@ delete_all_overlays (struct buffer *b)
void
reset_buffer (register struct buffer *b)
{
- b->filename = Qnil;
- b->file_truename = Qnil;
- b->directory = (current_buffer) ? current_buffer->directory : Qnil;
+ B_ (b, filename) = Qnil;
+ B_ (b, file_truename) = Qnil;
+ B_ (b, directory) = (current_buffer) ? B_ (current_buffer, directory) : Qnil;
b->modtime = 0;
b->modtime_size = -1;
- XSETFASTINT (b->save_length, 0);
+ XSETFASTINT (B_ (b, save_length), 0);
b->last_window_start = 1;
/* It is more conservative to start out "changed" than "unchanged". */
b->clip_changed = 0;
b->prevent_redisplay_optimizations_p = 1;
- b->backed_up = Qnil;
+ B_ (b, backed_up) = Qnil;
BUF_AUTOSAVE_MODIFF (b) = 0;
b->auto_save_failure_time = -1;
- b->auto_save_file_name = Qnil;
- b->read_only = Qnil;
+ B_ (b, auto_save_file_name) = Qnil;
+ B_ (b, read_only) = Qnil;
b->overlays_before = NULL;
b->overlays_after = NULL;
b->overlay_center = BEG;
- b->mark_active = Qnil;
- b->point_before_scroll = Qnil;
- b->file_format = Qnil;
- b->auto_save_file_format = Qt;
- b->last_selected_window = Qnil;
- XSETINT (b->display_count, 0);
- b->display_time = Qnil;
- b->enable_multibyte_characters = buffer_defaults.enable_multibyte_characters;
- b->cursor_type = buffer_defaults.cursor_type;
- b->extra_line_spacing = buffer_defaults.extra_line_spacing;
+ B_ (b, mark_active) = Qnil;
+ B_ (b, point_before_scroll) = Qnil;
+ B_ (b, file_format) = Qnil;
+ B_ (b, auto_save_file_format) = Qt;
+ B_ (b, last_selected_window) = Qnil;
+ XSETINT (B_ (b, display_count), 0);
+ B_ (b, display_time) = Qnil;
+ B_ (b, enable_multibyte_characters) = B_ (&buffer_defaults, enable_multibyte_characters);
+ B_ (b, cursor_type) = B_ (&buffer_defaults, cursor_type);
+ B_ (b, extra_line_spacing) = B_ (&buffer_defaults, extra_line_spacing);
b->display_error_modiff = 0;
}
@@ -698,10 +698,10 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
things that depend on the major mode.
default-major-mode is handled at a higher level.
We ignore it here. */
- b->major_mode = Qfundamental_mode;
- b->keymap = Qnil;
- b->mode_name = QSFundamental;
- b->minor_modes = Qnil;
+ B_ (b, major_mode) = Qfundamental_mode;
+ B_ (b, keymap) = Qnil;
+ B_ (b, mode_name) = QSFundamental;
+ B_ (b, minor_modes) = Qnil;
/* If the standard case table has been altered and invalidated,
fix up its insides first. */
@@ -710,22 +710,22 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
&& CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2])))
Fset_standard_case_table (Vascii_downcase_table);
- b->downcase_table = Vascii_downcase_table;
- b->upcase_table = XCHAR_TABLE (Vascii_downcase_table)->extras[0];
- b->case_canon_table = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
- b->case_eqv_table = XCHAR_TABLE (Vascii_downcase_table)->extras[2];
- b->invisibility_spec = Qt;
+ B_ (b, downcase_table) = Vascii_downcase_table;
+ B_ (b, upcase_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[0];
+ B_ (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
+ B_ (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2];
+ B_ (b, invisibility_spec) = Qt;
#ifndef DOS_NT
- b->buffer_file_type = Qnil;
+ B_ (b, buffer_file_type) = Qnil;
#endif
/* Reset all (or most) per-buffer variables to their defaults. */
if (permanent_too)
- b->local_var_alist = Qnil;
+ B_ (b, local_var_alist) = Qnil;
else
{
Lisp_Object tmp, prop, last = Qnil;
- for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp))
+ for (tmp = B_ (b, local_var_alist); CONSP (tmp); tmp = XCDR (tmp))
if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local)))
{
/* If permanent-local, keep it. */
@@ -755,7 +755,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
}
/* Delete this local variable. */
else if (NILP (last))
- b->local_var_alist = XCDR (tmp);
+ B_ (b, local_var_alist) = XCDR (tmp);
else
XSETCDR (last, XCDR (tmp));
}
@@ -830,9 +830,9 @@ Return nil if BUFFER has been killed. */)
(register Lisp_Object buffer)
{
if (NILP (buffer))
- return current_buffer->name;
+ return B_ (current_buffer, name);
CHECK_BUFFER (buffer);
- return XBUFFER (buffer)->name;
+ return B_ (XBUFFER (buffer), name);
}
DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0,
@@ -841,9 +841,9 @@ No argument or nil as argument means use the current buffer. */)
(register Lisp_Object buffer)
{
if (NILP (buffer))
- return current_buffer->filename;
+ return B_ (current_buffer, filename);
CHECK_BUFFER (buffer);
- return XBUFFER (buffer)->filename;
+ return B_ (XBUFFER (buffer), filename);
}
DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer,
@@ -895,7 +895,7 @@ is the default binding of the variable. */)
{ /* Look in local_var_alist. */
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
XSETSYMBOL (variable, sym); /* Update In case of aliasing. */
- result = Fassoc (variable, buf->local_var_alist);
+ result = Fassoc (variable, B_ (buf, local_var_alist));
if (!NILP (result))
{
if (blv->fwd)
@@ -944,7 +944,7 @@ buffer_lisp_local_variables (struct buffer *buf)
{
Lisp_Object result = Qnil;
register Lisp_Object tail;
- for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
{
Lisp_Object val, elt;
@@ -1043,9 +1043,9 @@ A non-nil FLAG means mark the buffer modified. */)
/* If buffer becoming modified, lock the file.
If buffer becoming unmodified, unlock the file. */
- fn = current_buffer->file_truename;
+ fn = B_ (current_buffer, file_truename);
/* Test buffer-file-name so that binding it to nil is effective. */
- if (!NILP (fn) && ! NILP (current_buffer->filename))
+ if (!NILP (fn) && ! NILP (B_ (current_buffer, filename)))
{
already = SAVE_MODIFF < MODIFF;
if (!already && !NILP (flag))
@@ -1110,9 +1110,9 @@ state of the current buffer. Use with care. */)
/* If buffer becoming modified, lock the file.
If buffer becoming unmodified, unlock the file. */
- fn = current_buffer->file_truename;
+ fn = B_ (current_buffer, file_truename);
/* Test buffer-file-name so that binding it to nil is effective. */
- if (!NILP (fn) && ! NILP (current_buffer->filename))
+ if (!NILP (fn) && ! NILP (B_ (current_buffer, filename)))
{
int already = SAVE_MODIFF < MODIFF;
if (!already && !NILP (flag))
@@ -1199,14 +1199,14 @@ This does not change the name of the visited file (if any). */)
with the original name. It makes UNIQUE equivalent to
(rename-buffer (generate-new-buffer-name NEWNAME)). */
if (NILP (unique) && XBUFFER (tem) == current_buffer)
- return current_buffer->name;
+ return B_ (current_buffer, name);
if (!NILP (unique))
- newname = Fgenerate_new_buffer_name (newname, current_buffer->name);
+ newname = Fgenerate_new_buffer_name (newname, B_ (current_buffer, name));
else
error ("Buffer name `%s' is in use", SDATA (newname));
}
- current_buffer->name = newname;
+ B_ (current_buffer, name) = newname;
/* Catch redisplay's attention. Unless we do this, the mode lines for
any windows displaying current_buffer will stay unchanged. */
@@ -1214,11 +1214,11 @@ This does not change the name of the visited file (if any). */)
XSETBUFFER (buf, current_buffer);
Fsetcar (Frassq (buf, Vbuffer_alist), newname);
- if (NILP (current_buffer->filename)
- && !NILP (current_buffer->auto_save_file_name))
+ if (NILP (B_ (current_buffer, filename))
+ && !NILP (B_ (current_buffer, auto_save_file_name)))
call0 (intern ("rename-auto-save-file"));
/* Refetch since that last call may have done GC. */
- return current_buffer->name;
+ return B_ (current_buffer, name);
}
DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0,
@@ -1263,9 +1263,9 @@ If BUFFER is omitted or nil, some interesting buffer is returned. */)
continue;
if (NILP (buf))
continue;
- if (NILP (XBUFFER (buf)->name))
+ if (NILP (B_ (XBUFFER (buf), name)))
continue;
- if (SREF (XBUFFER (buf)->name, 0) == ' ')
+ if (SREF (B_ (XBUFFER (buf), name), 0) == ' ')
continue;
/* If the selected frame has a buffer_predicate,
disregard buffers that don't fit the predicate. */
@@ -1313,8 +1313,8 @@ No argument or nil as argument means do this for the current buffer. */)
nsberror (buffer);
}
- if (EQ (XBUFFER (real_buffer)->undo_list, Qt))
- XBUFFER (real_buffer)->undo_list = Qnil;
+ if (EQ (B_ (XBUFFER (real_buffer), undo_list), Qt))
+ B_ (XBUFFER (real_buffer), undo_list) = Qnil;
return Qnil;
}
@@ -1359,16 +1359,16 @@ with SIGHUP. */)
b = XBUFFER (buffer);
/* Avoid trouble for buffer already dead. */
- if (NILP (b->name))
+ if (NILP (B_ (b, name)))
return Qnil;
/* Query if the buffer is still modified. */
- if (INTERACTIVE && !NILP (b->filename)
+ if (INTERACTIVE && !NILP (B_ (b, filename))
&& BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
{
GCPRO1 (buffer);
tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
- b->name, make_number (0)));
+ B_ (b, name), make_number (0)));
UNGCPRO;
if (NILP (tem))
return Qnil;
@@ -1402,7 +1402,7 @@ with SIGHUP. */)
if (EQ (buffer, XWINDOW (minibuf_window)->buffer))
return Qnil;
- if (NILP (b->name))
+ if (NILP (B_ (b, name)))
return Qnil;
/* When we kill a base buffer, kill all its indirect buffers.
@@ -1417,7 +1417,7 @@ with SIGHUP. */)
for (other = all_buffers; other; other = other->next)
/* all_buffers contains dead buffers too;
don't re-kill them. */
- if (other->base_buffer == b && !NILP (other->name))
+ if (other->base_buffer == b && !NILP (B_ (other, name)))
{
Lisp_Object buffer;
XSETBUFFER (buffer, other);
@@ -1462,7 +1462,7 @@ with SIGHUP. */)
/* Killing buffer processes may run sentinels which may
have called kill-buffer. */
- if (NILP (b->name))
+ if (NILP (B_ (b, name)))
return Qnil;
clear_charpos_cache (b);
@@ -1476,7 +1476,7 @@ with SIGHUP. */)
/* Delete any auto-save file, if we saved it in this session.
But not if the buffer is modified. */
- if (STRINGP (b->auto_save_file_name)
+ if (STRINGP (B_ (b, auto_save_file_name))
&& BUF_AUTOSAVE_MODIFF (b) != 0
&& BUF_SAVE_MODIFF (b) < BUF_AUTOSAVE_MODIFF (b)
&& BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
@@ -1485,7 +1485,7 @@ with SIGHUP. */)
Lisp_Object tem;
tem = Fsymbol_value (intern ("delete-auto-save-files"));
if (! NILP (tem))
- internal_delete_file (b->auto_save_file_name);
+ internal_delete_file (B_ (b, auto_save_file_name));
}
if (b->base_buffer)
@@ -1525,7 +1525,7 @@ with SIGHUP. */)
swap_out_buffer_local_variables (b);
reset_buffer_local_variables (b, 1);
- b->name = Qnil;
+ B_ (b, name) = Qnil;
BLOCK_INPUT;
if (! b->base_buffer)
@@ -1541,9 +1541,9 @@ with SIGHUP. */)
free_region_cache (b->width_run_cache);
b->width_run_cache = 0;
}
- b->width_table = Qnil;
+ B_ (b, width_table) = Qnil;
UNBLOCK_INPUT;
- b->undo_list = Qnil;
+ B_ (b, undo_list) = Qnil;
return Qt;
}
@@ -1637,15 +1637,15 @@ the current buffer's major mode. */)
CHECK_BUFFER (buffer);
- if (STRINGP (XBUFFER (buffer)->name)
- && strcmp (SSDATA (XBUFFER (buffer)->name), "*scratch*") == 0)
+ if (STRINGP (B_ (XBUFFER (buffer), name))
+ && strcmp (SSDATA (B_ (XBUFFER (buffer), name)), "*scratch*") == 0)
function = find_symbol_value (intern ("initial-major-mode"));
else
{
- function = buffer_defaults.major_mode;
+ function = B_ (&buffer_defaults, major_mode);
if (NILP (function)
- && NILP (Fget (current_buffer->major_mode, Qmode_class)))
- function = current_buffer->major_mode;
+ && NILP (Fget (B_ (current_buffer, major_mode), Qmode_class)))
+ function = B_ (current_buffer, major_mode);
}
if (NILP (function) || EQ (function, Qfundamental_mode))
@@ -1795,29 +1795,29 @@ set_buffer_internal_1 (register struct buffer *b)
/* Put the undo list back in the base buffer, so that it appears
that an indirect buffer shares the undo list of its base. */
if (old_buf->base_buffer)
- old_buf->base_buffer->undo_list = old_buf->undo_list;
+ B_ (old_buf->base_buffer, undo_list) = B_ (old_buf, undo_list);
/* If the old current buffer has markers to record PT, BEGV and ZV
when it is not current, update them now. */
- if (! NILP (old_buf->pt_marker))
+ if (! NILP (B_ (old_buf, pt_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->pt_marker, obuf,
+ set_marker_both (B_ (old_buf, pt_marker), obuf,
BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
}
- if (! NILP (old_buf->begv_marker))
+ if (! NILP (B_ (old_buf, begv_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->begv_marker, obuf,
+ set_marker_both (B_ (old_buf, begv_marker), obuf,
BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
}
- if (! NILP (old_buf->zv_marker))
+ if (! NILP (B_ (old_buf, zv_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->zv_marker, obuf,
+ set_marker_both (B_ (old_buf, zv_marker), obuf,
BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
}
}
@@ -1825,24 +1825,24 @@ set_buffer_internal_1 (register struct buffer *b)
/* Get the undo list from the base buffer, so that it appears
that an indirect buffer shares the undo list of its base. */
if (b->base_buffer)
- b->undo_list = b->base_buffer->undo_list;
+ B_ (b, undo_list) = B_ (b->base_buffer, undo_list);
/* If the new current buffer has markers to record PT, BEGV and ZV
when it is not current, fetch them now. */
- if (! NILP (b->pt_marker))
+ if (! NILP (B_ (b, pt_marker)))
{
- BUF_PT (b) = marker_position (b->pt_marker);
- BUF_PT_BYTE (b) = marker_byte_position (b->pt_marker);
+ BUF_PT (b) = marker_position (B_ (b, pt_marker));
+ BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker));
}
- if (! NILP (b->begv_marker))
+ if (! NILP (B_ (b, begv_marker)))
{
- BUF_BEGV (b) = marker_position (b->begv_marker);
- BUF_BEGV_BYTE (b) = marker_byte_position (b->begv_marker);
+ BUF_BEGV (b) = marker_position (B_ (b, begv_marker));
+ BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker));
}
- if (! NILP (b->zv_marker))
+ if (! NILP (B_ (b, zv_marker)))
{
- BUF_ZV (b) = marker_position (b->zv_marker);
- BUF_ZV_BYTE (b) = marker_byte_position (b->zv_marker);
+ BUF_ZV (b) = marker_position (B_ (b, zv_marker));
+ BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker));
}
/* Look down buffer's list of local Lisp variables
@@ -1850,7 +1850,7 @@ set_buffer_internal_1 (register struct buffer *b)
do
{
- for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ for (tail = B_ (b, local_var_alist); CONSP (tail); tail = XCDR (tail))
{
Lisp_Object var = XCAR (XCAR (tail));
struct Lisp_Symbol *sym = XSYMBOL (var);
@@ -1883,45 +1883,45 @@ set_buffer_temp (struct buffer *b)
{
/* If the old current buffer has markers to record PT, BEGV and ZV
when it is not current, update them now. */
- if (! NILP (old_buf->pt_marker))
+ if (! NILP (B_ (old_buf, pt_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->pt_marker, obuf,
+ set_marker_both (B_ (old_buf, pt_marker), obuf,
BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
}
- if (! NILP (old_buf->begv_marker))
+ if (! NILP (B_ (old_buf, begv_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->begv_marker, obuf,
+ set_marker_both (B_ (old_buf, begv_marker), obuf,
BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
}
- if (! NILP (old_buf->zv_marker))
+ if (! NILP (B_ (old_buf, zv_marker)))
{
Lisp_Object obuf;
XSETBUFFER (obuf, old_buf);
- set_marker_both (old_buf->zv_marker, obuf,
+ set_marker_both (B_ (old_buf, zv_marker), obuf,
BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
}
}
/* If the new current buffer has markers to record PT, BEGV and ZV
when it is not current, fetch them now. */
- if (! NILP (b->pt_marker))
+ if (! NILP (B_ (b, pt_marker)))
{
- BUF_PT (b) = marker_position (b->pt_marker);
- BUF_PT_BYTE (b) = marker_byte_position (b->pt_marker);
+ BUF_PT (b) = marker_position (B_ (b, pt_marker));
+ BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker));
}
- if (! NILP (b->begv_marker))
+ if (! NILP (B_ (b, begv_marker)))
{
- BUF_BEGV (b) = marker_position (b->begv_marker);
- BUF_BEGV_BYTE (b) = marker_byte_position (b->begv_marker);
+ BUF_BEGV (b) = marker_position (B_ (b, begv_marker));
+ BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker));
}
- if (! NILP (b->zv_marker))
+ if (! NILP (B_ (b, zv_marker)))
{
- BUF_ZV (b) = marker_position (b->zv_marker);
- BUF_ZV_BYTE (b) = marker_byte_position (b->zv_marker);
+ BUF_ZV (b) = marker_position (B_ (b, zv_marker));
+ BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker));
}
}
@@ -1938,7 +1938,7 @@ ends when the current command terminates. Use `switch-to-buffer' or
buffer = Fget_buffer (buffer_or_name);
if (NILP (buffer))
nsberror (buffer_or_name);
- if (NILP (XBUFFER (buffer)->name))
+ if (NILP (B_ (XBUFFER (buffer), name)))
error ("Selecting deleted buffer");
set_buffer_internal (XBUFFER (buffer));
return buffer;
@@ -1949,7 +1949,7 @@ ends when the current command terminates. Use `switch-to-buffer' or
Lisp_Object
set_buffer_if_live (Lisp_Object buffer)
{
- if (! NILP (XBUFFER (buffer)->name))
+ if (! NILP (B_ (XBUFFER (buffer), name)))
Fset_buffer (buffer);
return Qnil;
}
@@ -1959,7 +1959,7 @@ DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only,
doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */)
(void)
{
- if (!NILP (current_buffer->read_only)
+ if (!NILP (B_ (current_buffer, read_only))
&& NILP (Vinhibit_read_only))
xsignal1 (Qbuffer_read_only, Fcurrent_buffer ());
return Qnil;
@@ -2008,7 +2008,7 @@ its frame, iconify that frame. */)
/* Move buffer to the end of the buffer list. Do nothing if the
buffer is killed. */
- if (!NILP (XBUFFER (buffer)->name))
+ if (!NILP (B_ (XBUFFER (buffer), name)))
{
Lisp_Object aelt, link;
@@ -2041,7 +2041,7 @@ so the buffer is truly empty after this. */)
/* Prevent warnings, or suspension of auto saving, that would happen
if future size is less than past size. Use of erase-buffer
implies that the future text is not really related to the past text. */
- XSETFASTINT (current_buffer->save_length, 0);
+ XSETFASTINT (B_ (current_buffer, save_length), 0);
return Qnil;
}
@@ -2111,7 +2111,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
CHECK_BUFFER (buffer);
other_buffer = XBUFFER (buffer);
- if (NILP (other_buffer->name))
+ if (NILP (B_ (other_buffer, name)))
error ("Cannot swap a dead buffer's text");
/* Actually, it probably works just fine.
@@ -2138,6 +2138,12 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
other_buffer->field = current_buffer->field; \
current_buffer->field = tmp##field; \
} while (0)
+#define swapfield_(field, type) \
+ do { \
+ type tmp##field = B_ (other_buffer, field); \
+ B_ (other_buffer, field) = B_ (current_buffer, field); \
+ B_ (current_buffer, field) = tmp##field; \
+ } while (0)
swapfield (own_text, struct buffer_text);
eassert (current_buffer->text == &current_buffer->own_text);
@@ -2165,18 +2171,18 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
swapfield (overlays_before, struct Lisp_Overlay *);
swapfield (overlays_after, struct Lisp_Overlay *);
swapfield (overlay_center, EMACS_INT);
- swapfield (undo_list, Lisp_Object);
- swapfield (mark, Lisp_Object);
- swapfield (enable_multibyte_characters, Lisp_Object);
- swapfield (bidi_display_reordering, Lisp_Object);
- swapfield (bidi_paragraph_direction, Lisp_Object);
+ swapfield_ (undo_list, Lisp_Object);
+ swapfield_ (mark, Lisp_Object);
+ swapfield_ (enable_multibyte_characters, Lisp_Object);
+ swapfield_ (bidi_display_reordering, Lisp_Object);
+ swapfield_ (bidi_paragraph_direction, Lisp_Object);
/* FIXME: Not sure what we should do with these *_marker fields.
Hopefully they're just nil anyway. */
- swapfield (pt_marker, Lisp_Object);
- swapfield (begv_marker, Lisp_Object);
- swapfield (zv_marker, Lisp_Object);
- current_buffer->point_before_scroll = Qnil;
- other_buffer->point_before_scroll = Qnil;
+ swapfield_ (pt_marker, Lisp_Object);
+ swapfield_ (begv_marker, Lisp_Object);
+ swapfield_ (zv_marker, Lisp_Object);
+ B_ (current_buffer, point_before_scroll) = Qnil;
+ B_ (other_buffer, point_before_scroll) = Qnil;
current_buffer->text->modiff++; other_buffer->text->modiff++;
current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++;
@@ -2250,21 +2256,21 @@ current buffer is cleared. */)
EMACS_INT begv, zv;
int narrowed = (BEG != BEGV || Z != ZV);
int modified_p = !NILP (Fbuffer_modified_p (Qnil));
- Lisp_Object old_undo = current_buffer->undo_list;
+ Lisp_Object old_undo = B_ (current_buffer, undo_list);
struct gcpro gcpro1;
if (current_buffer->base_buffer)
error ("Cannot do `set-buffer-multibyte' on an indirect buffer");
/* Do nothing if nothing actually changes. */
- if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (flag) == NILP (B_ (current_buffer, enable_multibyte_characters)))
return flag;
GCPRO1 (old_undo);
/* Don't record these buffer changes. We will put a special undo entry
instead. */
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, undo_list) = Qt;
/* If the cached position is for this buffer, clear it out. */
clear_charpos_cache (current_buffer);
@@ -2286,7 +2292,7 @@ current buffer is cleared. */)
to calculate the old correspondences. */
set_intervals_multibyte (0);
- current_buffer->enable_multibyte_characters = Qnil;
+ B_ (current_buffer, enable_multibyte_characters) = Qnil;
Z = Z_BYTE;
BEGV = BEGV_BYTE;
@@ -2424,7 +2430,7 @@ current buffer is cleared. */)
/* Do this first, so that chars_in_text asks the right question.
set_intervals_multibyte needs it too. */
- current_buffer->enable_multibyte_characters = Qt;
+ B_ (current_buffer, enable_multibyte_characters) = Qt;
GPT_BYTE = advance_to_char_boundary (GPT_BYTE);
GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG;
@@ -2482,7 +2488,7 @@ current buffer is cleared. */)
if (!EQ (old_undo, Qt))
{
/* Represent all the above changes by a special undo entry. */
- current_buffer->undo_list = Fcons (list3 (Qapply,
+ B_ (current_buffer, undo_list) = Fcons (list3 (Qapply,
intern ("set-buffer-multibyte"),
NILP (flag) ? Qt : Qnil),
old_undo);
@@ -2498,10 +2504,10 @@ current buffer is cleared. */)
/* Copy this buffer's new multibyte status
into all of its indirect buffers. */
for (other = all_buffers; other; other = other->next)
- if (other->base_buffer == current_buffer && !NILP (other->name))
+ if (other->base_buffer == current_buffer && !NILP (B_ (other, name)))
{
- other->enable_multibyte_characters
- = current_buffer->enable_multibyte_characters;
+ B_ (other, enable_multibyte_characters)
+ = B_ (current_buffer, enable_multibyte_characters);
other->prevent_redisplay_optimizations_p = 1;
}
@@ -2568,7 +2574,7 @@ swap_out_buffer_local_variables (struct buffer *b)
Lisp_Object oalist, alist, buffer;
XSETBUFFER (buffer, b);
- oalist = b->local_var_alist;
+ oalist = B_ (b, local_var_alist);
for (alist = oalist; CONSP (alist); alist = XCDR (alist))
{
@@ -3072,7 +3078,7 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str
ssl->buf[ssl->used].priority = (INTEGERP (pri) ? XINT (pri) : 0);
ssl->used++;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
nbytes = SCHARS (str);
else if (! STRING_MULTIBYTE (str))
nbytes = count_size_as_multibyte (SDATA (str),
@@ -3084,7 +3090,7 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str
if (STRINGP (str2))
{
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
nbytes = SCHARS (str2);
else if (! STRING_MULTIBYTE (str2))
nbytes = count_size_as_multibyte (SDATA (str2),
@@ -3114,7 +3120,7 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
Lisp_Object overlay, window, str;
struct Lisp_Overlay *ov;
EMACS_INT startpos, endpos;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
overlay_heads.used = overlay_heads.bytes = 0;
overlay_tails.used = overlay_tails.bytes = 0;
@@ -4985,9 +4991,9 @@ init_buffer_once (void)
/* Make sure all markable slots in buffer_defaults
are initialized reasonably, so mark_buffer won't choke. */
reset_buffer (&buffer_defaults);
- eassert (EQ (buffer_defaults.name, make_number (0)));
+ eassert (EQ (B_ (&buffer_defaults, name), make_number (0)));
reset_buffer_local_variables (&buffer_defaults, 1);
- eassert (EQ (buffer_local_symbols.name, make_number (0)));
+ eassert (EQ (B_ (&buffer_local_symbols, name), make_number (0)));
reset_buffer (&buffer_local_symbols);
reset_buffer_local_variables (&buffer_local_symbols, 1);
/* Prevent GC from getting confused. */
@@ -5004,60 +5010,60 @@ init_buffer_once (void)
/* Must do these before making the first buffer! */
/* real setup is done in bindings.el */
- buffer_defaults.mode_line_format = make_pure_c_string ("%-");
- buffer_defaults.header_line_format = Qnil;
- buffer_defaults.abbrev_mode = Qnil;
- buffer_defaults.overwrite_mode = Qnil;
- buffer_defaults.case_fold_search = Qt;
- buffer_defaults.auto_fill_function = Qnil;
- buffer_defaults.selective_display = Qnil;
+ B_ (&buffer_defaults, mode_line_format) = make_pure_c_string ("%-");
+ B_ (&buffer_defaults, header_line_format) = Qnil;
+ B_ (&buffer_defaults, abbrev_mode) = Qnil;
+ B_ (&buffer_defaults, overwrite_mode) = Qnil;
+ B_ (&buffer_defaults, case_fold_search) = Qt;
+ B_ (&buffer_defaults, auto_fill_function) = Qnil;
+ B_ (&buffer_defaults, selective_display) = Qnil;
#ifndef old
- buffer_defaults.selective_display_ellipses = Qt;
+ B_ (&buffer_defaults, selective_display_ellipses) = Qt;
#endif
- buffer_defaults.abbrev_table = Qnil;
- buffer_defaults.display_table = Qnil;
- buffer_defaults.undo_list = Qnil;
- buffer_defaults.mark_active = Qnil;
- buffer_defaults.file_format = Qnil;
- buffer_defaults.auto_save_file_format = Qt;
+ B_ (&buffer_defaults, abbrev_table) = Qnil;
+ B_ (&buffer_defaults, display_table) = Qnil;
+ B_ (&buffer_defaults, undo_list) = Qnil;
+ B_ (&buffer_defaults, mark_active) = Qnil;
+ B_ (&buffer_defaults, file_format) = Qnil;
+ B_ (&buffer_defaults, auto_save_file_format) = Qt;
buffer_defaults.overlays_before = NULL;
buffer_defaults.overlays_after = NULL;
buffer_defaults.overlay_center = BEG;
- XSETFASTINT (buffer_defaults.tab_width, 8);
- buffer_defaults.truncate_lines = Qnil;
- buffer_defaults.word_wrap = Qnil;
- buffer_defaults.ctl_arrow = Qt;
- buffer_defaults.bidi_display_reordering = Qnil;
- buffer_defaults.bidi_paragraph_direction = Qnil;
- buffer_defaults.cursor_type = Qt;
- buffer_defaults.extra_line_spacing = Qnil;
- buffer_defaults.cursor_in_non_selected_windows = Qt;
+ XSETFASTINT (B_ (&buffer_defaults, tab_width), 8);
+ B_ (&buffer_defaults, truncate_lines) = Qnil;
+ B_ (&buffer_defaults, word_wrap) = Qnil;
+ B_ (&buffer_defaults, ctl_arrow) = Qt;
+ B_ (&buffer_defaults, bidi_display_reordering) = Qnil;
+ B_ (&buffer_defaults, bidi_paragraph_direction) = Qnil;
+ B_ (&buffer_defaults, cursor_type) = Qt;
+ B_ (&buffer_defaults, extra_line_spacing) = Qnil;
+ B_ (&buffer_defaults, cursor_in_non_selected_windows) = Qt;
#ifdef DOS_NT
buffer_defaults.buffer_file_type = Qnil; /* TEXT */
#endif
- buffer_defaults.enable_multibyte_characters = Qt;
- buffer_defaults.buffer_file_coding_system = Qnil;
- XSETFASTINT (buffer_defaults.fill_column, 70);
- XSETFASTINT (buffer_defaults.left_margin, 0);
- buffer_defaults.cache_long_line_scans = Qnil;
- buffer_defaults.file_truename = Qnil;
- XSETFASTINT (buffer_defaults.display_count, 0);
- XSETFASTINT (buffer_defaults.left_margin_cols, 0);
- XSETFASTINT (buffer_defaults.right_margin_cols, 0);
- buffer_defaults.left_fringe_width = Qnil;
- buffer_defaults.right_fringe_width = Qnil;
- buffer_defaults.fringes_outside_margins = Qnil;
- buffer_defaults.scroll_bar_width = Qnil;
- buffer_defaults.vertical_scroll_bar_type = Qt;
- buffer_defaults.indicate_empty_lines = Qnil;
- buffer_defaults.indicate_buffer_boundaries = Qnil;
- buffer_defaults.fringe_indicator_alist = Qnil;
- buffer_defaults.fringe_cursor_alist = Qnil;
- buffer_defaults.scroll_up_aggressively = Qnil;
- buffer_defaults.scroll_down_aggressively = Qnil;
- buffer_defaults.display_time = Qnil;
+ B_ (&buffer_defaults, enable_multibyte_characters) = Qt;
+ B_ (&buffer_defaults, buffer_file_coding_system) = Qnil;
+ XSETFASTINT (B_ (&buffer_defaults, fill_column), 70);
+ XSETFASTINT (B_ (&buffer_defaults, left_margin), 0);
+ B_ (&buffer_defaults, cache_long_line_scans) = Qnil;
+ B_ (&buffer_defaults, file_truename) = Qnil;
+ XSETFASTINT (B_ (&buffer_defaults, display_count), 0);
+ XSETFASTINT (B_ (&buffer_defaults, left_margin_cols), 0);
+ XSETFASTINT (B_ (&buffer_defaults, right_margin_cols), 0);
+ B_ (&buffer_defaults, left_fringe_width) = Qnil;
+ B_ (&buffer_defaults, right_fringe_width) = Qnil;
+ B_ (&buffer_defaults, fringes_outside_margins) = Qnil;
+ B_ (&buffer_defaults, scroll_bar_width) = Qnil;
+ B_ (&buffer_defaults, vertical_scroll_bar_type) = Qt;
+ B_ (&buffer_defaults, indicate_empty_lines) = Qnil;
+ B_ (&buffer_defaults, indicate_buffer_boundaries) = Qnil;
+ B_ (&buffer_defaults, fringe_indicator_alist) = Qnil;
+ B_ (&buffer_defaults, fringe_cursor_alist) = Qnil;
+ B_ (&buffer_defaults, scroll_up_aggressively) = Qnil;
+ B_ (&buffer_defaults, scroll_down_aggressively) = Qnil;
+ B_ (&buffer_defaults, display_time) = Qnil;
/* Assign the local-flags to the slots that have default values.
The local flag is a bit that is used in the buffer
@@ -5069,73 +5075,73 @@ init_buffer_once (void)
/* 0 means not a lisp var, -1 means always local, else mask */
memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
- XSETINT (buffer_local_flags.filename, -1);
- XSETINT (buffer_local_flags.directory, -1);
- XSETINT (buffer_local_flags.backed_up, -1);
- XSETINT (buffer_local_flags.save_length, -1);
- XSETINT (buffer_local_flags.auto_save_file_name, -1);
- XSETINT (buffer_local_flags.read_only, -1);
- XSETINT (buffer_local_flags.major_mode, -1);
- XSETINT (buffer_local_flags.mode_name, -1);
- XSETINT (buffer_local_flags.undo_list, -1);
- XSETINT (buffer_local_flags.mark_active, -1);
- XSETINT (buffer_local_flags.point_before_scroll, -1);
- XSETINT (buffer_local_flags.file_truename, -1);
- XSETINT (buffer_local_flags.invisibility_spec, -1);
- XSETINT (buffer_local_flags.file_format, -1);
- XSETINT (buffer_local_flags.auto_save_file_format, -1);
- XSETINT (buffer_local_flags.display_count, -1);
- XSETINT (buffer_local_flags.display_time, -1);
- XSETINT (buffer_local_flags.enable_multibyte_characters, -1);
+ XSETINT (B_ (&buffer_local_flags, filename), -1);
+ XSETINT (B_ (&buffer_local_flags, directory), -1);
+ XSETINT (B_ (&buffer_local_flags, backed_up), -1);
+ XSETINT (B_ (&buffer_local_flags, save_length), -1);
+ XSETINT (B_ (&buffer_local_flags, auto_save_file_name), -1);
+ XSETINT (B_ (&buffer_local_flags, read_only), -1);
+ XSETINT (B_ (&buffer_local_flags, major_mode), -1);
+ XSETINT (B_ (&buffer_local_flags, mode_name), -1);
+ XSETINT (B_ (&buffer_local_flags, undo_list), -1);
+ XSETINT (B_ (&buffer_local_flags, mark_active), -1);
+ XSETINT (B_ (&buffer_local_flags, point_before_scroll), -1);
+ XSETINT (B_ (&buffer_local_flags, file_truename), -1);
+ XSETINT (B_ (&buffer_local_flags, invisibility_spec), -1);
+ XSETINT (B_ (&buffer_local_flags, file_format), -1);
+ XSETINT (B_ (&buffer_local_flags, auto_save_file_format), -1);
+ XSETINT (B_ (&buffer_local_flags, display_count), -1);
+ XSETINT (B_ (&buffer_local_flags, display_time), -1);
+ XSETINT (B_ (&buffer_local_flags, enable_multibyte_characters), -1);
idx = 1;
- XSETFASTINT (buffer_local_flags.mode_line_format, idx); ++idx;
- XSETFASTINT (buffer_local_flags.abbrev_mode, idx); ++idx;
- XSETFASTINT (buffer_local_flags.overwrite_mode, idx); ++idx;
- XSETFASTINT (buffer_local_flags.case_fold_search, idx); ++idx;
- XSETFASTINT (buffer_local_flags.auto_fill_function, idx); ++idx;
- XSETFASTINT (buffer_local_flags.selective_display, idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, mode_line_format), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, abbrev_mode), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, overwrite_mode), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, case_fold_search), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, auto_fill_function), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, selective_display), idx); ++idx;
#ifndef old
- XSETFASTINT (buffer_local_flags.selective_display_ellipses, idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, selective_display_ellipses), idx); ++idx;
#endif
- XSETFASTINT (buffer_local_flags.tab_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.truncate_lines, idx); ++idx;
- XSETFASTINT (buffer_local_flags.word_wrap, idx); ++idx;
- XSETFASTINT (buffer_local_flags.ctl_arrow, idx); ++idx;
- XSETFASTINT (buffer_local_flags.fill_column, idx); ++idx;
- XSETFASTINT (buffer_local_flags.left_margin, idx); ++idx;
- XSETFASTINT (buffer_local_flags.abbrev_table, idx); ++idx;
- XSETFASTINT (buffer_local_flags.display_table, idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, tab_width), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, truncate_lines), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, word_wrap), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, ctl_arrow), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, fill_column), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, left_margin), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, abbrev_table), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, display_table), idx); ++idx;
#ifdef DOS_NT
XSETFASTINT (buffer_local_flags.buffer_file_type, idx);
/* Make this one a permanent local. */
buffer_permanent_local_flags[idx++] = 1;
#endif
- XSETFASTINT (buffer_local_flags.syntax_table, idx); ++idx;
- XSETFASTINT (buffer_local_flags.cache_long_line_scans, idx); ++idx;
- XSETFASTINT (buffer_local_flags.category_table, idx); ++idx;
- XSETFASTINT (buffer_local_flags.bidi_display_reordering, idx); ++idx;
- XSETFASTINT (buffer_local_flags.bidi_paragraph_direction, idx); ++idx;
- XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx);
+ XSETFASTINT (B_ (&buffer_local_flags, syntax_table), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, cache_long_line_scans), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, category_table), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, bidi_display_reordering), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, bidi_paragraph_direction), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, buffer_file_coding_system), idx);
/* Make this one a permanent local. */
buffer_permanent_local_flags[idx++] = 1;
- XSETFASTINT (buffer_local_flags.left_margin_cols, idx); ++idx;
- XSETFASTINT (buffer_local_flags.right_margin_cols, idx); ++idx;
- XSETFASTINT (buffer_local_flags.left_fringe_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.right_fringe_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.fringes_outside_margins, idx); ++idx;
- XSETFASTINT (buffer_local_flags.scroll_bar_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.vertical_scroll_bar_type, idx); ++idx;
- XSETFASTINT (buffer_local_flags.indicate_empty_lines, idx); ++idx;
- XSETFASTINT (buffer_local_flags.indicate_buffer_boundaries, idx); ++idx;
- XSETFASTINT (buffer_local_flags.fringe_indicator_alist, idx); ++idx;
- XSETFASTINT (buffer_local_flags.fringe_cursor_alist, idx); ++idx;
- XSETFASTINT (buffer_local_flags.scroll_up_aggressively, idx); ++idx;
- XSETFASTINT (buffer_local_flags.scroll_down_aggressively, idx); ++idx;
- XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx;
- XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx;
- XSETFASTINT (buffer_local_flags.extra_line_spacing, idx); ++idx;
- XSETFASTINT (buffer_local_flags.cursor_in_non_selected_windows, idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, left_margin_cols), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, right_margin_cols), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, left_fringe_width), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, right_fringe_width), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, fringes_outside_margins), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, scroll_bar_width), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, indicate_empty_lines), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, fringe_indicator_alist), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, fringe_cursor_alist), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, scroll_up_aggressively), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, scroll_down_aggressively), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, header_line_format), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, cursor_type), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, extra_line_spacing), idx); ++idx;
+ XSETFASTINT (B_ (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx;
/* Need more room? */
if (idx >= MAX_PER_BUFFER_VARS)
@@ -5149,7 +5155,7 @@ init_buffer_once (void)
QSFundamental = make_pure_c_string ("Fundamental");
Qfundamental_mode = intern_c_string ("fundamental-mode");
- buffer_defaults.major_mode = Qfundamental_mode;
+ B_ (&buffer_defaults, major_mode) = Qfundamental_mode;
Qmode_class = intern_c_string ("mode-class");
@@ -5192,7 +5198,7 @@ init_buffer (void)
#endif /* USE_MMAP_FOR_BUFFERS */
Fset_buffer (Fget_buffer_create (build_string ("*scratch*")));
- if (NILP (buffer_defaults.enable_multibyte_characters))
+ if (NILP (B_ (&buffer_defaults, enable_multibyte_characters)))
Fset_buffer_multibyte (Qnil);
pwd = get_current_dir_name ();
@@ -5213,28 +5219,28 @@ init_buffer (void)
pwd[len + 1] = '\0';
}
- current_buffer->directory = make_unibyte_string (pwd, strlen (pwd));
- if (! NILP (buffer_defaults.enable_multibyte_characters))
+ B_ (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd));
+ if (! NILP (B_ (&buffer_defaults, enable_multibyte_characters)))
/* At this moment, we still don't know how to decode the
directory name. So, we keep the bytes in multibyte form so
that ENCODE_FILE correctly gets the original bytes. */
- current_buffer->directory
- = string_to_multibyte (current_buffer->directory);
+ B_ (current_buffer, directory)
+ = string_to_multibyte (B_ (current_buffer, directory));
/* Add /: to the front of the name
if it would otherwise be treated as magic. */
- temp = Ffind_file_name_handler (current_buffer->directory, Qt);
+ temp = Ffind_file_name_handler (B_ (current_buffer, directory), Qt);
if (! NILP (temp)
/* If the default dir is just /, TEMP is non-nil
because of the ange-ftp completion handler.
However, it is not necessary to turn / into /:/.
So avoid doing that. */
- && strcmp ("/", SSDATA (current_buffer->directory)))
- current_buffer->directory
- = concat2 (build_string ("/:"), current_buffer->directory);
+ && strcmp ("/", SSDATA (B_ (current_buffer, directory))))
+ B_ (current_buffer, directory)
+ = concat2 (build_string ("/:"), B_ (current_buffer, directory));
temp = get_minibuffer (0);
- XBUFFER (temp)->directory = current_buffer->directory;
+ B_ (XBUFFER (temp), directory) = B_ (current_buffer, directory);
free (pwd);
}
@@ -5485,13 +5491,13 @@ This value applies in buffers that don't have their own local values.
This is the same as (default-value 'scroll-down-aggressively). */);
DEFVAR_PER_BUFFER ("header-line-format",
- &current_buffer->header_line_format,
+ &B_ (current_buffer, header_line_format),
Qnil,
doc: /* Analogous to `mode-line-format', but controls the header line.
The header line appears, optionally, at the top of a window;
the mode line appears at the bottom. */);
- DEFVAR_PER_BUFFER ("mode-line-format", &current_buffer->mode_line_format,
+ DEFVAR_PER_BUFFER ("mode-line-format", &B_ (current_buffer, mode_line_format),
Qnil,
doc: /* Template for displaying mode line for current buffer.
Each buffer has its own value of this variable.
@@ -5548,7 +5554,7 @@ Decimal digits after the % specify field width to which to pad. */);
DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode,
doc: /* *Value of `major-mode' for new buffers. */);
- DEFVAR_PER_BUFFER ("major-mode", &current_buffer->major_mode,
+ DEFVAR_PER_BUFFER ("major-mode", &B_ (current_buffer, major_mode),
make_number (Lisp_Symbol),
doc: /* Symbol for current buffer's major mode.
The default value (normally `fundamental-mode') affects new buffers.
@@ -5561,46 +5567,46 @@ the buffer. Thus, the mode and its hooks should not expect certain
variables such as `buffer-read-only' and `buffer-file-coding-system'
to be set up. */);
- DEFVAR_PER_BUFFER ("mode-name", &current_buffer->mode_name,
+ DEFVAR_PER_BUFFER ("mode-name", &B_ (current_buffer, mode_name),
Qnil,
doc: /* Pretty name of current buffer's major mode.
Usually a string, but can use any of the constructs for `mode-line-format',
which see.
Format with `format-mode-line' to produce a string value. */);
- DEFVAR_PER_BUFFER ("local-abbrev-table", &current_buffer->abbrev_table, Qnil,
+ DEFVAR_PER_BUFFER ("local-abbrev-table", &B_ (current_buffer, abbrev_table), Qnil,
doc: /* Local (mode-specific) abbrev table of current buffer. */);
- DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil,
+ DEFVAR_PER_BUFFER ("abbrev-mode", &B_ (current_buffer, abbrev_mode), Qnil,
doc: /* Non-nil if Abbrev mode is enabled.
Use the command `abbrev-mode' to change this variable. */);
- DEFVAR_PER_BUFFER ("case-fold-search", &current_buffer->case_fold_search,
+ DEFVAR_PER_BUFFER ("case-fold-search", &B_ (current_buffer, case_fold_search),
Qnil,
doc: /* *Non-nil if searches and matches should ignore case. */);
- DEFVAR_PER_BUFFER ("fill-column", &current_buffer->fill_column,
+ DEFVAR_PER_BUFFER ("fill-column", &B_ (current_buffer, fill_column),
make_number (LISP_INT_TAG),
doc: /* *Column beyond which automatic line-wrapping should happen.
Interactively, you can set the buffer local value using \\[set-fill-column]. */);
- DEFVAR_PER_BUFFER ("left-margin", &current_buffer->left_margin,
+ DEFVAR_PER_BUFFER ("left-margin", &B_ (current_buffer, left_margin),
make_number (LISP_INT_TAG),
doc: /* *Column for the default `indent-line-function' to indent to.
Linefeed indents to this column in Fundamental mode. */);
- DEFVAR_PER_BUFFER ("tab-width", &current_buffer->tab_width,
+ DEFVAR_PER_BUFFER ("tab-width", &B_ (current_buffer, tab_width),
make_number (LISP_INT_TAG),
doc: /* *Distance between tab stops (for display of tab characters), in columns. */);
- DEFVAR_PER_BUFFER ("ctl-arrow", &current_buffer->ctl_arrow, Qnil,
+ DEFVAR_PER_BUFFER ("ctl-arrow", &B_ (current_buffer, ctl_arrow), Qnil,
doc: /* *Non-nil means display control chars with uparrow.
A value of nil means use backslash and octal digits.
This variable does not apply to characters whose display is specified
in the current display table (if there is one). */);
DEFVAR_PER_BUFFER ("enable-multibyte-characters",
- &current_buffer->enable_multibyte_characters,
+ &B_ (current_buffer, enable_multibyte_characters),
Qnil,
doc: /* Non-nil means the buffer contents are regarded as multi-byte characters.
Otherwise they are regarded as unibyte. This affects the display,
@@ -5614,7 +5620,7 @@ See also variable `default-enable-multibyte-characters' and Info node
XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1;
DEFVAR_PER_BUFFER ("buffer-file-coding-system",
- &current_buffer->buffer_file_coding_system, Qnil,
+ &B_ (current_buffer, buffer_file_coding_system), Qnil,
doc: /* Coding system to be used for encoding the buffer contents on saving.
This variable applies to saving the buffer, and also to `write-region'
and other functions that use `write-region'.
@@ -5632,11 +5638,11 @@ The variable `coding-system-for-write', if non-nil, overrides this variable.
This variable is never applied to a way of decoding a file while reading it. */);
DEFVAR_PER_BUFFER ("bidi-display-reordering",
- &current_buffer->bidi_display_reordering, Qnil,
+ &B_ (current_buffer, bidi_display_reordering), Qnil,
doc: /* Non-nil means reorder bidirectional text for display in the visual order. */);
DEFVAR_PER_BUFFER ("bidi-paragraph-direction",
- &current_buffer->bidi_paragraph_direction, Qnil,
+ &B_ (current_buffer, bidi_paragraph_direction), Qnil,
doc: /* *If non-nil, forces directionality of text paragraphs in the buffer.
If this is nil (the default), the direction of each paragraph is
@@ -5647,7 +5653,7 @@ Any other value is treated as nil.
This variable has no effect unless the buffer's value of
\`bidi-display-reordering' is non-nil. */);
- DEFVAR_PER_BUFFER ("truncate-lines", &current_buffer->truncate_lines, Qnil,
+ DEFVAR_PER_BUFFER ("truncate-lines", &B_ (current_buffer, truncate_lines), Qnil,
doc: /* *Non-nil means do not display continuation lines.
Instead, give each line of text just one screen line.
@@ -5655,7 +5661,7 @@ Note that this is overridden by the variable
`truncate-partial-width-windows' if that variable is non-nil
and this buffer is not full-frame width. */);
- DEFVAR_PER_BUFFER ("word-wrap", &current_buffer->word_wrap, Qnil,
+ DEFVAR_PER_BUFFER ("word-wrap", &B_ (current_buffer, word_wrap), Qnil,
doc: /* *Non-nil means to use word-wrapping for continuation lines.
When word-wrapping is on, continuation lines are wrapped at the space
or tab character nearest to the right window edge.
@@ -5676,12 +5682,12 @@ On those systems, it is automatically local in every buffer.
On other systems, this variable is normally always nil. */);
#endif
- DEFVAR_PER_BUFFER ("default-directory", &current_buffer->directory,
+ DEFVAR_PER_BUFFER ("default-directory", &B_ (current_buffer, directory),
make_number (Lisp_String),
doc: /* Name of default directory of current buffer. Should end with slash.
To interactively change the default directory, use command `cd'. */);
- DEFVAR_PER_BUFFER ("auto-fill-function", &current_buffer->auto_fill_function,
+ DEFVAR_PER_BUFFER ("auto-fill-function", &B_ (current_buffer, auto_fill_function),
Qnil,
doc: /* Function called (if non-nil) to perform auto-fill.
It is called after self-inserting any character specified in
@@ -5689,30 +5695,30 @@ the `auto-fill-chars' table.
NOTE: This variable is not a hook;
its value may not be a list of functions. */);
- DEFVAR_PER_BUFFER ("buffer-file-name", &current_buffer->filename,
+ DEFVAR_PER_BUFFER ("buffer-file-name", &B_ (current_buffer, filename),
make_number (Lisp_String),
doc: /* Name of file visited in current buffer, or nil if not visiting a file. */);
- DEFVAR_PER_BUFFER ("buffer-file-truename", &current_buffer->file_truename,
+ DEFVAR_PER_BUFFER ("buffer-file-truename", &B_ (current_buffer, file_truename),
make_number (Lisp_String),
doc: /* Abbreviated truename of file visited in current buffer, or nil if none.
The truename of a file is calculated by `file-truename'
and then abbreviated with `abbreviate-file-name'. */);
DEFVAR_PER_BUFFER ("buffer-auto-save-file-name",
- &current_buffer->auto_save_file_name,
+ &B_ (current_buffer, auto_save_file_name),
make_number (Lisp_String),
doc: /* Name of file for auto-saving current buffer.
If it is nil, that means don't auto-save this buffer. */);
- DEFVAR_PER_BUFFER ("buffer-read-only", &current_buffer->read_only, Qnil,
+ DEFVAR_PER_BUFFER ("buffer-read-only", &B_ (current_buffer, read_only), Qnil,
doc: /* Non-nil if this buffer is read-only. */);
- DEFVAR_PER_BUFFER ("buffer-backed-up", &current_buffer->backed_up, Qnil,
+ DEFVAR_PER_BUFFER ("buffer-backed-up", &B_ (current_buffer, backed_up), Qnil,
doc: /* Non-nil if this buffer's file has been backed up.
Backing up is done before the first time the file is saved. */);
- DEFVAR_PER_BUFFER ("buffer-saved-size", &current_buffer->save_length,
+ DEFVAR_PER_BUFFER ("buffer-saved-size", &B_ (current_buffer, save_length),
make_number (LISP_INT_TAG),
doc: /* Length of current buffer when last read in, saved or auto-saved.
0 initially.
@@ -5722,7 +5728,7 @@ If you set this to -2, that means don't turn off auto-saving in this buffer
if its text size shrinks. If you use `buffer-swap-text' on a buffer,
you probably should set this to -2 in that buffer. */);
- DEFVAR_PER_BUFFER ("selective-display", &current_buffer->selective_display,
+ DEFVAR_PER_BUFFER ("selective-display", &B_ (current_buffer, selective_display),
Qnil,
doc: /* Non-nil enables selective display.
An integer N as value means display only lines
@@ -5733,12 +5739,12 @@ in a file, save the ^M as a newline. */);
#ifndef old
DEFVAR_PER_BUFFER ("selective-display-ellipses",
- &current_buffer->selective_display_ellipses,
+ &B_ (current_buffer, selective_display_ellipses),
Qnil,
doc: /* Non-nil means display ... on previous line when a line is invisible. */);
#endif
- DEFVAR_PER_BUFFER ("overwrite-mode", &current_buffer->overwrite_mode, Qnil,
+ DEFVAR_PER_BUFFER ("overwrite-mode", &B_ (current_buffer, overwrite_mode), Qnil,
doc: /* Non-nil if self-insertion should replace existing text.
The value should be one of `overwrite-mode-textual',
`overwrite-mode-binary', or nil.
@@ -5747,7 +5753,7 @@ inserts at the end of a line, and inserts when point is before a tab,
until the tab is filled in.
If `overwrite-mode-binary', self-insertion replaces newlines and tabs too. */);
- DEFVAR_PER_BUFFER ("buffer-display-table", &current_buffer->display_table,
+ DEFVAR_PER_BUFFER ("buffer-display-table", &B_ (current_buffer, display_table),
Qnil,
doc: /* Display table that controls display of the contents of current buffer.
@@ -5784,39 +5790,39 @@ In addition, a char-table has six extra slots to control the display of:
See also the functions `display-table-slot' and `set-display-table-slot'. */);
- DEFVAR_PER_BUFFER ("left-margin-width", &current_buffer->left_margin_cols,
+ DEFVAR_PER_BUFFER ("left-margin-width", &B_ (current_buffer, left_margin_cols),
Qnil,
doc: /* *Width of left marginal area for display of a buffer.
A value of nil means no marginal area. */);
- DEFVAR_PER_BUFFER ("right-margin-width", &current_buffer->right_margin_cols,
+ DEFVAR_PER_BUFFER ("right-margin-width", &B_ (current_buffer, right_margin_cols),
Qnil,
doc: /* *Width of right marginal area for display of a buffer.
A value of nil means no marginal area. */);
- DEFVAR_PER_BUFFER ("left-fringe-width", &current_buffer->left_fringe_width,
+ DEFVAR_PER_BUFFER ("left-fringe-width", &B_ (current_buffer, left_fringe_width),
Qnil,
doc: /* *Width of this buffer's left fringe (in pixels).
A value of 0 means no left fringe is shown in this buffer's window.
A value of nil means to use the left fringe width from the window's frame. */);
- DEFVAR_PER_BUFFER ("right-fringe-width", &current_buffer->right_fringe_width,
+ DEFVAR_PER_BUFFER ("right-fringe-width", &B_ (current_buffer, right_fringe_width),
Qnil,
doc: /* *Width of this buffer's right fringe (in pixels).
A value of 0 means no right fringe is shown in this buffer's window.
A value of nil means to use the right fringe width from the window's frame. */);
- DEFVAR_PER_BUFFER ("fringes-outside-margins", &current_buffer->fringes_outside_margins,
+ DEFVAR_PER_BUFFER ("fringes-outside-margins", &B_ (current_buffer, fringes_outside_margins),
Qnil,
doc: /* *Non-nil means to display fringes outside display margins.
A value of nil means to display fringes between margins and buffer text. */);
- DEFVAR_PER_BUFFER ("scroll-bar-width", &current_buffer->scroll_bar_width,
+ DEFVAR_PER_BUFFER ("scroll-bar-width", &B_ (current_buffer, scroll_bar_width),
Qnil,
doc: /* *Width of this buffer's scroll bars in pixels.
A value of nil means to use the scroll bar width from the window's frame. */);
- DEFVAR_PER_BUFFER ("vertical-scroll-bar", &current_buffer->vertical_scroll_bar_type,
+ DEFVAR_PER_BUFFER ("vertical-scroll-bar", &B_ (current_buffer, vertical_scroll_bar_type),
Qnil,
doc: /* *Position of this buffer's vertical scroll bar.
The value takes effect whenever you tell a window to display this buffer;
@@ -5827,13 +5833,13 @@ of the window; a value of nil means don't show any vertical scroll bars.
A value of t (the default) means do whatever the window's frame specifies. */);
DEFVAR_PER_BUFFER ("indicate-empty-lines",
- &current_buffer->indicate_empty_lines, Qnil,
+ &B_ (current_buffer, indicate_empty_lines), Qnil,
doc: /* *Visually indicate empty lines after the buffer end.
If non-nil, a bitmap is displayed in the left fringe of a window on
window-systems. */);
DEFVAR_PER_BUFFER ("indicate-buffer-boundaries",
- &current_buffer->indicate_buffer_boundaries, Qnil,
+ &B_ (current_buffer, indicate_buffer_boundaries), Qnil,
doc: /* *Visually indicate buffer boundaries and scrolling.
If non-nil, the first and last line of the buffer are marked in the fringe
of a window on window-systems with angle bitmaps, or if the window can be
@@ -5858,7 +5864,7 @@ bitmaps in right fringe. To show just the angle bitmaps in the left
fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */);
DEFVAR_PER_BUFFER ("fringe-indicator-alist",
- &current_buffer->fringe_indicator_alist, Qnil,
+ &B_ (current_buffer, fringe_indicator_alist), Qnil,
doc: /* *Mapping from logical to physical fringe indicator bitmaps.
The value is an alist where each element (INDICATOR . BITMAPS)
specifies the fringe bitmaps used to display a specific logical
@@ -5877,7 +5883,7 @@ last (only) line has no final newline. BITMAPS may also be a single
symbol which is used in both left and right fringes. */);
DEFVAR_PER_BUFFER ("fringe-cursor-alist",
- &current_buffer->fringe_cursor_alist, Qnil,
+ &B_ (current_buffer, fringe_cursor_alist), Qnil,
doc: /* *Mapping from logical to physical fringe cursor bitmaps.
The value is an alist where each element (CURSOR . BITMAP)
specifies the fringe bitmaps used to display a specific logical
@@ -5892,7 +5898,7 @@ BITMAP is the corresponding fringe bitmap shown for the logical
cursor type. */);
DEFVAR_PER_BUFFER ("scroll-up-aggressively",
- &current_buffer->scroll_up_aggressively, Qnil,
+ &B_ (current_buffer, scroll_up_aggressively), Qnil,
doc: /* How far to scroll windows upward.
If you move point off the bottom, the window scrolls automatically.
This variable controls how far it scrolls. The value nil, the default,
@@ -5905,7 +5911,7 @@ window scrolls by a full window height. Meaningful values are
between 0.0 and 1.0, inclusive. */);
DEFVAR_PER_BUFFER ("scroll-down-aggressively",
- &current_buffer->scroll_down_aggressively, Qnil,
+ &B_ (current_buffer, scroll_down_aggressively), Qnil,
doc: /* How far to scroll windows downward.
If you move point off the top, the window scrolls automatically.
This variable controls how far it scrolls. The value nil, the default,
@@ -5960,7 +5966,7 @@ from happening repeatedly and making Emacs nonfunctional. */);
The functions are run using the `run-hooks' function. */);
Vfirst_change_hook = Qnil;
- DEFVAR_PER_BUFFER ("buffer-undo-list", &current_buffer->undo_list, Qnil,
+ DEFVAR_PER_BUFFER ("buffer-undo-list", &B_ (current_buffer, undo_list), Qnil,
doc: /* List of undo entries in current buffer.
Recent changes come first; older changes follow newer.
@@ -6001,10 +6007,10 @@ the changes between two undo boundaries as a single step to be undone.
If the value of the variable is t, undo information is not recorded. */);
- DEFVAR_PER_BUFFER ("mark-active", &current_buffer->mark_active, Qnil,
+ DEFVAR_PER_BUFFER ("mark-active", &B_ (current_buffer, mark_active), Qnil,
doc: /* Non-nil means the mark and region are currently active in this buffer. */);
- DEFVAR_PER_BUFFER ("cache-long-line-scans", &current_buffer->cache_long_line_scans, Qnil,
+ DEFVAR_PER_BUFFER ("cache-long-line-scans", &B_ (current_buffer, cache_long_line_scans), Qnil,
doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly.
Normally, the line-motion functions work by scanning the buffer for
@@ -6032,23 +6038,23 @@ maintained internally by the Emacs primitives. Enabling or disabling
the cache should not affect the behavior of any of the motion
functions; it should only affect their performance. */);
- DEFVAR_PER_BUFFER ("point-before-scroll", &current_buffer->point_before_scroll, Qnil,
+ DEFVAR_PER_BUFFER ("point-before-scroll", &B_ (current_buffer, point_before_scroll), Qnil,
doc: /* Value of point before the last series of scroll operations, or nil. */);
- DEFVAR_PER_BUFFER ("buffer-file-format", &current_buffer->file_format, Qnil,
+ DEFVAR_PER_BUFFER ("buffer-file-format", &B_ (current_buffer, file_format), Qnil,
doc: /* List of formats to use when saving this buffer.
Formats are defined by `format-alist'. This variable is
set when a file is visited. */);
DEFVAR_PER_BUFFER ("buffer-auto-save-file-format",
- &current_buffer->auto_save_file_format, Qnil,
+ &B_ (current_buffer, auto_save_file_format), Qnil,
doc: /* *Format in which to write auto-save files.
Should be a list of symbols naming formats that are defined in `format-alist'.
If it is t, which is the default, auto-save files are written in the
same format as a regular save would use. */);
DEFVAR_PER_BUFFER ("buffer-invisibility-spec",
- &current_buffer->invisibility_spec, Qnil,
+ &B_ (current_buffer, invisibility_spec), Qnil,
doc: /* Invisibility spec of this buffer.
The default is t, which means that text is invisible
if it has a non-nil `invisible' property.
@@ -6059,12 +6065,12 @@ then characters with property value PROP are invisible,
and they have an ellipsis as well if ELLIPSIS is non-nil. */);
DEFVAR_PER_BUFFER ("buffer-display-count",
- &current_buffer->display_count, Qnil,
+ &B_ (current_buffer, display_count), Qnil,
doc: /* A number incremented each time this buffer is displayed in a window.
The function `set-window-buffer' increments it. */);
DEFVAR_PER_BUFFER ("buffer-display-time",
- &current_buffer->display_time, Qnil,
+ &B_ (current_buffer, display_time), Qnil,
doc: /* Time stamp updated each time this buffer is displayed in a window.
The function `set-window-buffer' updates this variable
to the value obtained by calling `current-time'.
@@ -6099,7 +6105,7 @@ and disregard a `read-only' text property if the property value
is a member of the list. */);
Vinhibit_read_only = Qnil;
- DEFVAR_PER_BUFFER ("cursor-type", &current_buffer->cursor_type, Qnil,
+ DEFVAR_PER_BUFFER ("cursor-type", &B_ (current_buffer, cursor_type), Qnil,
doc: /* Cursor to use when this buffer is in the selected window.
Values are interpreted as follows:
@@ -6118,7 +6124,7 @@ cursor's appearance is instead controlled by the variable
`cursor-in-non-selected-windows'. */);
DEFVAR_PER_BUFFER ("line-spacing",
- &current_buffer->extra_line_spacing, Qnil,
+ &B_ (current_buffer, extra_line_spacing), Qnil,
doc: /* Additional space to put between lines when displaying a buffer.
The space is measured in pixels, and put below lines on graphic displays,
see `display-graphic-p'.
@@ -6126,7 +6132,7 @@ If value is a floating point number, it specifies the spacing relative
to the default frame line height. A value of nil means add no extra space. */);
DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows",
- &current_buffer->cursor_in_non_selected_windows, Qnil,
+ &B_ (current_buffer, cursor_in_non_selected_windows), Qnil,
doc: /* *Non-nil means show a cursor in non-selected windows.
If nil, only shows a cursor in the selected window.
If t, displays a cursor related to the usual cursor type
diff --git a/src/buffer.h b/src/buffer.h
index 31f96040b2d..36cb5fe9dda 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -321,7 +321,7 @@ while (0)
/* Return character at byte position POS. */
#define FETCH_CHAR(pos) \
- (!NILP (current_buffer->enable_multibyte_characters) \
+ (!NILP (B_ (current_buffer, enable_multibyte_characters)) \
? FETCH_MULTIBYTE_CHAR ((pos)) \
: FETCH_BYTE ((pos)))
@@ -346,7 +346,7 @@ extern unsigned char *_fetch_multibyte_char_p;
multibyte. */
#define FETCH_CHAR_AS_MULTIBYTE(pos) \
- (!NILP (current_buffer->enable_multibyte_characters) \
+ (!NILP (B_ (current_buffer, enable_multibyte_characters)) \
? FETCH_MULTIBYTE_CHAR ((pos)) \
: UNIBYTE_TO_CHAR (FETCH_BYTE ((pos))))
@@ -464,6 +464,15 @@ struct buffer_text
int inhibit_shrinking;
};
+/* Lisp fields in struct buffer are hidden from most code and accessed
+ via the B_ macro, below. Only select pieces of code, like the GC,
+ are allowed to use BUFFER_INTERNAL_FIELD. */
+#define BUFFER_INTERNAL_FIELD(field) field ## _
+
+/* Most code should use this macro to access Lisp fields in struct
+ buffer. */
+#define B_(buf, field) ((buf)->BUFFER_INTERNAL_FIELD (field))
+
/* This is the structure that the buffer Lisp object points to. */
struct buffer
@@ -587,138 +596,138 @@ struct buffer
because local variables have to be right in the struct buffer.
So we copy it around in set_buffer_internal.
This comes before `name' because it is marked in a special way. */
- Lisp_Object undo_list;
+ Lisp_Object BUFFER_INTERNAL_FIELD (undo_list);
/* The name of this buffer. */
- Lisp_Object name;
+ Lisp_Object BUFFER_INTERNAL_FIELD (name);
/* The name of the file visited in this buffer, or nil. */
- Lisp_Object filename;
+ Lisp_Object BUFFER_INTERNAL_FIELD (filename);
/* Dir for expanding relative file names. */
- Lisp_Object directory;
+ Lisp_Object BUFFER_INTERNAL_FIELD (directory);
/* True if this buffer has been backed up (if you write to the
visited file and it hasn't been backed up, then a backup will
be made). */
/* This isn't really used by the C code, so could be deleted. */
- Lisp_Object backed_up;
+ Lisp_Object BUFFER_INTERNAL_FIELD (backed_up);
/* Length of file when last read or saved.
-1 means auto saving turned off because buffer shrank a lot.
-2 means don't turn off auto saving if buffer shrinks.
(That value is used with buffer-swap-text.)
This is not in the struct buffer_text
because it's not used in indirect buffers at all. */
- Lisp_Object save_length;
+ Lisp_Object BUFFER_INTERNAL_FIELD (save_length);
/* File name used for auto-saving this buffer.
This is not in the struct buffer_text
because it's not used in indirect buffers at all. */
- Lisp_Object auto_save_file_name;
+ Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_name);
/* Non-nil if buffer read-only. */
- Lisp_Object read_only;
+ Lisp_Object BUFFER_INTERNAL_FIELD (read_only);
/* "The mark". This is a marker which may
point into this buffer or may point nowhere. */
- Lisp_Object mark;
+ Lisp_Object BUFFER_INTERNAL_FIELD (mark);
/* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all
per-buffer variables of this buffer. For locally unbound
symbols, just the symbol appears as the element. */
- Lisp_Object local_var_alist;
+ Lisp_Object BUFFER_INTERNAL_FIELD (local_var_alist);
/* Symbol naming major mode (eg, lisp-mode). */
- Lisp_Object major_mode;
+ Lisp_Object BUFFER_INTERNAL_FIELD (major_mode);
/* Pretty name of major mode (eg, "Lisp"). */
- Lisp_Object mode_name;
+ Lisp_Object BUFFER_INTERNAL_FIELD (mode_name);
/* Mode line element that controls format of mode line. */
- Lisp_Object mode_line_format;
+ Lisp_Object BUFFER_INTERNAL_FIELD (mode_line_format);
/* Analogous to mode_line_format for the line displayed at the top
of windows. Nil means don't display that line. */
- Lisp_Object header_line_format;
+ Lisp_Object BUFFER_INTERNAL_FIELD (header_line_format);
/* Keys that are bound local to this buffer. */
- Lisp_Object keymap;
+ Lisp_Object BUFFER_INTERNAL_FIELD (keymap);
/* This buffer's local abbrev table. */
- Lisp_Object abbrev_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_table);
/* This buffer's syntax table. */
- Lisp_Object syntax_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (syntax_table);
/* This buffer's category table. */
- Lisp_Object category_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (category_table);
/* Values of several buffer-local variables. */
/* tab-width is buffer-local so that redisplay can find it
in buffers that are not current. */
- Lisp_Object case_fold_search;
- Lisp_Object tab_width;
- Lisp_Object fill_column;
- Lisp_Object left_margin;
+ Lisp_Object BUFFER_INTERNAL_FIELD (case_fold_search);
+ Lisp_Object BUFFER_INTERNAL_FIELD (tab_width);
+ Lisp_Object BUFFER_INTERNAL_FIELD (fill_column);
+ Lisp_Object BUFFER_INTERNAL_FIELD (left_margin);
/* Function to call when insert space past fill column. */
- Lisp_Object auto_fill_function;
+ Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function);
/* nil: text, t: binary.
This value is meaningful only on certain operating systems. */
/* Actually, we don't need this flag any more because end-of-line
is handled correctly according to the buffer-file-coding-system
of the buffer. Just keeping it for backward compatibility. */
- Lisp_Object buffer_file_type;
+ Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_type);
/* Case table for case-conversion in this buffer.
This char-table maps each char into its lower-case version. */
- Lisp_Object downcase_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (downcase_table);
/* Char-table mapping each char to its upper-case version. */
- Lisp_Object upcase_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (upcase_table);
/* Char-table for conversion for case-folding search. */
- Lisp_Object case_canon_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (case_canon_table);
/* Char-table of equivalences for case-folding search. */
- Lisp_Object case_eqv_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (case_eqv_table);
/* Non-nil means do not display continuation lines. */
- Lisp_Object truncate_lines;
+ Lisp_Object BUFFER_INTERNAL_FIELD (truncate_lines);
/* Non-nil means to use word wrapping when displaying continuation lines. */
- Lisp_Object word_wrap;
+ Lisp_Object BUFFER_INTERNAL_FIELD (word_wrap);
/* Non-nil means display ctl chars with uparrow. */
- Lisp_Object ctl_arrow;
+ Lisp_Object BUFFER_INTERNAL_FIELD (ctl_arrow);
/* Non-nil means reorder bidirectional text for display in the
visual order. */
- Lisp_Object bidi_display_reordering;
+ Lisp_Object BUFFER_INTERNAL_FIELD (bidi_display_reordering);
/* If non-nil, specifies which direction of text to force in all the
paragraphs of the buffer. Nil means determine paragraph
direction dynamically for each paragraph. */
- Lisp_Object bidi_paragraph_direction;
+ Lisp_Object BUFFER_INTERNAL_FIELD (bidi_paragraph_direction);
/* Non-nil means do selective display;
see doc string in syms_of_buffer (buffer.c) for details. */
- Lisp_Object selective_display;
+ Lisp_Object BUFFER_INTERNAL_FIELD (selective_display);
#ifndef old
/* Non-nil means show ... at end of line followed by invisible lines. */
- Lisp_Object selective_display_ellipses;
+ Lisp_Object BUFFER_INTERNAL_FIELD (selective_display_ellipses);
#endif
/* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */
- Lisp_Object minor_modes;
+ Lisp_Object BUFFER_INTERNAL_FIELD (minor_modes);
/* t if "self-insertion" should overwrite; `binary' if it should also
overwrite newlines and tabs - for editing executables and the like. */
- Lisp_Object overwrite_mode;
+ Lisp_Object BUFFER_INTERNAL_FIELD (overwrite_mode);
/* non-nil means abbrev mode is on. Expand abbrevs automatically. */
- Lisp_Object abbrev_mode;
+ Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_mode);
/* Display table to use for text in this buffer. */
- Lisp_Object display_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (display_table);
/* t means the mark and region are currently active. */
- Lisp_Object mark_active;
+ Lisp_Object BUFFER_INTERNAL_FIELD (mark_active);
/* Non-nil means the buffer contents are regarded as multi-byte
form of characters, not a binary code. */
- Lisp_Object enable_multibyte_characters;
+ Lisp_Object BUFFER_INTERNAL_FIELD (enable_multibyte_characters);
/* Coding system to be used for encoding the buffer contents on
saving. */
- Lisp_Object buffer_file_coding_system;
+ Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_coding_system);
/* List of symbols naming the file format used for visited file. */
- Lisp_Object file_format;
+ Lisp_Object BUFFER_INTERNAL_FIELD (file_format);
/* List of symbols naming the file format used for auto-save file. */
- Lisp_Object auto_save_file_format;
+ Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_format);
/* True if the newline position cache and width run cache are
enabled. See search.c and indent.c. */
- Lisp_Object cache_long_line_scans;
+ Lisp_Object BUFFER_INTERNAL_FIELD (cache_long_line_scans);
/* If the width run cache is enabled, this table contains the
character widths width_run_cache (see above) assumes. When we
@@ -726,99 +735,99 @@ struct buffer
current display table to see whether the display table has
affected the widths of any characters. If it has, we
invalidate the width run cache, and re-initialize width_table. */
- Lisp_Object width_table;
+ Lisp_Object BUFFER_INTERNAL_FIELD (width_table);
/* In an indirect buffer, or a buffer that is the base of an
indirect buffer, this holds a marker that records
PT for this buffer when the buffer is not current. */
- Lisp_Object pt_marker;
+ Lisp_Object BUFFER_INTERNAL_FIELD (pt_marker);
/* In an indirect buffer, or a buffer that is the base of an
indirect buffer, this holds a marker that records
BEGV for this buffer when the buffer is not current. */
- Lisp_Object begv_marker;
+ Lisp_Object BUFFER_INTERNAL_FIELD (begv_marker);
/* In an indirect buffer, or a buffer that is the base of an
indirect buffer, this holds a marker that records
ZV for this buffer when the buffer is not current. */
- Lisp_Object zv_marker;
+ Lisp_Object BUFFER_INTERNAL_FIELD (zv_marker);
/* This holds the point value before the last scroll operation.
Explicitly setting point sets this to nil. */
- Lisp_Object point_before_scroll;
+ Lisp_Object BUFFER_INTERNAL_FIELD (point_before_scroll);
/* Truename of the visited file, or nil. */
- Lisp_Object file_truename;
+ Lisp_Object BUFFER_INTERNAL_FIELD (file_truename);
/* Invisibility spec of this buffer.
t => any non-nil `invisible' property means invisible.
A list => `invisible' property means invisible
if it is memq in that list. */
- Lisp_Object invisibility_spec;
+ Lisp_Object BUFFER_INTERNAL_FIELD (invisibility_spec);
/* This is the last window that was selected with this buffer in it,
or nil if that window no longer displays this buffer. */
- Lisp_Object last_selected_window;
+ Lisp_Object BUFFER_INTERNAL_FIELD (last_selected_window);
/* Incremented each time the buffer is displayed in a window. */
- Lisp_Object display_count;
+ Lisp_Object BUFFER_INTERNAL_FIELD (display_count);
/* Widths of left and right marginal areas for windows displaying
this buffer. */
- Lisp_Object left_margin_cols, right_margin_cols;
+ Lisp_Object BUFFER_INTERNAL_FIELD (left_margin_cols), BUFFER_INTERNAL_FIELD (right_margin_cols);
/* Widths of left and right fringe areas for windows displaying
this buffer. */
- Lisp_Object left_fringe_width, right_fringe_width;
+ Lisp_Object BUFFER_INTERNAL_FIELD (left_fringe_width), BUFFER_INTERNAL_FIELD (right_fringe_width);
/* Non-nil means fringes are drawn outside display margins;
othersize draw them between margin areas and text. */
- Lisp_Object fringes_outside_margins;
+ Lisp_Object BUFFER_INTERNAL_FIELD (fringes_outside_margins);
/* Width and type of scroll bar areas for windows displaying
this buffer. */
- Lisp_Object scroll_bar_width, vertical_scroll_bar_type;
+ Lisp_Object BUFFER_INTERNAL_FIELD (scroll_bar_width), BUFFER_INTERNAL_FIELD (vertical_scroll_bar_type);
/* Non-nil means indicate lines not displaying text (in a style
like vi). */
- Lisp_Object indicate_empty_lines;
+ Lisp_Object BUFFER_INTERNAL_FIELD (indicate_empty_lines);
/* Non-nil means indicate buffer boundaries and scrolling. */
- Lisp_Object indicate_buffer_boundaries;
+ Lisp_Object BUFFER_INTERNAL_FIELD (indicate_buffer_boundaries);
/* Logical to physical fringe bitmap mappings. */
- Lisp_Object fringe_indicator_alist;
+ Lisp_Object BUFFER_INTERNAL_FIELD (fringe_indicator_alist);
/* Logical to physical cursor bitmap mappings. */
- Lisp_Object fringe_cursor_alist;
+ Lisp_Object BUFFER_INTERNAL_FIELD (fringe_cursor_alist);
/* Time stamp updated each time this buffer is displayed in a window. */
- Lisp_Object display_time;
+ Lisp_Object BUFFER_INTERNAL_FIELD (display_time);
/* If scrolling the display because point is below the bottom of a
window showing this buffer, try to choose a window start so
that point ends up this number of lines from the top of the
window. Nil means that scrolling method isn't used. */
- Lisp_Object scroll_up_aggressively;
+ Lisp_Object BUFFER_INTERNAL_FIELD (scroll_up_aggressively);
/* If scrolling the display because point is above the top of a
window showing this buffer, try to choose a window start so
that point ends up this number of lines from the bottom of the
window. Nil means that scrolling method isn't used. */
- Lisp_Object scroll_down_aggressively;
+ Lisp_Object BUFFER_INTERNAL_FIELD (scroll_down_aggressively);
/* Desired cursor type in this buffer. See the doc string of
per-buffer variable `cursor-type'. */
- Lisp_Object cursor_type;
+ Lisp_Object BUFFER_INTERNAL_FIELD (cursor_type);
/* An integer > 0 means put that number of pixels below text lines
in the display of this buffer. */
- Lisp_Object extra_line_spacing;
+ Lisp_Object BUFFER_INTERNAL_FIELD (extra_line_spacing);
/* *Cursor type to display in non-selected windows.
t means to use hollow box cursor.
See `cursor-type' for other values. */
- Lisp_Object cursor_in_non_selected_windows;
+ Lisp_Object BUFFER_INTERNAL_FIELD (cursor_in_non_selected_windows);
};
@@ -942,7 +951,7 @@ extern int last_per_buffer_idx;
from the start of a buffer structure. */
#define PER_BUFFER_VAR_OFFSET(VAR) \
- offsetof (struct buffer, VAR)
+ offsetof (struct buffer, BUFFER_INTERNAL_FIELD (VAR))
/* Return the index of buffer-local variable VAR. Each per-buffer
variable has an index > 0 associated with it, except when it always
diff --git a/src/bytecode.c b/src/bytecode.c
index fd2680e4054..a470eca16a9 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1398,7 +1398,7 @@ If the third argument is incorrect, Emacs may crash. */)
CHECK_CHARACTER (TOP);
AFTER_POTENTIAL_GC ();
c = XFASTINT (TOP);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
MAKE_CHAR_MULTIBYTE (c);
XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]);
}
diff --git a/src/callint.c b/src/callint.c
index 2e4314295ff..154659490b8 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -149,12 +149,12 @@ static void
check_mark (int for_region)
{
Lisp_Object tem;
- tem = Fmarker_buffer (current_buffer->mark);
+ tem = Fmarker_buffer (B_ (current_buffer, mark));
if (NILP (tem) || (XBUFFER (tem) != current_buffer))
error (for_region ? "The mark is not set now, so there is no region"
: "The mark is not set now");
if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive)
- && NILP (current_buffer->mark_active))
+ && NILP (B_ (current_buffer, mark_active)))
xsignal0 (Qmark_inactive);
}
@@ -385,7 +385,7 @@ invoke it. If KEYS is omitted or nil, the return value of
else if (*string == '*')
{
string++;
- if (!NILP (current_buffer->read_only))
+ if (!NILP (B_ (current_buffer, read_only)))
{
if (!NILP (record_flag))
{
@@ -543,7 +543,7 @@ invoke it. If KEYS is omitted or nil, the return value of
case 'D': /* Directory name. */
args[i] = Fread_file_name (callint_message, Qnil,
- current_buffer->directory, Qlambda, Qnil,
+ B_ (current_buffer, directory), Qlambda, Qnil,
Qfile_directory_p);
break;
@@ -661,7 +661,7 @@ invoke it. If KEYS is omitted or nil, the return value of
case 'm': /* Value of mark. Does not do I/O. */
check_mark (0);
/* visargs[i] = Qnil; */
- args[i] = current_buffer->mark;
+ args[i] = B_ (current_buffer, mark);
varies[i] = 2;
break;
@@ -717,11 +717,11 @@ invoke it. If KEYS is omitted or nil, the return value of
check_mark (1);
set_marker_both (point_marker, Qnil, PT, PT_BYTE);
/* visargs[i+1] = Qnil; */
- foo = marker_position (current_buffer->mark);
+ foo = marker_position (B_ (current_buffer, mark));
/* visargs[i] = Qnil; */
- args[i] = PT < foo ? point_marker : current_buffer->mark;
+ args[i] = PT < foo ? point_marker : B_ (current_buffer, mark);
varies[i] = 3;
- args[++i] = PT > foo ? point_marker : current_buffer->mark;
+ args[++i] = PT > foo ? point_marker : B_ (current_buffer, mark);
varies[i] = 4;
break;
diff --git a/src/callproc.c b/src/callproc.c
index f2543f296d5..bdd3060bef1 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -265,7 +265,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
if (nargs >= 2 && ! NILP (args[1]))
{
- infile = Fexpand_file_name (args[1], current_buffer->directory);
+ infile = Fexpand_file_name (args[1], B_ (current_buffer, directory));
CHECK_STRING (infile);
}
else
@@ -322,7 +322,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
{
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- current_dir = current_buffer->directory;
+ current_dir = B_ (current_buffer, directory);
GCPRO4 (infile, buffer, current_dir, error_file);
@@ -336,7 +336,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
if (NILP (Ffile_accessible_directory_p (current_dir)))
report_file_error ("Setting current directory",
- Fcons (current_buffer->directory, Qnil));
+ Fcons (B_ (current_buffer, directory), Qnil));
if (STRING_MULTIBYTE (infile))
infile = ENCODE_FILE (infile);
@@ -663,7 +663,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
/* In unibyte mode, character code conversion should not take
place but EOL conversion should. So, setup raw-text or one
of the subsidiary according to the information just setup. */
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& !NILP (val))
val = raw_text_coding_system (val);
setup_coding_system (val, &process_coding);
@@ -713,7 +713,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
if (!NILP (buffer))
{
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! CODING_MAY_REQUIRE_DECODING (&process_coding))
insert_1_both (buf, nread, nread, 0, 1, 0);
else
@@ -926,7 +926,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
/* Decide coding-system of the contents of the temporary file. */
if (!NILP (Vcoding_system_for_write))
val = Vcoding_system_for_write;
- else if (NILP (current_buffer->enable_multibyte_characters))
+ else if (NILP (B_ (current_buffer, enable_multibyte_characters)))
val = Qraw_text;
else
{
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 62d261278ab..6c05aecffe8 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -39,15 +39,15 @@ casify_object (enum case_action flag, Lisp_Object obj)
register int inword = flag == CASE_DOWN;
/* If the case table is flagged as modified, rescan it. */
- if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1]))
- Fset_case_table (current_buffer->downcase_table);
+ if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1]))
+ Fset_case_table (B_ (current_buffer, downcase_table));
if (INTEGERP (obj))
{
int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER
| CHAR_SHIFT | CHAR_CTL | CHAR_META);
int flags = XINT (obj) & flagbits;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
/* If the character has higher bits set
above the flags, return it unchanged.
@@ -198,7 +198,7 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
{
register int c;
register int inword = flag == CASE_DOWN;
- register int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ register int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
EMACS_INT start, end;
EMACS_INT start_byte, end_byte;
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)
return;
/* If the case table is flagged as modified, rescan it. */
- if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1]))
- Fset_case_table (current_buffer->downcase_table);
+ if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1]))
+ Fset_case_table (B_ (current_buffer, downcase_table));
validate_region (&b, &e);
start = XFASTINT (b);
diff --git a/src/casetab.c b/src/casetab.c
index 0db9d63f7a6..85c2d6e1581 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,
doc: /* Return the case table of the current buffer. */)
(void)
{
- return current_buffer->downcase_table;
+ return B_ (current_buffer, downcase_table);
}
DEFUN ("standard-case-table", Fstandard_case_table, Sstandard_case_table, 0, 0, 0,
@@ -160,10 +160,10 @@ set_case_table (Lisp_Object table, int standard)
}
else
{
- current_buffer->downcase_table = table;
- current_buffer->upcase_table = up;
- current_buffer->case_canon_table = canon;
- current_buffer->case_eqv_table = eqv;
+ B_ (current_buffer, downcase_table) = table;
+ B_ (current_buffer, upcase_table) = up;
+ B_ (current_buffer, case_canon_table) = canon;
+ B_ (current_buffer, case_eqv_table) = eqv;
}
return table;
diff --git a/src/category.c b/src/category.c
index 06046959b6f..bf8269ffd75 100644
--- a/src/category.c
+++ b/src/category.c
@@ -190,7 +190,7 @@ Lisp_Object
check_category_table (Lisp_Object table)
{
if (NILP (table))
- return current_buffer->category_table;
+ return B_ (current_buffer, category_table);
CHECK_TYPE (!NILP (Fcategory_table_p (table)), Qcategory_table_p, table);
return table;
}
@@ -200,7 +200,7 @@ DEFUN ("category-table", Fcategory_table, Scategory_table, 0, 0, 0,
This is the one specified by the current buffer. */)
(void)
{
- return current_buffer->category_table;
+ return B_ (current_buffer, category_table);
}
DEFUN ("standard-category-table", Fstandard_category_table,
@@ -281,7 +281,7 @@ Return TABLE. */)
{
int idx;
table = check_category_table (table);
- current_buffer->category_table = table;
+ B_ (current_buffer, category_table) = table;
/* Indicate that this buffer now has a specified category table. */
idx = PER_BUFFER_VAR_IDX (category_table);
SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
@@ -292,7 +292,7 @@ Return TABLE. */)
Lisp_Object
char_category_set (int c)
{
- return CHAR_TABLE_REF (current_buffer->category_table, c);
+ return CHAR_TABLE_REF (B_ (current_buffer, category_table), c);
}
DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0,
diff --git a/src/category.h b/src/category.h
index 561b06b6f60..16b31da0819 100644
--- a/src/category.h
+++ b/src/category.h
@@ -91,7 +91,7 @@ extern Lisp_Object _temp_category_set;
/* The standard category table is stored where it will automatically
be used in all new buffers. */
-#define Vstandard_category_table buffer_defaults.category_table
+#define Vstandard_category_table B_ (&buffer_defaults, category_table)
/* Return the category set of character C in the current category table. */
#define CATEGORY_SET(c) char_category_set (c)
diff --git a/src/character.c b/src/character.c
index 397481e5b39..e4ff3d7922c 100644
--- a/src/character.c
+++ b/src/character.c
@@ -521,7 +521,7 @@ chars_in_text (const unsigned char *ptr, EMACS_INT nbytes)
{
/* current_buffer is null at early stages of Emacs initialization. */
if (current_buffer == 0
- || NILP (current_buffer->enable_multibyte_characters))
+ || NILP (B_ (current_buffer, enable_multibyte_characters)))
return nbytes;
return multibyte_chars_in_text (ptr, nbytes);
@@ -987,7 +987,7 @@ character is not ASCII nor 8-bit character, an error is signalled. */)
pos = XFASTINT (position);
p = CHAR_POS_ADDR (pos);
}
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
return make_number (*p);
}
else
diff --git a/src/character.h b/src/character.h
index f2ccb28bb37..f2d06102f62 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/>. */
do \
{ \
CHARIDX++; \
- if (!NILP (current_buffer->enable_multibyte_characters)) \
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters))) \
{ \
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int len; \
@@ -484,7 +484,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
do \
{ \
(charpos)++; \
- if (NILP (current_buffer->enable_multibyte_characters)) \
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))) \
(bytepos)++; \
else \
INC_POS ((bytepos)); \
@@ -498,7 +498,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
do \
{ \
(charpos)--; \
- if (NILP (current_buffer->enable_multibyte_characters)) \
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))) \
(bytepos)--; \
else \
DEC_POS ((bytepos)); \
@@ -561,11 +561,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define ASCII_CHAR_WIDTH(c) \
(c < 0x20 \
? (c == '\t' \
- ? XFASTINT (current_buffer->tab_width) \
- : (c == '\n' ? 0 : (NILP (current_buffer->ctl_arrow) ? 4 : 2))) \
+ ? XFASTINT (B_ (current_buffer, tab_width)) \
+ : (c == '\n' ? 0 : (NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2))) \
: (c < 0x7f \
? 1 \
- : ((NILP (current_buffer->ctl_arrow) ? 4 : 2))))
+ : ((NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2))))
/* Return the width of character C. The width is measured by how many
columns C will occupy on the screen when displayed in the current
diff --git a/src/charset.c b/src/charset.c
index 229f2c2cdae..80e6a114197 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1554,7 +1554,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
EMACS_INT from, from_byte, to, stop, stop_byte;
int i;
Lisp_Object val;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
validate_region (&beg, &end);
from = XFASTINT (beg);
diff --git a/src/cmds.c b/src/cmds.c
index 93b7e2b7651..e82ada6f03c 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -292,10 +292,10 @@ After insertion, the value of `auto-fill-function' is called if the
}
if (remove_boundary
- && CONSP (current_buffer->undo_list)
- && NILP (XCAR (current_buffer->undo_list)))
+ && CONSP (B_ (current_buffer, undo_list))
+ && NILP (XCAR (B_ (current_buffer, undo_list))))
/* Remove the undo_boundary that was just pushed. */
- current_buffer->undo_list = XCDR (current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = XCDR (B_ (current_buffer, undo_list));
/* Barf if the key that invoked this was not a character. */
if (!CHARACTERP (last_command_event))
@@ -335,12 +335,12 @@ internal_self_insert (int c, EMACS_INT n)
EMACS_INT chars_to_delete = 0;
EMACS_INT spaces_to_insert = 0;
- overwrite = current_buffer->overwrite_mode;
+ overwrite = B_ (current_buffer, overwrite_mode);
if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions))
hairy = 1;
/* At first, get multi-byte form of C in STR. */
- if (!NILP (current_buffer->enable_multibyte_characters))
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
{
len = CHAR_STRING (c, str);
if (len == 1)
@@ -416,11 +416,11 @@ internal_self_insert (int c, EMACS_INT n)
synt = SYNTAX (c);
- if (!NILP (current_buffer->abbrev_mode)
+ if (!NILP (B_ (current_buffer, abbrev_mode))
&& synt != Sword
- && NILP (current_buffer->read_only)
+ && NILP (B_ (current_buffer, read_only))
&& PT > BEGV
- && (SYNTAX (!NILP (current_buffer->enable_multibyte_characters)
+ && (SYNTAX (!NILP (B_ (current_buffer, enable_multibyte_characters))
? XFASTINT (Fprevious_char ())
: UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
== Sword))
@@ -448,7 +448,7 @@ internal_self_insert (int c, EMACS_INT n)
if (chars_to_delete)
{
- int mc = ((NILP (current_buffer->enable_multibyte_characters)
+ int mc = ((NILP (B_ (current_buffer, enable_multibyte_characters))
&& SINGLE_BYTE_CHAR_P (c))
? UNIBYTE_TO_CHAR (c) : c);
Lisp_Object string = Fmake_string (make_number (n), make_number (mc));
@@ -479,7 +479,7 @@ internal_self_insert (int c, EMACS_INT n)
if ((CHAR_TABLE_P (Vauto_fill_chars)
? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c))
: (c == ' ' || c == '\n'))
- && !NILP (current_buffer->auto_fill_function))
+ && !NILP (B_ (current_buffer, auto_fill_function)))
{
Lisp_Object tem;
@@ -488,7 +488,7 @@ internal_self_insert (int c, EMACS_INT n)
that. Must have the newline in place already so filling and
justification, if any, know where the end is going to be. */
SET_PT_BOTH (PT - 1, PT_BYTE - 1);
- tem = call0 (current_buffer->auto_fill_function);
+ tem = call0 (B_ (current_buffer, auto_fill_function));
/* Test PT < ZV in case the auto-fill-function is strange. */
if (c == '\n' && PT < ZV)
SET_PT_BOTH (PT + 1, PT_BYTE + 1);
diff --git a/src/coding.c b/src/coding.c
index a9f16de56f3..899cca6d5aa 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7038,8 +7038,8 @@ decode_coding (struct coding_system *coding)
set_buffer_internal (XBUFFER (coding->dst_object));
if (GPT != PT)
move_gap_both (PT, PT_BYTE);
- undo_list = current_buffer->undo_list;
- current_buffer->undo_list = Qt;
+ undo_list = B_ (current_buffer, undo_list);
+ B_ (current_buffer, undo_list) = Qt;
}
coding->consumed = coding->consumed_char = 0;
@@ -7136,7 +7136,7 @@ decode_coding (struct coding_system *coding)
decode_eol (coding);
if (BUFFERP (coding->dst_object))
{
- current_buffer->undo_list = undo_list;
+ B_ (current_buffer, undo_list) = undo_list;
record_insert (coding->dst_pos, coding->produced_char);
}
return coding->result;
@@ -7433,7 +7433,7 @@ encode_coding (struct coding_system *coding)
{
set_buffer_internal (XBUFFER (coding->dst_object));
coding->dst_multibyte
- = ! NILP (current_buffer->enable_multibyte_characters);
+ = ! NILP (B_ (current_buffer, enable_multibyte_characters));
}
coding->consumed = coding->consumed_char = 0;
@@ -7504,8 +7504,8 @@ make_conversion_work_buffer (int multibyte)
doesn't compile new regexps. */
Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt);
Ferase_buffer ();
- current_buffer->undo_list = Qt;
- current_buffer->enable_multibyte_characters = multibyte ? Qt : Qnil;
+ B_ (current_buffer, undo_list) = Qt;
+ B_ (current_buffer, enable_multibyte_characters) = multibyte ? Qt : Qnil;
set_buffer_internal (current);
return workbuf;
}
@@ -7562,7 +7562,7 @@ decode_coding_gap (struct coding_system *coding,
coding->dst_object = coding->src_object;
coding->dst_pos = PT;
coding->dst_pos_byte = PT_BYTE;
- coding->dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ coding->dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
if (CODING_REQUIRE_DETECTION (coding))
detect_coding (coding);
@@ -7728,7 +7728,7 @@ decode_coding_object (struct coding_system *coding,
coding->dst_pos = BUF_PT (XBUFFER (dst_object));
coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object));
coding->dst_multibyte
- = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters);
+ = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters));
}
else
{
@@ -7798,7 +7798,7 @@ decode_coding_object (struct coding_system *coding,
TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
else if (saved_pt < from + chars)
TEMP_SET_PT_BOTH (from, from_byte);
- else if (! NILP (current_buffer->enable_multibyte_characters))
+ else if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
saved_pt_byte + (coding->produced - bytes));
else
@@ -7822,7 +7822,7 @@ decode_coding_object (struct coding_system *coding,
{
tail->bytepos = from_byte + coding->produced;
tail->charpos
- = (NILP (current_buffer->enable_multibyte_characters)
+ = (NILP (B_ (current_buffer, enable_multibyte_characters))
? tail->bytepos : from + coding->produced_char);
}
}
@@ -7960,7 +7960,7 @@ encode_coding_object (struct coding_system *coding,
set_buffer_temp (current);
}
coding->dst_multibyte
- = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters);
+ = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters));
}
else if (EQ (dst_object, Qt))
{
@@ -8003,7 +8003,7 @@ encode_coding_object (struct coding_system *coding,
TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
else if (saved_pt < from + chars)
TEMP_SET_PT_BOTH (from, from_byte);
- else if (! NILP (current_buffer->enable_multibyte_characters))
+ else if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
saved_pt_byte + (coding->produced - bytes));
else
@@ -8027,7 +8027,7 @@ encode_coding_object (struct coding_system *coding,
{
tail->bytepos = from_byte + coding->produced;
tail->charpos
- = (NILP (current_buffer->enable_multibyte_characters)
+ = (NILP (B_ (current_buffer, enable_multibyte_characters))
? tail->bytepos : from + coding->produced_char);
}
}
@@ -8481,8 +8481,8 @@ highest priority. */)
return detect_coding_system (BYTE_POS_ADDR (from_byte),
to - from, to_byte - from_byte,
!NILP (highest),
- !NILP (current_buffer
- ->enable_multibyte_characters),
+ !NILP (B_ (current_buffer
+ , enable_multibyte_characters)),
Qnil);
}
@@ -8564,7 +8564,7 @@ DEFUN ("find-coding-systems-region-internal",
CHECK_NUMBER_COERCE_MARKER (end);
if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end))
args_out_of_range (start, end);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
return Qt;
start_byte = CHAR_TO_BYTE (XINT (start));
end_byte = CHAR_TO_BYTE (XINT (end));
@@ -8698,7 +8698,7 @@ to the string. */)
validate_region (&start, &end);
from = XINT (start);
to = XINT (end);
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
|| (ascii_compatible
&& (to - from) == (CHAR_TO_BYTE (to) - (CHAR_TO_BYTE (from)))))
return Qnil;
@@ -8814,7 +8814,7 @@ is nil. */)
CHECK_NUMBER_COERCE_MARKER (end);
if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end))
args_out_of_range (start, end);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
return Qnil;
start_byte = CHAR_TO_BYTE (XINT (start));
end_byte = CHAR_TO_BYTE (XINT (end));
diff --git a/src/composite.c b/src/composite.c
index 58bc68597cc..3c941ea6614 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
if (NILP (string))
{
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
error ("Attempt to shape unibyte text");
validate_region (&start, &end);
from = XFASTINT (start);
@@ -1028,7 +1028,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
cmp_it->stop_pos = endpos = start;
cmp_it->ch = -1;
}
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
|| NILP (Vauto_composition_mode))
return;
if (bytepos < 0)
@@ -1674,7 +1674,7 @@ composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt)
return new_pt;
}
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
|| NILP (Vauto_composition_mode))
return new_pt;
@@ -1851,7 +1851,7 @@ See `find-composition' for more details. */)
if (!find_composition (from, to, &start, &end, &prop, string))
{
- if (!NILP (current_buffer->enable_multibyte_characters)
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! NILP (Vauto_composition_mode)
&& find_automatic_composition (from, to, &start, &end, &gstring,
string))
diff --git a/src/data.c b/src/data.c
index 77cdbabb2d5..c0557d5c735 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_
}
else
{
- tem1 = assq_no_quit (var, current_buffer->local_var_alist);
+ tem1 = assq_no_quit (var, B_ (current_buffer, local_var_alist));
XSETBUFFER (blv->where, current_buffer);
}
}
@@ -1178,7 +1178,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
tem1 = Fassq (symbol,
(blv->frame_local
? XFRAME (where)->param_alist
- : XBUFFER (where)->local_var_alist));
+ : B_ (XBUFFER (where), local_var_alist)));
blv->where = where;
blv->found = 1;
@@ -1209,8 +1209,8 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
bindings, not for frame-local bindings. */
eassert (!blv->frame_local);
tem1 = Fcons (symbol, XCDR (blv->defcell));
- XBUFFER (where)->local_var_alist
- = Fcons (tem1, XBUFFER (where)->local_var_alist);
+ B_ (XBUFFER (where), local_var_alist)
+ = Fcons (tem1, B_ (XBUFFER (where), local_var_alist));
}
}
@@ -1632,13 +1632,13 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
if (let_shadows_global_binding_p (symbol))
message ("Making %s local to %s while let-bound!",
SDATA (SYMBOL_NAME (variable)),
- SDATA (current_buffer->name));
+ SDATA (B_ (current_buffer, name)));
}
}
/* Make sure this buffer has its own value of symbol. */
XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
- tem = Fassq (variable, current_buffer->local_var_alist);
+ tem = Fassq (variable, B_ (current_buffer, local_var_alist));
if (NILP (tem))
{
if (let_shadows_buffer_binding_p (sym))
@@ -1650,9 +1650,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
default value. */
find_symbol_value (variable);
- current_buffer->local_var_alist
+ B_ (current_buffer, local_var_alist)
= Fcons (Fcons (variable, XCDR (blv->defcell)),
- current_buffer->local_var_alist);
+ B_ (current_buffer, local_var_alist));
/* Make sure symbol does not think it is set up for this buffer;
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. */)
/* Get rid of this buffer's alist element, if any. */
XSETSYMBOL (variable, sym); /* Propagate variable indirection. */
- tem = Fassq (variable, current_buffer->local_var_alist);
+ tem = Fassq (variable, B_ (current_buffer, local_var_alist));
if (!NILP (tem))
- current_buffer->local_var_alist
- = Fdelq (tem, current_buffer->local_var_alist);
+ B_ (current_buffer, local_var_alist)
+ = Fdelq (tem, B_ (current_buffer, local_var_alist));
/* If the symbol is set up with the current buffer's binding
loaded, recompute its value. We have to do it now, or else
@@ -1848,7 +1848,7 @@ BUFFER defaults to the current buffer. */)
XSETBUFFER (tmp, buf);
XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
- for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail))
{
elt = XCAR (tail);
if (EQ (variable, XCAR (elt)))
diff --git a/src/dispextern.h b/src/dispextern.h
index 6d54ebefd84..e01c1a961f7 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1416,7 +1416,7 @@ struct glyph_string
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP ((W)->buffer) \
- && !NILP (XBUFFER ((W)->buffer)->mode_line_format) \
+ && !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format)) \
&& WINDOW_TOTAL_LINES (W) > 1)
/* Value is non-zero if window W wants a header line. */
@@ -1426,8 +1426,8 @@ struct glyph_string
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP ((W)->buffer) \
- && !NILP (XBUFFER ((W)->buffer)->header_line_format) \
- && WINDOW_TOTAL_LINES (W) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format))
+ && !NILP (B_ (XBUFFER ((W)->buffer), header_line_format)) \
+ && WINDOW_TOTAL_LINES (W) > 1 + !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format)))
/* Return proper value to be used as baseline offset of font that has
diff --git a/src/dispnew.c b/src/dispnew.c
index 1aef70f1a5d..2aa3d9208b3 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6129,7 +6129,7 @@ pass nil for VARIABLE. */)
{
buf = XCDR (XCAR (tail));
/* Ignore buffers that aren't included in buffer lists. */
- if (SREF (XBUFFER (buf)->name, 0) == ' ')
+ if (SREF (B_ (XBUFFER (buf), name), 0) == ' ')
continue;
if (vecp == end)
goto changed;
@@ -6137,7 +6137,7 @@ pass nil for VARIABLE. */)
goto changed;
if (vecp == end)
goto changed;
- if (!EQ (*vecp++, XBUFFER (buf)->read_only))
+ if (!EQ (*vecp++, B_ (XBUFFER (buf), read_only)))
goto changed;
if (vecp == end)
goto changed;
@@ -6184,10 +6184,10 @@ pass nil for VARIABLE. */)
{
buf = XCDR (XCAR (tail));
/* Ignore buffers that aren't included in buffer lists. */
- if (SREF (XBUFFER (buf)->name, 0) == ' ')
+ if (SREF (B_ (XBUFFER (buf), name), 0) == ' ')
continue;
*vecp++ = buf;
- *vecp++ = XBUFFER (buf)->read_only;
+ *vecp++ = B_ (XBUFFER (buf), read_only);
*vecp++ = Fbuffer_modified_p (buf);
}
/* Fill up the vector with lambdas (always at least one). */
diff --git a/src/editfns.c b/src/editfns.c
index 30acc36f025..a3de4907efc 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -306,10 +306,10 @@ region_limit (int beginningp)
if (!NILP (Vtransient_mark_mode)
&& NILP (Vmark_even_if_inactive)
- && NILP (current_buffer->mark_active))
+ && NILP (B_ (current_buffer, mark_active)))
xsignal0 (Qmark_inactive);
- m = Fmarker_position (current_buffer->mark);
+ m = Fmarker_position (B_ (current_buffer, mark));
if (NILP (m))
error ("The mark is not set now, so there is no region");
@@ -338,7 +338,7 @@ Watch out! Moving this marker changes the mark position.
If you set the marker not to point anywhere, the buffer will have no mark. */)
(void)
{
- return current_buffer->mark;
+ return B_ (current_buffer, mark);
}
@@ -866,9 +866,9 @@ save_excursion_save (void)
== current_buffer);
return Fcons (Fpoint_marker (),
- Fcons (Fcopy_marker (current_buffer->mark, Qnil),
+ Fcons (Fcopy_marker (B_ (current_buffer, mark), Qnil),
Fcons (visible ? Qt : Qnil,
- Fcons (current_buffer->mark_active,
+ Fcons (B_ (current_buffer, mark_active),
selected_window))));
}
@@ -900,8 +900,8 @@ save_excursion_restore (Lisp_Object info)
/* Mark marker. */
info = XCDR (info);
tem = XCAR (info);
- omark = Fmarker_position (current_buffer->mark);
- Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ());
+ omark = Fmarker_position (B_ (current_buffer, mark));
+ Fset_marker (B_ (current_buffer, mark), tem, Fcurrent_buffer ());
nmark = Fmarker_position (tem);
unchain_marker (XMARKER (tem));
@@ -922,14 +922,14 @@ save_excursion_restore (Lisp_Object info)
/* Mark active */
info = XCDR (info);
tem = XCAR (info);
- tem1 = current_buffer->mark_active;
- current_buffer->mark_active = tem;
+ tem1 = B_ (current_buffer, mark_active);
+ B_ (current_buffer, mark_active) = tem;
if (!NILP (Vrun_hooks))
{
/* If mark is active now, and either was not active
or was at a different place, run the activate hook. */
- if (! NILP (current_buffer->mark_active))
+ if (! NILP (B_ (current_buffer, mark_active)))
{
if (! EQ (omark, nmark))
call1 (Vrun_hooks, intern ("activate-mark-hook"));
@@ -1114,7 +1114,7 @@ At the beginning of the buffer or accessible region, return 0. */)
Lisp_Object temp;
if (PT <= BEGV)
XSETFASTINT (temp, 0);
- else if (!NILP (current_buffer->enable_multibyte_characters))
+ else if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
{
EMACS_INT pos = PT_BYTE;
DEC_POS (pos);
@@ -1228,7 +1228,7 @@ If POS is out of range, the value is nil. */)
pos_byte = CHAR_TO_BYTE (XINT (pos));
}
- if (!NILP (current_buffer->enable_multibyte_characters))
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
{
DEC_POS (pos_byte);
XSETFASTINT (val, FETCH_CHAR (pos_byte));
@@ -2135,7 +2135,7 @@ general_insert_function (void (*insert_func)
unsigned char str[MAX_MULTIBYTE_LENGTH];
int len;
- if (!NILP (current_buffer->enable_multibyte_characters))
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
len = CHAR_STRING (XFASTINT (val), str);
else
{
@@ -2267,7 +2267,7 @@ from adjoining text, if those properties are sticky. */)
CHECK_NUMBER (character);
CHECK_NUMBER (count);
- if (!NILP (current_buffer->enable_multibyte_characters))
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters)))
len = CHAR_STRING (XFASTINT (character), str);
else
str[0] = XFASTINT (character), len = 1;
@@ -2316,7 +2316,7 @@ from adjoining text, if those properties are sticky. */)
if (XINT (byte) < 0 || XINT (byte) > 255)
args_out_of_range_3 (byte, make_number (0), make_number (255));
if (XINT (byte) >= 128
- && ! NILP (current_buffer->enable_multibyte_characters))
+ && ! NILP (B_ (current_buffer, enable_multibyte_characters)))
XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte)));
return Finsert_char (byte, count, inherit);
}
@@ -2370,7 +2370,7 @@ make_buffer_string_both (EMACS_INT start, EMACS_INT start_byte,
if (start < GPT && GPT < end)
move_gap (start);
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
result = make_uninit_multibyte_string (end - start, end_byte - start_byte);
else
result = make_uninit_string (end - start);
@@ -2485,7 +2485,7 @@ They default to the values of (point-min) and (point-max) in BUFFER. */)
if (NILP (buf))
nsberror (buffer);
bp = XBUFFER (buf);
- if (NILP (bp->name))
+ if (NILP (B_ (bp, name)))
error ("Selecting deleted buffer");
if (NILP (start))
@@ -2533,8 +2533,8 @@ determines whether case is significant or ignored. */)
register EMACS_INT begp1, endp1, begp2, endp2, temp;
register struct buffer *bp1, *bp2;
register Lisp_Object trt
- = (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_canon_table : Qnil);
+ = (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_canon_table) : Qnil);
EMACS_INT chars = 0;
EMACS_INT i1, i2, i1_byte, i2_byte;
@@ -2549,7 +2549,7 @@ determines whether case is significant or ignored. */)
if (NILP (buf1))
nsberror (buffer1);
bp1 = XBUFFER (buf1);
- if (NILP (bp1->name))
+ if (NILP (B_ (bp1, name)))
error ("Selecting deleted buffer");
}
@@ -2587,7 +2587,7 @@ determines whether case is significant or ignored. */)
if (NILP (buf2))
nsberror (buffer2);
bp2 = XBUFFER (buf2);
- if (NILP (bp2->name))
+ if (NILP (B_ (bp2, name)))
error ("Selecting deleted buffer");
}
@@ -2627,7 +2627,7 @@ determines whether case is significant or ignored. */)
QUIT;
- if (! NILP (bp1->enable_multibyte_characters))
+ if (! NILP (B_ (bp1, enable_multibyte_characters)))
{
c1 = BUF_FETCH_MULTIBYTE_CHAR (bp1, i1_byte);
BUF_INC_POS (bp1, i1_byte);
@@ -2640,7 +2640,7 @@ determines whether case is significant or ignored. */)
i1++;
}
- if (! NILP (bp2->enable_multibyte_characters))
+ if (! NILP (B_ (bp2, enable_multibyte_characters)))
{
c2 = BUF_FETCH_MULTIBYTE_CHAR (bp2, i2_byte);
BUF_INC_POS (bp2, i2_byte);
@@ -2680,13 +2680,13 @@ determines whether case is significant or ignored. */)
static Lisp_Object
subst_char_in_region_unwind (Lisp_Object arg)
{
- return current_buffer->undo_list = arg;
+ return B_ (current_buffer, undo_list) = arg;
}
static Lisp_Object
subst_char_in_region_unwind_1 (Lisp_Object arg)
{
- return current_buffer->filename = arg;
+ return B_ (current_buffer, filename) = arg;
}
DEFUN ("subst-char-in-region", Fsubst_char_in_region,
@@ -2712,7 +2712,7 @@ Both characters must have the same length of multi-byte form. */)
#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER)
int maybe_byte_combining = COMBINING_NO;
EMACS_INT last_changed = 0;
- int multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters));
restart:
@@ -2756,12 +2756,12 @@ Both characters must have the same length of multi-byte form. */)
if (!changed && !NILP (noundo))
{
record_unwind_protect (subst_char_in_region_unwind,
- current_buffer->undo_list);
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, undo_list));
+ B_ (current_buffer, undo_list) = Qt;
/* Don't do file-locking. */
record_unwind_protect (subst_char_in_region_unwind_1,
- current_buffer->filename);
- current_buffer->filename = Qnil;
+ B_ (current_buffer, filename));
+ B_ (current_buffer, filename) = Qnil;
}
if (pos_byte < GPT_BYTE)
@@ -2824,7 +2824,7 @@ Both characters must have the same length of multi-byte form. */)
struct gcpro gcpro1;
- tem = current_buffer->undo_list;
+ tem = B_ (current_buffer, undo_list);
GCPRO1 (tem);
/* Make a multibyte string containing this single character. */
@@ -2843,7 +2843,7 @@ Both characters must have the same length of multi-byte form. */)
INC_POS (pos_byte_next);
if (! NILP (noundo))
- current_buffer->undo_list = tem;
+ B_ (current_buffer, undo_list) = tem;
UNGCPRO;
}
@@ -2945,7 +2945,7 @@ It returns the number of characters changed. */)
int cnt; /* Number of changes made. */
EMACS_INT size; /* Size of translate table. */
EMACS_INT pos, pos_byte, end_pos;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
int string_multibyte;
Lisp_Object val;
@@ -3206,7 +3206,7 @@ save_restriction_restore (Lisp_Object data)
? XMARKER (XCAR (data))->buffer
: XBUFFER (data));
- if (buf && buf != current_buffer && !NILP (buf->pt_marker))
+ if (buf && buf != current_buffer && !NILP (B_ (buf, pt_marker)))
{ /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as
is the case if it is or has an indirect buffer), then make
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. */)
if (XINT (c1) == XINT (c2))
return Qt;
- if (NILP (current_buffer->case_fold_search))
+ if (NILP (B_ (current_buffer, case_fold_search)))
return Qnil;
/* Do these in separate statements,
then compare the variables.
because of the way DOWNCASE uses temp variables. */
i1 = XFASTINT (c1);
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! ASCII_CHAR_P (i1))
{
MAKE_CHAR_MULTIBYTE (i1);
}
i2 = XFASTINT (c2);
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! ASCII_CHAR_P (i2))
{
MAKE_CHAR_MULTIBYTE (i2);
diff --git a/src/fileio.c b/src/fileio.c
index 429fce9f5a0..afef7888b78 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -770,7 +770,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
/* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */
if (NILP (default_directory))
- default_directory = current_buffer->directory;
+ default_directory = B_ (current_buffer, directory);
if (! STRINGP (default_directory))
{
#ifdef DOS_NT
@@ -2669,7 +2669,7 @@ See `file-symlink-p' to distinguish symlinks. */)
struct stat st;
Lisp_Object handler;
- absname = expand_and_dir_to_file (filename, current_buffer->directory);
+ absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
@@ -2722,7 +2722,7 @@ See `file-symlink-p' to distinguish symlinks. */)
struct stat st;
Lisp_Object handler;
- absname = expand_and_dir_to_file (filename, current_buffer->directory);
+ absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
@@ -2769,7 +2769,7 @@ if file does not exist, is not accessible, or SELinux is disabled */)
context_t context;
#endif
- absname = expand_and_dir_to_file (filename, current_buffer->directory);
+ absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
@@ -2827,7 +2827,7 @@ is disabled. */)
context_t parsed_con;
#endif
- absname = Fexpand_file_name (filename, current_buffer->directory);
+ absname = Fexpand_file_name (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
@@ -2894,7 +2894,7 @@ Return nil, if file does not exist or is not accessible. */)
struct stat st;
Lisp_Object handler;
- absname = expand_and_dir_to_file (filename, current_buffer->directory);
+ absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
@@ -2923,7 +2923,7 @@ symbolic notation, like the `chmod' command from GNU Coreutils. */)
Lisp_Object absname, encoded_absname;
Lisp_Object handler;
- absname = Fexpand_file_name (filename, current_buffer->directory);
+ absname = Fexpand_file_name (filename, B_ (current_buffer, directory));
CHECK_NUMBER (mode);
/* 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
if (! lisp_time_argument (time, &sec, &usec))
error ("Invalid time specification");
- absname = Fexpand_file_name (filename, current_buffer->directory);
+ absname = Fexpand_file_name (filename, B_ (current_buffer, directory));
/* If the file name has special constructs in it,
call the corresponding file handler. */
@@ -3047,8 +3047,8 @@ otherwise, if FILE2 does not exist, the answer is t. */)
absname1 = Qnil;
GCPRO2 (absname1, file2);
- absname1 = expand_and_dir_to_file (file1, current_buffer->directory);
- absname2 = expand_and_dir_to_file (file2, current_buffer->directory);
+ absname1 = expand_and_dir_to_file (file1, B_ (current_buffer, directory));
+ absname2 = expand_and_dir_to_file (file2, B_ (current_buffer, directory));
UNGCPRO;
/* If the file name has special constructs in it,
@@ -3116,8 +3116,8 @@ decide_coding_unwind (Lisp_Object unwind_data)
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
/* Now we are safe to change the buffer's multibyteness directly. */
- current_buffer->enable_multibyte_characters = multibyte;
- current_buffer->undo_list = undo_list;
+ B_ (current_buffer, enable_multibyte_characters) = multibyte;
+ B_ (current_buffer, undo_list) = undo_list;
return Qnil;
}
@@ -3212,7 +3212,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (current_buffer->base_buffer && ! NILP (visit))
error ("Cannot do file visiting in an indirect buffer");
- if (!NILP (current_buffer->read_only))
+ if (!NILP (B_ (current_buffer, read_only)))
Fbarf_if_buffer_read_only ();
val = Qnil;
@@ -3403,16 +3403,16 @@ variable `last-coding-system-used' to the coding system actually used. */)
buf = XBUFFER (buffer);
delete_all_overlays (buf);
- buf->directory = current_buffer->directory;
- buf->read_only = Qnil;
- buf->filename = Qnil;
- buf->undo_list = Qt;
+ B_ (buf, directory) = B_ (current_buffer, directory);
+ B_ (buf, read_only) = Qnil;
+ B_ (buf, filename) = Qnil;
+ B_ (buf, undo_list) = Qt;
eassert (buf->overlays_before == NULL);
eassert (buf->overlays_after == NULL);
set_buffer_internal (buf);
Ferase_buffer ();
- buf->enable_multibyte_characters = Qnil;
+ B_ (buf, enable_multibyte_characters) = Qnil;
insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0);
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
@@ -3450,7 +3450,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
else
CHECK_CODING_SYSTEM (coding_system);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
/* We must suppress all character code conversion except for
end-of-line conversion. */
coding_system = raw_text_coding_system (coding_system);
@@ -3598,7 +3598,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
we cannot use this method; giveup and try the other. */
if (same_at_end > same_at_start
&& FETCH_BYTE (same_at_end - 1) >= 0200
- && ! NILP (current_buffer->enable_multibyte_characters)
+ && ! NILP (B_ (current_buffer, enable_multibyte_characters))
&& (CODING_MAY_REQUIRE_DECODING (&coding)))
giveup_match_end = 1;
break;
@@ -3617,14 +3617,14 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* Extend the start of non-matching text area to multibyte
character boundary. */
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
while (same_at_start > BEGV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_start)))
same_at_start--;
/* Extend the end of non-matching text area to multibyte
character boundary. */
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
while (same_at_end < ZV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_end)))
same_at_end++;
@@ -3673,7 +3673,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
unsigned char *decoded;
EMACS_INT temp;
int this_count = SPECPDL_INDEX ();
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
Lisp_Object conversion_buffer;
conversion_buffer = code_conversion_save (1, multibyte);
@@ -3778,7 +3778,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* Extend the start of non-matching text area to the previous
multibyte character boundary. */
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
while (same_at_start > BEGV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_start)))
same_at_start--;
@@ -3795,7 +3795,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* Extend the end of non-matching text area to the next
multibyte character boundary. */
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
while (same_at_end < ZV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_end)))
same_at_end++;
@@ -3870,9 +3870,9 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (NILP (visit) && inserted > 0)
{
#ifdef CLASH_DETECTION
- if (!NILP (current_buffer->file_truename)
+ if (!NILP (B_ (current_buffer, file_truename))
/* Make binding buffer-file-name to nil effective. */
- && !NILP (current_buffer->filename)
+ && !NILP (B_ (current_buffer, filename))
&& SAVE_MODIFF >= MODIFF)
we_locked_file = 1;
#endif /* CLASH_DETECTION */
@@ -3977,7 +3977,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
{
#ifdef CLASH_DETECTION
if (we_locked_file)
- unlock_file (current_buffer->file_truename);
+ unlock_file (B_ (current_buffer, file_truename));
#endif
Vdeactivate_mark = old_Vdeactivate_mark;
}
@@ -4028,11 +4028,11 @@ variable `last-coding-system-used' to the coding system actually used. */)
Lisp_Object unwind_data;
int count = SPECPDL_INDEX ();
- unwind_data = Fcons (current_buffer->enable_multibyte_characters,
- Fcons (current_buffer->undo_list,
+ unwind_data = Fcons (B_ (current_buffer, enable_multibyte_characters),
+ Fcons (B_ (current_buffer, undo_list),
Fcurrent_buffer ()));
- current_buffer->enable_multibyte_characters = Qnil;
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, enable_multibyte_characters) = Qnil;
+ B_ (current_buffer, undo_list) = Qt;
record_unwind_protect (decide_coding_unwind, unwind_data);
if (inserted > 0 && ! NILP (Vset_auto_coding_function))
@@ -4062,7 +4062,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
else
CHECK_CODING_SYSTEM (coding_system);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
/* We must suppress all character code conversion except for
end-of-line conversion. */
coding_system = raw_text_coding_system (coding_system);
@@ -4080,10 +4080,10 @@ variable `last-coding-system-used' to the coding system actually used. */)
&& NILP (replace))
/* Visiting a file with these coding system makes the buffer
unibyte. */
- current_buffer->enable_multibyte_characters = Qnil;
+ B_ (current_buffer, enable_multibyte_characters) = Qnil;
}
- coding.dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ coding.dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
if (CODING_MAY_REQUIRE_DECODING (&coding)
&& (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding)))
{
@@ -4124,24 +4124,24 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (!NILP (visit))
{
- if (!EQ (current_buffer->undo_list, Qt) && !nochange)
- current_buffer->undo_list = Qnil;
+ if (!EQ (B_ (current_buffer, undo_list), Qt) && !nochange)
+ B_ (current_buffer, undo_list) = Qnil;
if (NILP (handler))
{
current_buffer->modtime = st.st_mtime;
current_buffer->modtime_size = st.st_size;
- current_buffer->filename = orig_filename;
+ B_ (current_buffer, filename) = orig_filename;
}
SAVE_MODIFF = MODIFF;
BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
- XSETFASTINT (current_buffer->save_length, Z - BEG);
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
#ifdef CLASH_DETECTION
if (NILP (handler))
{
- if (!NILP (current_buffer->file_truename))
- unlock_file (current_buffer->file_truename);
+ if (!NILP (B_ (current_buffer, file_truename)))
+ unlock_file (B_ (current_buffer, file_truename));
unlock_file (filename);
}
#endif /* CLASH_DETECTION */
@@ -4174,8 +4174,8 @@ variable `last-coding-system-used' to the coding system actually used. */)
specbind (Qinhibit_modification_hooks, Qt);
/* Save old undo list and don't record undo for decoding. */
- old_undo = current_buffer->undo_list;
- current_buffer->undo_list = Qt;
+ old_undo = B_ (current_buffer, undo_list);
+ B_ (current_buffer, undo_list) = Qt;
if (NILP (replace))
{
@@ -4263,7 +4263,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (NILP (visit))
{
- current_buffer->undo_list = old_undo;
+ B_ (current_buffer, undo_list) = old_undo;
if (CONSP (old_undo) && inserted != old_inserted)
{
/* Adjust the last undo record for the size change during
@@ -4278,7 +4278,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
else
/* If undo_list was Qt before, keep it that way.
Otherwise start with an empty undo_list. */
- current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil;
+ B_ (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil;
unbind_to (count, Qnil);
}
@@ -4332,8 +4332,8 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
Lisp_Object eol_parent = Qnil;
if (auto_saving
- && NILP (Fstring_equal (current_buffer->filename,
- current_buffer->auto_save_file_name)))
+ && NILP (Fstring_equal (B_ (current_buffer, filename),
+ B_ (current_buffer, auto_save_file_name))))
{
val = Qutf_8_emacs;
eol_parent = Qunix;
@@ -4362,12 +4362,12 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
int using_default_coding = 0;
int force_raw_text = 0;
- val = current_buffer->buffer_file_coding_system;
+ val = B_ (current_buffer, buffer_file_coding_system);
if (NILP (val)
|| NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil)))
{
val = Qnil;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
force_raw_text = 1;
}
@@ -4388,7 +4388,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
{
/* If we still have not decided a coding system, use the
default value of buffer-file-coding-system. */
- val = current_buffer->buffer_file_coding_system;
+ val = B_ (current_buffer, buffer_file_coding_system);
using_default_coding = 1;
}
@@ -4412,9 +4412,9 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
format, we use that of
`default-buffer-file-coding-system'. */
if (! using_default_coding
- && ! NILP (buffer_defaults.buffer_file_coding_system))
+ && ! NILP (B_ (&buffer_defaults, buffer_file_coding_system)))
val = (coding_inherit_eol_type
- (val, buffer_defaults.buffer_file_coding_system));
+ (val, B_ (&buffer_defaults, buffer_file_coding_system)));
/* If we decide not to encode text, use `raw-text' or one of its
subsidiaries. */
@@ -4425,7 +4425,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
val = coding_inherit_eol_type (val, eol_parent);
setup_coding_system (val, coding);
- if (!STRINGP (start) && !NILP (current_buffer->selective_display))
+ if (!STRINGP (start) && !NILP (B_ (current_buffer, selective_display)))
coding->mode |= CODING_MODE_SELECTIVE_DISPLAY;
return val;
}
@@ -4529,8 +4529,8 @@ This calls `write-region-annotate-functions' at the start, and
if (visiting)
{
SAVE_MODIFF = MODIFF;
- XSETFASTINT (current_buffer->save_length, Z - BEG);
- current_buffer->filename = visit_file;
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
+ B_ (current_buffer, filename) = visit_file;
}
UNGCPRO;
return val;
@@ -4743,15 +4743,15 @@ This calls `write-region-annotate-functions' at the start, and
if (visiting)
{
SAVE_MODIFF = MODIFF;
- XSETFASTINT (current_buffer->save_length, Z - BEG);
- current_buffer->filename = visit_file;
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
+ B_ (current_buffer, filename) = visit_file;
update_mode_lines++;
}
else if (quietly)
{
if (auto_saving
- && ! NILP (Fstring_equal (current_buffer->filename,
- current_buffer->auto_save_file_name)))
+ && ! NILP (Fstring_equal (B_ (current_buffer, filename),
+ B_ (current_buffer, auto_save_file_name))))
SAVE_MODIFF = MODIFF;
return Qnil;
@@ -4833,10 +4833,10 @@ build_annotations (Lisp_Object start, Lisp_Object end)
}
/* Now do the same for annotation functions implied by the file-format */
- if (auto_saving && (!EQ (current_buffer->auto_save_file_format, Qt)))
- p = current_buffer->auto_save_file_format;
+ if (auto_saving && (!EQ (B_ (current_buffer, auto_save_file_format), Qt)))
+ p = B_ (current_buffer, auto_save_file_format);
else
- p = current_buffer->file_format;
+ p = B_ (current_buffer, file_format);
for (i = 0; CONSP (p); p = XCDR (p), ++i)
{
struct buffer *given_buffer = current_buffer;
@@ -5015,17 +5015,17 @@ See Info node `(elisp)Modification Time' for more details. */)
b = XBUFFER (buf);
}
- if (!STRINGP (b->filename)) return Qt;
+ if (!STRINGP (B_ (b, filename))) return Qt;
if (b->modtime == 0) return Qt;
/* If the file name has special constructs in it,
call the corresponding file handler. */
- handler = Ffind_file_name_handler (b->filename,
+ handler = Ffind_file_name_handler (B_ (b, filename),
Qverify_visited_file_modtime);
if (!NILP (handler))
return call2 (handler, Qverify_visited_file_modtime, buf);
- filename = ENCODE_FILE (b->filename);
+ filename = ENCODE_FILE (B_ (b, filename));
if (stat (SSDATA (filename), &st) < 0)
{
@@ -5093,7 +5093,7 @@ An argument specifies the modification time value to use
struct stat st;
Lisp_Object handler;
- filename = Fexpand_file_name (current_buffer->filename, Qnil);
+ filename = Fexpand_file_name (B_ (current_buffer, filename), Qnil);
/* If the file name has special constructs in it,
call the corresponding file handler. */
@@ -5128,7 +5128,7 @@ auto_save_error (Lisp_Object error)
ring_bell (XFRAME (selected_frame));
args[0] = build_string ("Auto-saving %s: %s");
- args[1] = current_buffer->name;
+ args[1] = B_ (current_buffer, name);
args[2] = Ferror_message_string (error);
msg = Fformat (3, args);
GCPRO1 (msg);
@@ -5159,19 +5159,19 @@ auto_save_1 (void)
auto_save_mode_bits = 0666;
/* Get visited file's mode to become the auto save file's mode. */
- if (! NILP (current_buffer->filename))
+ if (! NILP (B_ (current_buffer, filename)))
{
- if (stat (SSDATA (current_buffer->filename), &st) >= 0)
+ if (stat (SSDATA (B_ (current_buffer, filename)), &st) >= 0)
/* But make sure we can overwrite it later! */
auto_save_mode_bits = st.st_mode | 0600;
- else if ((modes = Ffile_modes (current_buffer->filename),
+ else if ((modes = Ffile_modes (B_ (current_buffer, filename)),
INTEGERP (modes)))
/* Remote files don't cooperate with stat. */
auto_save_mode_bits = XINT (modes) | 0600;
}
return
- Fwrite_region (Qnil, Qnil, current_buffer->auto_save_file_name, Qnil,
+ Fwrite_region (Qnil, Qnil, B_ (current_buffer, auto_save_file_name), Qnil,
NILP (Vauto_save_visited_file_name) ? Qlambda : Qt,
Qnil, Qnil);
}
@@ -5312,18 +5312,18 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
/* Record all the buffers that have auto save mode
in the special file that lists them. For each of these buffers,
Record visited name (if any) and auto save name. */
- if (STRINGP (b->auto_save_file_name)
+ if (STRINGP (B_ (b, auto_save_file_name))
&& stream != NULL && do_handled_files == 0)
{
BLOCK_INPUT;
- if (!NILP (b->filename))
+ if (!NILP (B_ (b, filename)))
{
- fwrite (SDATA (b->filename), 1,
- SBYTES (b->filename), stream);
+ fwrite (SDATA (B_ (b, filename)), 1,
+ SBYTES (B_ (b, filename)), stream);
}
putc ('\n', stream);
- fwrite (SDATA (b->auto_save_file_name), 1,
- SBYTES (b->auto_save_file_name), stream);
+ fwrite (SDATA (B_ (b, auto_save_file_name)), 1,
+ SBYTES (B_ (b, auto_save_file_name)), stream);
putc ('\n', stream);
UNBLOCK_INPUT;
}
@@ -5340,13 +5340,13 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
/* Check for auto save enabled
and file changed since last auto save
and file changed since last real save. */
- if (STRINGP (b->auto_save_file_name)
+ if (STRINGP (B_ (b, auto_save_file_name))
&& BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
&& BUF_AUTOSAVE_MODIFF (b) < BUF_MODIFF (b)
/* -1 means we've turned off autosaving for a while--see below. */
- && XINT (b->save_length) >= 0
+ && XINT (B_ (b, save_length)) >= 0
&& (do_handled_files
- || NILP (Ffind_file_name_handler (b->auto_save_file_name,
+ || NILP (Ffind_file_name_handler (B_ (b, auto_save_file_name),
Qwrite_region))))
{
EMACS_TIME before_time, after_time;
@@ -5360,23 +5360,23 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
set_buffer_internal (b);
if (NILP (Vauto_save_include_big_deletions)
- && (XFASTINT (b->save_length) * 10
+ && (XFASTINT (B_ (b, save_length)) * 10
> (BUF_Z (b) - BUF_BEG (b)) * 13)
/* A short file is likely to change a large fraction;
spare the user annoying messages. */
- && XFASTINT (b->save_length) > 5000
+ && XFASTINT (B_ (b, save_length)) > 5000
/* These messages are frequent and annoying for `*mail*'. */
- && !EQ (b->filename, Qnil)
+ && !EQ (B_ (b, filename), Qnil)
&& NILP (no_message))
{
/* It has shrunk too much; turn off auto-saving here. */
minibuffer_auto_raise = orig_minibuffer_auto_raise;
message_with_string ("Buffer %s has shrunk a lot; auto save disabled in that buffer until next real save",
- b->name, 1);
+ B_ (b, name), 1);
minibuffer_auto_raise = 0;
/* Turn off auto-saving until there's a real save,
and prevent any more warnings. */
- XSETINT (b->save_length, -1);
+ XSETINT (B_ (b, save_length), -1);
Fsleep_for (make_number (1), Qnil);
continue;
}
@@ -5385,7 +5385,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
internal_condition_case (auto_save_1, Qt, auto_save_error);
auto_saved++;
BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b);
- XSETFASTINT (current_buffer->save_length, Z - BEG);
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
set_buffer_internal (old);
EMACS_GET_TIME (after_time);
@@ -5432,7 +5432,7 @@ No auto-save file will be written until the buffer changes again. */)
/* FIXME: This should not be called in indirect buffers, since
they're not autosaved. */
BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
- XSETFASTINT (current_buffer->save_length, Z - BEG);
+ XSETFASTINT (B_ (current_buffer, save_length), Z - BEG);
current_buffer->auto_save_failure_time = -1;
return Qnil;
}
diff --git a/src/filelock.c b/src/filelock.c
index 8fa871f56ef..6802880c985 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -637,9 +637,9 @@ unlock_all_files (void)
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
b = XBUFFER (XCDR (XCAR (tail)));
- if (STRINGP (b->file_truename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
+ if (STRINGP (B_ (b, file_truename)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
{
- unlock_file(b->file_truename);
+ unlock_file(B_ (b, file_truename));
}
}
}
@@ -652,7 +652,7 @@ or else nothing is done if current buffer isn't visiting a file. */)
(Lisp_Object file)
{
if (NILP (file))
- file = current_buffer->file_truename;
+ file = B_ (current_buffer, file_truename);
else
CHECK_STRING (file);
if (SAVE_MODIFF < MODIFF
@@ -669,8 +669,8 @@ should not be locked in that case. */)
(void)
{
if (SAVE_MODIFF < MODIFF
- && STRINGP (current_buffer->file_truename))
- unlock_file (current_buffer->file_truename);
+ && STRINGP (B_ (current_buffer, file_truename)))
+ unlock_file (B_ (current_buffer, file_truename));
return Qnil;
}
@@ -680,8 +680,8 @@ void
unlock_buffer (struct buffer *buffer)
{
if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer)
- && STRINGP (buffer->file_truename))
- unlock_file (buffer->file_truename);
+ && STRINGP (B_ (buffer, file_truename)))
+ unlock_file (B_ (buffer, file_truename));
}
DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0,
diff --git a/src/fns.c b/src/fns.c
index e7f0bcc1218..a9632914d67 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2984,7 +2984,7 @@ into shorter lines. */)
SAFE_ALLOCA (encoded, char *, allength);
encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg),
encoded, length, NILP (no_line_break),
- !NILP (current_buffer->enable_multibyte_characters));
+ !NILP (B_ (current_buffer, enable_multibyte_characters)));
if (encoded_length > allength)
abort ();
@@ -3166,7 +3166,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
EMACS_INT old_pos = PT;
EMACS_INT decoded_length;
EMACS_INT inserted_chars;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
USE_SAFE_ALLOCA;
validate_region (&beg, &end);
@@ -4684,12 +4684,12 @@ guesswork fails. Normally, an error is signaled in such case. */)
{
int force_raw_text = 0;
- coding_system = XBUFFER (object)->buffer_file_coding_system;
+ coding_system = B_ (XBUFFER (object), buffer_file_coding_system);
if (NILP (coding_system)
|| NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil)))
{
coding_system = Qnil;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
force_raw_text = 1;
}
@@ -4706,11 +4706,11 @@ guesswork fails. Normally, an error is signaled in such case. */)
}
if (NILP (coding_system)
- && !NILP (XBUFFER (object)->buffer_file_coding_system))
+ && !NILP (B_ (XBUFFER (object), buffer_file_coding_system)))
{
/* If we still have not decided a coding system, use the
default value of buffer-file-coding-system. */
- coding_system = XBUFFER (object)->buffer_file_coding_system;
+ coding_system = B_ (XBUFFER (object), buffer_file_coding_system);
}
if (!force_raw_text
diff --git a/src/font.c b/src/font.c
index 841125a0587..d67e8465b6a 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,
Lisp_Object font_object;
multibyte = (NILP (string)
- ? ! NILP (current_buffer->enable_multibyte_characters)
+ ? ! NILP (B_ (current_buffer, enable_multibyte_characters))
: STRING_MULTIBYTE (string));
if (c < 0)
{
diff --git a/src/frame.c b/src/frame.c
index 20bad4cb8c5..ac223ac4da0 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1817,7 +1817,7 @@ make_frame_visible_1 (Lisp_Object window)
w = XWINDOW (window);
if (!NILP (w->buffer))
- XBUFFER (w->buffer)->display_time = Fcurrent_time ();
+ B_ (XBUFFER (w->buffer), display_time) = Fcurrent_time ();
if (!NILP (w->vchild))
make_frame_visible_1 (w->vchild);
diff --git a/src/fringe.c b/src/fringe.c
index 5c9088a924c..5b7f8833069 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -660,7 +660,7 @@ get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor)
{
Lisp_Object cmap, bm = Qnil;
- if ((cmap = XBUFFER (w->buffer)->fringe_cursor_alist), !NILP (cmap))
+ if ((cmap = B_ (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap))
{
bm = Fassq (cursor, cmap);
if (CONSP (bm))
@@ -670,9 +670,9 @@ get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor)
return lookup_fringe_bitmap (bm);
}
}
- if (EQ (cmap, buffer_defaults.fringe_cursor_alist))
+ if (EQ (cmap, B_ (&buffer_defaults, fringe_cursor_alist)))
return NO_FRINGE_BITMAP;
- bm = Fassq (cursor, buffer_defaults.fringe_cursor_alist);
+ bm = Fassq (cursor, B_ (&buffer_defaults, fringe_cursor_alist));
if (!CONSP (bm) || ((bm = XCDR (bm)), NILP (bm)))
return NO_FRINGE_BITMAP;
return lookup_fringe_bitmap (bm);
@@ -697,7 +697,7 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in
If partial, lookup partial bitmap in default value if not found here.
If not partial, or no partial spec is present, use non-partial bitmap. */
- if ((cmap = XBUFFER (w->buffer)->fringe_indicator_alist), !NILP (cmap))
+ if ((cmap = B_ (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap))
{
bm1 = Fassq (bitmap, cmap);
if (CONSP (bm1))
@@ -731,10 +731,10 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in
}
}
- if (!EQ (cmap, buffer_defaults.fringe_indicator_alist)
- && !NILP (buffer_defaults.fringe_indicator_alist))
+ if (!EQ (cmap, B_ (&buffer_defaults, fringe_indicator_alist))
+ && !NILP (B_ (&buffer_defaults, fringe_indicator_alist)))
{
- bm2 = Fassq (bitmap, buffer_defaults.fringe_indicator_alist);
+ bm2 = Fassq (bitmap, B_ (&buffer_defaults, fringe_indicator_alist));
if (CONSP (bm2))
{
if ((bm2 = XCDR (bm2)), !NILP (bm2))
@@ -919,7 +919,7 @@ update_window_fringes (struct window *w, int keep_current_p)
return 0;
if (!MINI_WINDOW_P (w)
- && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind)))
+ && (ind = B_ (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind)))
{
if (EQ (ind, Qleft) || EQ (ind, Qright))
boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
@@ -988,7 +988,7 @@ update_window_fringes (struct window *w, int keep_current_p)
}
}
- empty_pos = XBUFFER (w->buffer)->indicate_empty_lines;
+ empty_pos = B_ (XBUFFER (w->buffer), indicate_empty_lines);
if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
diff --git a/src/indent.c b/src/indent.c
index 84ce140c5ba..b0195b3dec8 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -70,7 +70,7 @@ buffer_display_table (void)
{
Lisp_Object thisbuf;
- thisbuf = current_buffer->display_table;
+ thisbuf = B_ (current_buffer, display_table);
if (DISP_TABLE_P (thisbuf))
return XCHAR_TABLE (thisbuf);
if (DISP_TABLE_P (Vstandard_display_table))
@@ -140,9 +140,9 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
int i;
struct Lisp_Vector *widthtab;
- if (!VECTORP (buf->width_table))
- buf->width_table = Fmake_vector (make_number (256), make_number (0));
- widthtab = XVECTOR (buf->width_table);
+ if (!VECTORP (B_ (buf, width_table)))
+ B_ (buf, width_table) = Fmake_vector (make_number (256), make_number (0));
+ widthtab = XVECTOR (B_ (buf, width_table));
if (widthtab->size != 256)
abort ();
@@ -156,17 +156,17 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
static void
width_run_cache_on_off (void)
{
- if (NILP (current_buffer->cache_long_line_scans)
+ if (NILP (B_ (current_buffer, cache_long_line_scans))
/* And, for the moment, this feature doesn't work on multibyte
characters. */
- || !NILP (current_buffer->enable_multibyte_characters))
+ || !NILP (B_ (current_buffer, enable_multibyte_characters)))
{
/* It should be off. */
if (current_buffer->width_run_cache)
{
free_region_cache (current_buffer->width_run_cache);
current_buffer->width_run_cache = 0;
- current_buffer->width_table = Qnil;
+ B_ (current_buffer, width_table) = Qnil;
}
}
else
@@ -329,8 +329,8 @@ current_column (void)
register int tab_seen;
int post_tab;
register int c;
- register int tab_width = XINT (current_buffer->tab_width);
- int ctl_arrow = !NILP (current_buffer->ctl_arrow);
+ register int tab_width = XINT (B_ (current_buffer, tab_width));
+ int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow));
register struct Lisp_Char_Table *dp = buffer_display_table ();
if (PT == last_known_column_point
@@ -417,7 +417,7 @@ current_column (void)
col++;
else if (c == '\n'
|| (c == '\r'
- && EQ (current_buffer->selective_display, Qt)))
+ && EQ (B_ (current_buffer, selective_display), Qt)))
{
ptr++;
goto start_of_line_found;
@@ -512,10 +512,10 @@ check_display_width (EMACS_INT pos, EMACS_INT col, EMACS_INT *endpos)
static void
scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
{
- register EMACS_INT tab_width = XINT (current_buffer->tab_width);
- register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
+ register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width));
+ register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow));
register struct Lisp_Char_Table *dp = buffer_display_table ();
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
struct composition_it cmp_it;
Lisp_Object window;
struct window *w;
@@ -637,7 +637,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
if (c == '\n')
goto endloop;
- if (c == '\r' && EQ (current_buffer->selective_display, Qt))
+ if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt))
goto endloop;
if (c == '\t')
{
@@ -655,7 +655,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
if (c == '\n')
goto endloop;
- if (c == '\r' && EQ (current_buffer->selective_display, Qt))
+ if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt))
goto endloop;
if (c == '\t')
{
@@ -809,7 +809,7 @@ The return value is COLUMN. */)
{
int mincol;
register int fromcol;
- register int tab_width = XINT (current_buffer->tab_width);
+ register int tab_width = XINT (B_ (current_buffer, tab_width));
CHECK_NUMBER (column);
if (NILP (minimum))
@@ -872,7 +872,7 @@ static double
position_indentation (register int pos_byte)
{
register EMACS_INT column = 0;
- register EMACS_INT tab_width = XINT (current_buffer->tab_width);
+ register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width));
register unsigned char *p;
register unsigned char *stop;
unsigned char *start;
@@ -924,7 +924,7 @@ position_indentation (register int pos_byte)
switch (*p++)
{
case 0240:
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
return column;
case ' ':
column++;
@@ -934,7 +934,7 @@ position_indentation (register int pos_byte)
break;
default:
if (ASCII_BYTE_P (p[-1])
- || NILP (current_buffer->enable_multibyte_characters))
+ || NILP (B_ (current_buffer, enable_multibyte_characters)))
return column;
{
int c;
@@ -1123,13 +1123,13 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
register EMACS_INT pos;
EMACS_INT pos_byte;
register int c = 0;
- register EMACS_INT tab_width = XFASTINT (current_buffer->tab_width);
- register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
+ register EMACS_INT tab_width = XFASTINT (B_ (current_buffer, tab_width));
+ register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow));
register struct Lisp_Char_Table *dp = window_display_table (win);
int selective
- = (INTEGERP (current_buffer->selective_display)
- ? XINT (current_buffer->selective_display)
- : !NILP (current_buffer->selective_display) ? -1 : 0);
+ = (INTEGERP (B_ (current_buffer, selective_display))
+ ? XINT (B_ (current_buffer, selective_display))
+ : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0);
int selective_rlen
= (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp))
? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
@@ -1151,7 +1151,7 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
EMACS_INT next_width_run = from;
Lisp_Object window;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
/* If previous char scanned was a wide character,
this is the column where it ended. Otherwise, this is 0. */
EMACS_INT wide_column_end_hpos = 0;
@@ -1170,8 +1170,8 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
width_run_cache_on_off ();
if (dp == buffer_display_table ())
- width_table = (VECTORP (current_buffer->width_table)
- ? XVECTOR (current_buffer->width_table)->contents
+ width_table = (VECTORP (B_ (current_buffer, width_table))
+ ? XVECTOR (B_ (current_buffer, width_table))->contents
: 0);
else
/* 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_
}
if (hscroll || truncate
- || !NILP (current_buffer->truncate_lines))
+ || !NILP (B_ (current_buffer, truncate_lines)))
{
/* Truncating: skip to newline, unless we are already past
TO (we need to go back below). */
@@ -1838,9 +1838,9 @@ vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w)
EMACS_INT from_byte;
EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0;
int selective
- = (INTEGERP (current_buffer->selective_display)
- ? XINT (current_buffer->selective_display)
- : !NILP (current_buffer->selective_display) ? -1 : 0);
+ = (INTEGERP (B_ (current_buffer, selective_display))
+ ? XINT (B_ (current_buffer, selective_display))
+ : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0);
Lisp_Object window;
EMACS_INT start_hpos = 0;
int did_motion;
diff --git a/src/insdel.c b/src/insdel.c
index db76f770dad..e127ea555fb 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -78,7 +78,7 @@ void
check_markers (void)
{
register struct Lisp_Marker *tail;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
{
@@ -703,7 +703,7 @@ insert_char (int c)
unsigned char str[MAX_MULTIBYTE_LENGTH];
int len;
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
len = CHAR_STRING (c, str);
else
{
@@ -891,7 +891,7 @@ insert_1_both (const char *string,
if (nchars == 0)
return;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
nchars = nbytes;
if (prepare)
@@ -1011,7 +1011,7 @@ insert_from_string_1 (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
/* Make OUTGOING_NBYTES describe the text
as it will be inserted in this buffer. */
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
outgoing_nbytes = nchars;
else if (! STRING_MULTIBYTE (string))
outgoing_nbytes
@@ -1034,7 +1034,7 @@ insert_from_string_1 (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
between single-byte and multibyte. */
copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes,
STRING_MULTIBYTE (string),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
#ifdef BYTE_COMBINING_DEBUG
/* 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,
void
insert_from_gap (EMACS_INT nchars, EMACS_INT nbytes)
{
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
nchars = nbytes;
record_insert (GPT, nchars);
@@ -1162,9 +1162,9 @@ insert_from_buffer_1 (struct buffer *buf,
/* Make OUTGOING_NBYTES describe the text
as it will be inserted in this buffer. */
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
outgoing_nbytes = nchars;
- else if (NILP (buf->enable_multibyte_characters))
+ else if (NILP (B_ (buf, enable_multibyte_characters)))
{
EMACS_INT outgoing_before_gap = 0;
EMACS_INT outgoing_after_gap = 0;
@@ -1215,8 +1215,8 @@ insert_from_buffer_1 (struct buffer *buf,
chunk_expanded
= copy_text (BUF_BYTE_ADDRESS (buf, from_byte),
GPT_ADDR, chunk,
- ! NILP (buf->enable_multibyte_characters),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (buf, enable_multibyte_characters)),
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
}
else
chunk_expanded = chunk = 0;
@@ -1224,8 +1224,8 @@ insert_from_buffer_1 (struct buffer *buf,
if (chunk < incoming_nbytes)
copy_text (BUF_BYTE_ADDRESS (buf, from_byte + chunk),
GPT_ADDR + chunk_expanded, incoming_nbytes - chunk,
- ! NILP (buf->enable_multibyte_characters),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (buf, enable_multibyte_characters)),
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
#ifdef BYTE_COMBINING_DEBUG
/* 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,
adjust_markers_for_insert (from, from_byte,
from + len, from_byte + len_byte, 0);
- if (! EQ (current_buffer->undo_list, Qt))
+ if (! EQ (B_ (current_buffer, undo_list), Qt))
{
if (nchars_del > 0)
record_delete (from, prev_text);
@@ -1481,7 +1481,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new,
/* Make OUTGOING_INSBYTES describe the text
as it will be inserted in this buffer. */
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
outgoing_insbytes = inschars;
else if (! STRING_MULTIBYTE (new))
outgoing_insbytes
@@ -1503,7 +1503,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new,
/* Even if we don't record for undo, we must keep the original text
because we may have to recover it because of inappropriate byte
combining. */
- if (! EQ (current_buffer->undo_list, Qt))
+ if (! EQ (B_ (current_buffer, undo_list), Qt))
deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
GAP_SIZE += nbytes_del;
@@ -1530,7 +1530,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new,
between single-byte and multibyte. */
copy_text (SDATA (new), GPT_ADDR, insbytes,
STRING_MULTIBYTE (new),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
#ifdef BYTE_COMBINING_DEBUG
/* 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,
abort ();
#endif
- if (! EQ (current_buffer->undo_list, Qt))
+ if (! EQ (B_ (current_buffer, undo_list), Qt))
{
/* Record the insertion first, so that when we undo,
the deletion will be undone first. Thus, undo
@@ -1886,7 +1886,7 @@ del_range_2 (EMACS_INT from, EMACS_INT from_byte,
abort ();
#endif
- if (ret_string || ! EQ (current_buffer->undo_list, Qt))
+ if (ret_string || ! EQ (B_ (current_buffer, undo_list), Qt))
deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
else
deletion = Qnil;
@@ -1897,7 +1897,7 @@ del_range_2 (EMACS_INT from, EMACS_INT from_byte,
so that undo handles this after reinserting the text. */
adjust_markers_for_delete (from, from_byte, to, to_byte);
- if (! EQ (current_buffer->undo_list, Qt))
+ if (! EQ (B_ (current_buffer, undo_list), Qt))
record_delete (from, deletion);
MODIFF++;
CHARS_MODIFF = MODIFF;
@@ -1968,7 +1968,7 @@ modify_region (struct buffer *buffer, EMACS_INT start, EMACS_INT end,
if (! preserve_chars_modiff)
CHARS_MODIFF = MODIFF;
- buffer->point_before_scroll = Qnil;
+ B_ (buffer, point_before_scroll) = Qnil;
if (buffer != old_buffer)
set_buffer_internal (old_buffer);
@@ -1990,7 +1990,7 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
{
struct buffer *base_buffer;
- if (!NILP (current_buffer->read_only))
+ if (!NILP (B_ (current_buffer, read_only)))
Fbarf_if_buffer_read_only ();
/* Let redisplay consider other windows than selected_window
@@ -2022,11 +2022,11 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
base_buffer = current_buffer;
#ifdef CLASH_DETECTION
- if (!NILP (base_buffer->file_truename)
+ if (!NILP (B_ (base_buffer, file_truename))
/* Make binding buffer-file-name to nil effective. */
- && !NILP (base_buffer->filename)
+ && !NILP (B_ (base_buffer, filename))
&& SAVE_MODIFF >= MODIFF)
- lock_file (base_buffer->file_truename);
+ lock_file (B_ (base_buffer, file_truename));
#else
/* At least warn if this file has changed on disk since it was visited. */
if (!NILP (base_buffer->filename)
@@ -2038,16 +2038,16 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
#endif /* not CLASH_DETECTION */
/* If `select-active-regions' is non-nil, save the region text. */
- if (!NILP (current_buffer->mark_active)
+ if (!NILP (B_ (current_buffer, mark_active))
&& !inhibit_modification_hooks
- && XMARKER (current_buffer->mark)->buffer
+ && XMARKER (B_ (current_buffer, mark))->buffer
&& NILP (Vsaved_region_selection)
&& (EQ (Vselect_active_regions, Qonly)
? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
: (!NILP (Vselect_active_regions)
&& !NILP (Vtransient_mark_mode))))
{
- EMACS_INT b = XMARKER (current_buffer->mark)->charpos;
+ EMACS_INT b = XMARKER (B_ (current_buffer, mark))->charpos;
EMACS_INT e = PT;
if (b < e)
Vsaved_region_selection = make_buffer_string (b, e, 0);
@@ -2290,7 +2290,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
non-nil, and insertion calls a file handler (e.g. through
lock_file) which scribbles into a temp file -- cyd */
if (!BUFFERP (combine_after_change_buffer)
- || NILP (XBUFFER (combine_after_change_buffer)->name))
+ || NILP (B_ (XBUFFER (combine_after_change_buffer), name)))
{
combine_after_change_list = Qnil;
return Qnil;
diff --git a/src/intervals.c b/src/intervals.c
index ad46c17d588..de5faf6ce75 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1978,7 +1978,7 @@ set_point_both (EMACS_INT charpos, EMACS_INT bytepos)
int have_overlays;
EMACS_INT original_position;
- current_buffer->point_before_scroll = Qnil;
+ B_ (current_buffer, point_before_scroll) = Qnil;
if (charpos == PT)
return;
@@ -2342,7 +2342,7 @@ get_local_map (register EMACS_INT position, register struct buffer *buffer,
if (EQ (type, Qkeymap))
return Qnil;
else
- return buffer->keymap;
+ return B_ (buffer, keymap);
}
/* Produce an interval tree reflecting the intervals in
diff --git a/src/intervals.h b/src/intervals.h
index 0762c9d8dc3..3c46c50db79 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -236,9 +236,9 @@ struct interval
and 2 if it is invisible but with an ellipsis. */
#define TEXT_PROP_MEANS_INVISIBLE(prop) \
- (EQ (current_buffer->invisibility_spec, Qt) \
+ (EQ (B_ (current_buffer, invisibility_spec), Qt) \
? !NILP (prop) \
- : invisible_p (prop, current_buffer->invisibility_spec))
+ : invisible_p (prop, B_ (current_buffer, invisibility_spec)))
/* Declared in alloc.c */
diff --git a/src/keyboard.c b/src/keyboard.c
index 71d6456e57c..339d32a838a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1577,7 +1577,7 @@ command_loop_1 (void)
this_single_command_key_start = 0;
}
- if (!NILP (current_buffer->mark_active)
+ if (!NILP (B_ (current_buffer, mark_active))
&& !NILP (Vrun_hooks))
{
/* In Emacs 22, setting transient-mark-mode to `only' was a
@@ -1599,7 +1599,7 @@ command_loop_1 (void)
if (!NILP (Fwindow_system (Qnil))
/* Even if mark_active is non-nil, the actual buffer
marker may not have been set yet (Bug#7044). */
- && XMARKER (current_buffer->mark)->buffer
+ && XMARKER (B_ (current_buffer, mark))->buffer
&& (EQ (Vselect_active_regions, Qonly)
? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
: (!NILP (Vselect_active_regions)
@@ -1607,7 +1607,7 @@ command_loop_1 (void)
&& !EQ (Vthis_command, Qhandle_switch_frame))
{
EMACS_INT beg =
- XINT (Fmarker_position (current_buffer->mark));
+ XINT (Fmarker_position (B_ (current_buffer, mark)));
EMACS_INT end = PT;
if (beg < end)
call2 (Qx_set_selection, QPRIMARY,
@@ -8608,7 +8608,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
/* Prompt with that and read response. */
message2_nolog (menu, strlen (menu),
- ! NILP (current_buffer->enable_multibyte_characters));
+ ! NILP (B_ (current_buffer, enable_multibyte_characters)));
/* Make believe its not a keyboard macro in case the help char
is pressed. Help characters are not recorded because menu prompting
@@ -9870,7 +9870,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
/* Treat uppercase keys as shifted. */
|| (INTEGERP (key)
&& (KEY_TO_CHAR (key)
- < XCHAR_TABLE (current_buffer->downcase_table)->size)
+ < XCHAR_TABLE (B_ (current_buffer, downcase_table))->size)
&& UPPERCASEP (KEY_TO_CHAR (key))))
{
Lisp_Object new_key
diff --git a/src/keymap.c b/src/keymap.c
index 8ee4f41bd6f..b694deadcba 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1883,7 +1883,7 @@ bindings; see the description of `lookup-key' for more details about this. */)
(Lisp_Object keys, Lisp_Object accept_default)
{
register Lisp_Object map;
- map = current_buffer->keymap;
+ map = B_ (current_buffer, keymap);
if (NILP (map))
return Qnil;
return Flookup_key (map, keys, accept_default);
@@ -1988,7 +1988,7 @@ If KEYMAP is nil, that means no local keymap. */)
if (!NILP (keymap))
keymap = get_keymap (keymap, 1, 1);
- current_buffer->keymap = keymap;
+ B_ (current_buffer, keymap) = keymap;
return Qnil;
}
@@ -1998,7 +1998,7 @@ DEFUN ("current-local-map", Fcurrent_local_map, Scurrent_local_map, 0, 0, 0,
Normally the local keymap is set by the major mode with `use-local-map'. */)
(void)
{
- return current_buffer->keymap;
+ return B_ (current_buffer, keymap);
}
DEFUN ("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
*p++ = 'C';
}
else if (c < 128
- || (NILP (current_buffer->enable_multibyte_characters)
+ || (NILP (B_ (current_buffer, enable_multibyte_characters))
&& SINGLE_BYTE_CHAR_P (c)
&& !force_multibyte))
{
@@ -2388,7 +2388,7 @@ push_key_description (register unsigned int c, register char *p, int force_multi
else
{
/* Now we are sure that C is a valid character code. */
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! force_multibyte)
*p++ = multibyte_char_to_unibyte (c, Qnil);
else
@@ -3048,7 +3048,7 @@ You type Translation\n\
XBUFFER (buffer), Qlocal_map);
if (!NILP (start1))
{
- if (EQ (start1, XBUFFER (buffer)->keymap))
+ if (EQ (start1, B_ (XBUFFER (buffer), keymap)))
describe_map_tree (start1, 1, shadow, prefix,
"\f\nMajor Mode Bindings", nomenu, 0, 0, 0);
else
diff --git a/src/lisp.h b/src/lisp.h
index 4afc73195fd..5ab8c71ecfd 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1882,7 +1882,7 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
#define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \
do { \
static struct Lisp_Objfwd o_fwd; \
- defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname); \
+ defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname ## _); \
} while (0)
#define DEFVAR_KBOARD(lname, vname, doc) \
@@ -2047,11 +2047,11 @@ extern Lisp_Object case_temp2;
/* Current buffer's map from characters to lower-case characters. */
-#define DOWNCASE_TABLE current_buffer->downcase_table
+#define DOWNCASE_TABLE B_ (current_buffer, downcase_table)
/* Current buffer's map from characters to upper-case characters. */
-#define UPCASE_TABLE current_buffer->upcase_table
+#define UPCASE_TABLE B_ (current_buffer, upcase_table)
/* Downcase a character, or make no change if that cannot be done. */
diff --git a/src/lread.c b/src/lread.c
index f638aba211b..de9c5db95ad 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -210,7 +210,7 @@ readchar (Lisp_Object readcharfun, int *multibyte)
if (pt_byte >= BUF_ZV_BYTE (inbuffer))
return -1;
- if (! NILP (inbuffer->enable_multibyte_characters))
+ if (! NILP (B_ (inbuffer, enable_multibyte_characters)))
{
/* Fetch the character code from the buffer. */
unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, pt_byte);
@@ -239,7 +239,7 @@ readchar (Lisp_Object readcharfun, int *multibyte)
if (bytepos >= BUF_ZV_BYTE (inbuffer))
return -1;
- if (! NILP (inbuffer->enable_multibyte_characters))
+ if (! NILP (B_ (inbuffer, enable_multibyte_characters)))
{
/* Fetch the character code from the buffer. */
unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, bytepos);
@@ -371,7 +371,7 @@ unreadchar (Lisp_Object readcharfun, int c)
EMACS_INT bytepos = BUF_PT_BYTE (b);
BUF_PT (b)--;
- if (! NILP (b->enable_multibyte_characters))
+ if (! NILP (B_ (b, enable_multibyte_characters)))
BUF_DEC_POS (b, bytepos);
else
bytepos--;
@@ -384,7 +384,7 @@ unreadchar (Lisp_Object readcharfun, int c)
EMACS_INT bytepos = XMARKER (readcharfun)->bytepos;
XMARKER (readcharfun)->charpos--;
- if (! NILP (b->enable_multibyte_characters))
+ if (! NILP (B_ (b, enable_multibyte_characters)))
BUF_DEC_POS (b, bytepos);
else
bytepos--;
@@ -1322,7 +1322,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
/* Of course, this could conceivably lose if luser sets
default-directory to be something non-absolute... */
{
- filename = Fexpand_file_name (filename, current_buffer->directory);
+ filename = Fexpand_file_name (filename, B_ (current_buffer, directory));
if (!complete_filename_p (filename))
/* Give up on this path element! */
continue;
@@ -1581,7 +1581,7 @@ readevalloop (Lisp_Object readcharfun,
{
int count1 = SPECPDL_INDEX ();
- if (b != 0 && NILP (b->name))
+ if (b != 0 && NILP (B_ (b, name)))
error ("Reading from killed buffer");
if (!NILP (start))
@@ -1721,7 +1721,7 @@ This function preserves the position of point. */)
tem = printflag;
if (NILP (filename))
- filename = XBUFFER (buf)->filename;
+ filename = B_ (XBUFFER (buf), filename);
specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
specbind (Qstandard_output, tem);
@@ -1761,7 +1761,7 @@ This function does not move point. */)
specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list));
/* readevalloop calls functions which check the type of start and end. */
- readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval,
+ readevalloop (cbuf, 0, B_ (XBUFFER (cbuf), filename), Feval,
!NILP (printflag), Qnil, read_function,
start, end);
diff --git a/src/marker.c b/src/marker.c
index 1e0e1404fdb..9b841835646 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -439,7 +439,7 @@ Returns nil if MARKER points into a dead buffer. */)
does not preserve the buffer from being GC'd (it's weak), so
markers have to be unlinked from their buffer as soon as the buffer
is killed. */
- eassert (!NILP (XBUFFER (buf)->name));
+ eassert (!NILP (B_ (XBUFFER (buf), name)));
return buf;
}
return Qnil;
@@ -488,7 +488,7 @@ Returns MARKER. */)
CHECK_BUFFER (buffer);
b = XBUFFER (buffer);
/* If buffer is dead, set marker to point nowhere. */
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
{
unchain_marker (m);
return marker;
@@ -563,7 +563,7 @@ set_marker_restricted (Lisp_Object marker, Lisp_Object pos, Lisp_Object buffer)
CHECK_BUFFER (buffer);
b = XBUFFER (buffer);
/* If buffer is dead, set marker to point nowhere. */
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
{
unchain_marker (m);
return marker;
@@ -628,7 +628,7 @@ set_marker_both (Lisp_Object marker, Lisp_Object buffer, EMACS_INT charpos, EMAC
CHECK_BUFFER (buffer);
b = XBUFFER (buffer);
/* If buffer is dead, set marker to point nowhere. */
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
{
unchain_marker (m);
return marker;
@@ -676,7 +676,7 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, EMACS_INT ch
CHECK_BUFFER (buffer);
b = XBUFFER (buffer);
/* If buffer is dead, set marker to point nowhere. */
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
{
unchain_marker (m);
return marker;
@@ -731,7 +731,7 @@ unchain_marker (register struct Lisp_Marker *marker)
if (b == 0)
return;
- if (EQ (b->name, Qnil))
+ if (EQ (B_ (b, name), Qnil))
abort ();
marker->buffer = 0;
diff --git a/src/minibuf.c b/src/minibuf.c
index ec243daac19..3ed8630c845 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -415,7 +415,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
CHECK_STRING (initial);
}
val = Qnil;
- ambient_dir = current_buffer->directory;
+ ambient_dir = B_ (current_buffer, directory);
input_method = Qnil;
enable_multibyte = Qnil;
@@ -525,7 +525,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
/* `current-input-method' is buffer local. So, remember it in
INPUT_METHOD before changing the current buffer. */
input_method = Fsymbol_value (Qcurrent_input_method);
- enable_multibyte = current_buffer->enable_multibyte_characters;
+ enable_multibyte = B_ (current_buffer, enable_multibyte_characters);
}
/* Switch to the minibuffer. */
@@ -535,7 +535,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
/* If appropriate, copy enable-multibyte-characters into the minibuffer. */
if (inherit_input_method)
- current_buffer->enable_multibyte_characters = enable_multibyte;
+ B_ (current_buffer, enable_multibyte_characters) = enable_multibyte;
/* The current buffer's default directory is usually the right thing
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,
you think of something better to do? Find another buffer with a
better directory, and use that one instead. */
if (STRINGP (ambient_dir))
- current_buffer->directory = ambient_dir;
+ B_ (current_buffer, directory) = ambient_dir;
else
{
Lisp_Object buf_list;
@@ -558,9 +558,9 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
Lisp_Object other_buf;
other_buf = XCDR (XCAR (buf_list));
- if (STRINGP (XBUFFER (other_buf)->directory))
+ if (STRINGP (B_ (XBUFFER (other_buf), directory)))
{
- current_buffer->directory = XBUFFER (other_buf)->directory;
+ B_ (current_buffer, directory) = B_ (XBUFFER (other_buf), directory);
break;
}
}
@@ -603,7 +603,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
- if (!NILP (current_buffer->enable_multibyte_characters)
+ if (!NILP (B_ (current_buffer, enable_multibyte_characters))
&& ! STRING_MULTIBYTE (minibuf_prompt))
minibuf_prompt = Fstring_make_multibyte (minibuf_prompt);
@@ -633,7 +633,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
}
clear_message (1, 1);
- current_buffer->keymap = map;
+ B_ (current_buffer, keymap) = map;
/* Turn on an input method stored in INPUT_METHOD if any. */
if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method)))
@@ -647,7 +647,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
call1 (Vrun_hooks, Qminibuffer_setup_hook);
/* Don't allow the user to undo past this point. */
- current_buffer->undo_list = Qnil;
+ B_ (current_buffer, undo_list) = Qnil;
recursive_edit_1 ();
@@ -764,7 +764,7 @@ get_minibuffer (int depth)
Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
}
buf = Fcar (tail);
- if (NILP (buf) || NILP (XBUFFER (buf)->name))
+ if (NILP (buf) || NILP (B_ (XBUFFER (buf), name)))
{
sprintf (name, " *Minibuf-%d*", depth);
buf = Fget_buffer_create (build_string (name));
@@ -1096,7 +1096,7 @@ function, instead of the usual behavior. */)
int count = SPECPDL_INDEX ();
if (BUFFERP (def))
- def = XBUFFER (def)->name;
+ def = B_ (XBUFFER (def), name);
specbind (Qcompletion_ignore_case,
read_buffer_completion_ignore_case ? Qt : Qnil);
diff --git a/src/print.c b/src/print.c
index f47b71087f4..b5b278bf17f 100644
--- a/src/print.c
+++ b/src/print.c
@@ -111,7 +111,7 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
EMACS_INT old_point_byte = -1, start_point_byte = -1; \
int specpdl_count = SPECPDL_INDEX (); \
int free_print_buffer = 0; \
- int multibyte = !NILP (current_buffer->enable_multibyte_characters); \
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); \
Lisp_Object original
#define PRINTPREPARE \
@@ -144,10 +144,10 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
if (NILP (printcharfun)) \
{ \
Lisp_Object string; \
- if (NILP (current_buffer->enable_multibyte_characters) \
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)) \
&& ! print_escape_multibyte) \
specbind (Qprint_escape_multibyte, Qt); \
- if (! NILP (current_buffer->enable_multibyte_characters) \
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)) \
&& ! print_escape_nonascii) \
specbind (Qprint_escape_nonascii, Qt); \
if (print_buffer != 0) \
@@ -173,7 +173,7 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
if (NILP (printcharfun)) \
{ \
if (print_buffer_pos != print_buffer_pos_byte \
- && NILP (current_buffer->enable_multibyte_characters)) \
+ && NILP (B_ (current_buffer, enable_multibyte_characters))) \
{ \
unsigned char *temp \
= (unsigned char *) alloca (print_buffer_pos + 1); \
@@ -250,7 +250,7 @@ printchar (unsigned int ch, Lisp_Object fun)
else
{
int multibyte_p
- = !NILP (current_buffer->enable_multibyte_characters);
+ = !NILP (B_ (current_buffer, enable_multibyte_characters));
setup_echo_area_for_printing (multibyte_p);
insert_char (ch);
@@ -302,7 +302,7 @@ strout (const char *ptr, EMACS_INT size, EMACS_INT size_byte,
job. */
int i;
int multibyte_p
- = !NILP (current_buffer->enable_multibyte_characters);
+ = !NILP (B_ (current_buffer, enable_multibyte_characters));
setup_echo_area_for_printing (multibyte_p);
message_dolog (ptr, size_byte, 0, multibyte_p);
@@ -371,8 +371,8 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
chars = SCHARS (string);
else if (! print_escape_nonascii
&& (EQ (printcharfun, Qt)
- ? ! NILP (buffer_defaults.enable_multibyte_characters)
- : ! NILP (current_buffer->enable_multibyte_characters)))
+ ? ! NILP (B_ (&buffer_defaults, enable_multibyte_characters))
+ : ! NILP (B_ (current_buffer, enable_multibyte_characters))))
{
/* If unibyte string STRING contains 8-bit codes, we must
convert STRING to a multibyte string containing the same
@@ -504,14 +504,14 @@ temp_output_buffer_setup (const char *bufname)
Fkill_all_local_variables ();
delete_all_overlays (current_buffer);
- current_buffer->directory = old->directory;
- current_buffer->read_only = Qnil;
- current_buffer->filename = Qnil;
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, directory) = B_ (old, directory);
+ B_ (current_buffer, read_only) = Qnil;
+ B_ (current_buffer, filename) = Qnil;
+ B_ (current_buffer, undo_list) = Qt;
eassert (current_buffer->overlays_before == NULL);
eassert (current_buffer->overlays_after == NULL);
- current_buffer->enable_multibyte_characters
- = buffer_defaults.enable_multibyte_characters;
+ B_ (current_buffer, enable_multibyte_characters)
+ = B_ (&buffer_defaults, enable_multibyte_characters);
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
@@ -1854,7 +1854,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
if (!NILP (XWINDOW (obj)->buffer))
{
strout (" on ", -1, -1, printcharfun, 0);
- print_string (XBUFFER (XWINDOW (obj)->buffer)->name, printcharfun);
+ print_string (B_ (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun);
}
PRINTCHAR ('>');
}
@@ -1955,16 +1955,16 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
}
else if (BUFFERP (obj))
{
- if (NILP (XBUFFER (obj)->name))
+ if (NILP (B_ (XBUFFER (obj), name)))
strout ("#<killed buffer>", -1, -1, printcharfun, 0);
else if (escapeflag)
{
strout ("#<buffer ", -1, -1, printcharfun, 0);
- print_string (XBUFFER (obj)->name, printcharfun);
+ print_string (B_ (XBUFFER (obj), name), printcharfun);
PRINTCHAR ('>');
}
else
- print_string (XBUFFER (obj)->name, printcharfun);
+ print_string (B_ (XBUFFER (obj), name), printcharfun);
}
else if (WINDOW_CONFIGURATIONP (obj))
{
@@ -2076,7 +2076,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
sprintf (buf, "at %ld", (long)marker_position (obj));
strout (buf, -1, -1, printcharfun, 0);
strout (" in ", -1, -1, printcharfun, 0);
- print_string (XMARKER (obj)->buffer->name, printcharfun);
+ print_string (B_ (XMARKER (obj)->buffer, name), printcharfun);
}
PRINTCHAR ('>');
break;
@@ -2091,7 +2091,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
(long)marker_position (OVERLAY_START (obj)),
(long)marker_position (OVERLAY_END (obj)));
strout (buf, -1, -1, printcharfun, 0);
- print_string (XMARKER (OVERLAY_START (obj))->buffer->name,
+ print_string (B_ (XMARKER (OVERLAY_START (obj))->buffer, name),
printcharfun);
}
PRINTCHAR ('>');
diff --git a/src/process.c b/src/process.c
index 00d6c2e16da..ec929a919f8 100644
--- a/src/process.c
+++ b/src/process.c
@@ -719,7 +719,7 @@ get_process (register Lisp_Object name)
{
proc = Fget_buffer_process (obj);
if (NILP (proc))
- error ("Buffer %s has no process", SDATA (XBUFFER (obj)->name));
+ error ("Buffer %s has no process", SDATA (B_ (XBUFFER (obj), name)));
}
else
{
@@ -1283,12 +1283,12 @@ list_processes_1 (Lisp_Object query_only)
w_proc = i;
if (!NILP (p->buffer))
{
- if (NILP (XBUFFER (p->buffer)->name))
+ if (NILP (B_ (XBUFFER (p->buffer), name)))
{
if (w_buffer < 8)
w_buffer = 8; /* (Killed) */
}
- else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer)))
+ else if ((i = SCHARS (B_ (XBUFFER (p->buffer), name)), (i > w_buffer)))
w_buffer = i;
}
if (STRINGP (p->tty_name)
@@ -1312,9 +1312,9 @@ list_processes_1 (Lisp_Object query_only)
XSETFASTINT (minspace, 1);
set_buffer_internal (XBUFFER (Vstandard_output));
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, undo_list) = Qt;
- current_buffer->truncate_lines = Qt;
+ B_ (current_buffer, truncate_lines) = Qt;
write_string ("Proc", -1);
Findent_to (i_status, minspace); write_string ("Status", -1);
@@ -1397,10 +1397,10 @@ list_processes_1 (Lisp_Object query_only)
Findent_to (i_buffer, minspace);
if (NILP (p->buffer))
insert_string ("(none)");
- else if (NILP (XBUFFER (p->buffer)->name))
+ else if (NILP (B_ (XBUFFER (p->buffer), name)))
insert_string ("(Killed)");
else
- Finsert (1, &XBUFFER (p->buffer)->name);
+ Finsert (1, &B_ (XBUFFER (p->buffer), name));
if (!NILP (i_tty))
{
@@ -1548,7 +1548,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
{
struct gcpro gcpro1, gcpro2;
- current_dir = current_buffer->directory;
+ current_dir = B_ (current_buffer, directory);
GCPRO2 (buffer, current_dir);
@@ -1560,7 +1560,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
current_dir = expand_and_dir_to_file (current_dir, Qnil);
if (NILP (Ffile_accessible_directory_p (current_dir)))
report_file_error ("Setting current directory",
- Fcons (current_buffer->directory, Qnil));
+ Fcons (B_ (current_buffer, directory), Qnil));
UNGCPRO;
}
@@ -2898,8 +2898,8 @@ usage: (make-serial-process &rest ARGS) */)
}
else if (!NILP (Vcoding_system_for_read))
val = Vcoding_system_for_read;
- else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters))
- || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
+ else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters)))
+ || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters))))
val = Qnil;
p->decode_coding_system = val;
@@ -2912,8 +2912,8 @@ usage: (make-serial-process &rest ARGS) */)
}
else if (!NILP (Vcoding_system_for_write))
val = Vcoding_system_for_write;
- else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters))
- || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
+ else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters)))
+ || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters))))
val = Qnil;
p->encode_coding_system = val;
@@ -3723,8 +3723,8 @@ usage: (make-network-process &rest ARGS) */)
}
else if (!NILP (Vcoding_system_for_read))
val = Vcoding_system_for_read;
- else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters))
- || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters)))
+ else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters)))
+ || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters))))
/* We dare not decode end-of-line format by setting VAL to
Qraw_text, because the existing Emacs Lisp libraries
assume that they receive bare code including a sequene of
@@ -3759,7 +3759,7 @@ usage: (make-network-process &rest ARGS) */)
}
else if (!NILP (Vcoding_system_for_write))
val = Vcoding_system_for_write;
- else if (NILP (current_buffer->enable_multibyte_characters))
+ else if (NILP (B_ (current_buffer, enable_multibyte_characters)))
val = Qnil;
else
{
@@ -5268,7 +5268,7 @@ read_process_output (Lisp_Object proc, register int channel)
/* No need to gcpro these, because all we do with them later
is test them for EQness, and none of them should be a string. */
XSETBUFFER (obuffer, current_buffer);
- okeymap = current_buffer->keymap;
+ okeymap = B_ (current_buffer, keymap);
/* We inhibit quit here instead of just catching it so that
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)
}
/* If no filter, write into buffer if it isn't dead. */
- else if (!NILP (p->buffer) && !NILP (XBUFFER (p->buffer)->name))
+ else if (!NILP (p->buffer) && !NILP (B_ (XBUFFER (p->buffer), name)))
{
Lisp_Object old_read_only;
EMACS_INT old_begv, old_zv;
@@ -5372,13 +5372,13 @@ read_process_output (Lisp_Object proc, register int channel)
Fset_buffer (p->buffer);
opoint = PT;
opoint_byte = PT_BYTE;
- old_read_only = current_buffer->read_only;
+ old_read_only = B_ (current_buffer, read_only);
old_begv = BEGV;
old_zv = ZV;
old_begv_byte = BEGV_BYTE;
old_zv_byte = ZV_BYTE;
- current_buffer->read_only = Qnil;
+ B_ (current_buffer, read_only) = Qnil;
/* Insert new output into buffer
at the current end-of-output marker,
@@ -5423,7 +5423,7 @@ read_process_output (Lisp_Object proc, register int channel)
p->decoding_carryover = coding->carryover_bytes;
}
/* Adjust the multibyteness of TEXT to that of the buffer. */
- if (NILP (current_buffer->enable_multibyte_characters)
+ if (NILP (B_ (current_buffer, enable_multibyte_characters))
!= ! STRING_MULTIBYTE (text))
text = (STRING_MULTIBYTE (text)
? Fstring_as_unibyte (text)
@@ -5467,7 +5467,7 @@ read_process_output (Lisp_Object proc, register int channel)
Fnarrow_to_region (make_number (old_begv), make_number (old_zv));
- current_buffer->read_only = old_read_only;
+ B_ (current_buffer, read_only) = old_read_only;
SET_PT_BOTH (opoint, opoint_byte);
}
/* Handling the process output should not deactivate the mark. */
@@ -5525,7 +5525,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
if ((STRINGP (object) && STRING_MULTIBYTE (object))
|| (BUFFERP (object)
- && !NILP (XBUFFER (object)->enable_multibyte_characters))
+ && !NILP (B_ (XBUFFER (object), enable_multibyte_characters)))
|| EQ (object, Qt))
{
p->encode_coding_system
@@ -6564,7 +6564,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
is test them for EQness, and none of them should be a string. */
odeactivate = Vdeactivate_mark;
XSETBUFFER (obuffer, current_buffer);
- okeymap = current_buffer->keymap;
+ okeymap = B_ (current_buffer, keymap);
/* There's no good reason to let sentinels change the current
buffer, and many callers of accept-process-output, sit-for, and
@@ -6714,7 +6714,7 @@ status_notify (struct Lisp_Process *deleting_process)
/* Avoid error if buffer is deleted
(probably that's why the process is dead, too) */
- if (NILP (XBUFFER (buffer)->name))
+ if (NILP (B_ (XBUFFER (buffer), name)))
continue;
Fset_buffer (buffer);
@@ -6731,13 +6731,13 @@ status_notify (struct Lisp_Process *deleting_process)
before = PT;
before_byte = PT_BYTE;
- tem = current_buffer->read_only;
- current_buffer->read_only = Qnil;
+ tem = B_ (current_buffer, read_only);
+ B_ (current_buffer, read_only) = Qnil;
insert_string ("\nProcess ");
Finsert (1, &p->name);
insert_string (" ");
Finsert (1, &msg);
- current_buffer->read_only = tem;
+ B_ (current_buffer, read_only) = tem;
set_marker_both (p->mark, p->buffer, PT, PT_BYTE);
if (opoint >= before)
@@ -7136,7 +7136,7 @@ setup_process_coding_systems (Lisp_Object process)
;
else if (BUFFERP (p->buffer))
{
- if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters))
+ if (NILP (B_ (XBUFFER (p->buffer), enable_multibyte_characters)))
coding_system = raw_text_coding_system (coding_system);
}
setup_coding_system (coding_system, proc_decode_coding_system[inch]);
diff --git a/src/search.c b/src/search.c
index 09dae0ed0f5..a80e20a8a8a 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
/* If the compiled pattern hard codes some of the contents of the
syntax-table, it can only be reused with *this* syntax table. */
- cp->syntax_table = cp->buf.used_syntax ? current_buffer->syntax_table : Qt;
+ cp->syntax_table = cp->buf.used_syntax ? B_ (current_buffer, syntax_table) : Qt;
re_set_whitespace_regexp (NULL);
@@ -236,7 +236,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object tra
&& EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0)))
&& cp->posix == posix
&& (EQ (cp->syntax_table, Qt)
- || EQ (cp->syntax_table, current_buffer->syntax_table))
+ || EQ (cp->syntax_table, B_ (current_buffer, syntax_table)))
&& !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp))
&& cp->buf.charset_unibyte == charset_unibyte)
break;
@@ -285,17 +285,17 @@ looking_at_1 (Lisp_Object string, int posix)
save_search_regs ();
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
- XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
- = current_buffer->case_eqv_table;
+ XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2]
+ = B_ (current_buffer, case_eqv_table);
CHECK_STRING (string);
bufp = compile_pattern (string,
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL),
- (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_canon_table : Qnil),
+ (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_canon_table) : Qnil),
posix,
- !NILP (current_buffer->enable_multibyte_characters));
+ !NILP (B_ (current_buffer, enable_multibyte_characters)));
immediate_quit = 1;
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
}
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
- XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
- = current_buffer->case_eqv_table;
+ XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2]
+ = B_ (current_buffer, case_eqv_table);
bufp = compile_pattern (regexp,
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL),
- (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_canon_table : Qnil),
+ (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_canon_table) : Qnil),
posix,
STRING_MULTIBYTE (string));
immediate_quit = 1;
@@ -586,7 +586,7 @@ fast_looking_at (Lisp_Object regexp, EMACS_INT pos, EMACS_INT pos_byte, EMACS_IN
s2 = 0;
}
re_match_object = Qnil;
- multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
}
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
static void
newline_cache_on_off (struct buffer *buf)
{
- if (NILP (buf->cache_long_line_scans))
+ if (NILP (B_ (buf, cache_long_line_scans)))
{
/* It should be off. */
if (buf->newline_cache)
@@ -996,15 +996,15 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror,
}
/* This is so set_image_of_range_1 in regex.c can find the EQV table. */
- XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
- = current_buffer->case_eqv_table;
+ XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2]
+ = B_ (current_buffer, case_eqv_table);
np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE,
- (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_canon_table
+ (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_canon_table)
: Qnil),
- (!NILP (current_buffer->case_fold_search)
- ? current_buffer->case_eqv_table
+ (!NILP (B_ (current_buffer, case_fold_search))
+ ? B_ (current_buffer, case_eqv_table)
: Qnil),
posix);
if (np <= 0)
@@ -1133,7 +1133,7 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
(NILP (Vinhibit_changing_match_data)
? &search_regs : &search_regs_1),
trt, posix,
- !NILP (current_buffer->enable_multibyte_characters));
+ !NILP (B_ (current_buffer, enable_multibyte_characters)));
immediate_quit = 1; /* Quit immediately if user types ^G,
because letting this function finish
@@ -1254,7 +1254,7 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
EMACS_INT raw_pattern_size;
EMACS_INT raw_pattern_size_byte;
unsigned char *patbuf;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
unsigned char *base_pat;
/* Set to positive if we find a non-ASCII char that need
translation. Otherwise set to zero later. */
@@ -1451,7 +1451,7 @@ simple_search (EMACS_INT n, unsigned char *pat,
EMACS_INT pos, EMACS_INT pos_byte,
EMACS_INT lim, EMACS_INT lim_byte)
{
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
int forward = n > 0;
/* Number of buffer bytes matched. Note that this may be different
from len_byte in a multibyte buffer. */
@@ -1671,7 +1671,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
register EMACS_INT i;
register int j;
unsigned char *pat, *pat_end;
- int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters));
unsigned char simple_translate[0400];
/* These are set to the preceding bytes of a byte to be translated
@@ -2639,7 +2639,7 @@ since only regular expressions have distinguished subexpressions. */)
EMACS_INT length = SBYTES (newtext);
unsigned char *substed;
EMACS_INT substed_alloc_size, substed_len;
- int buf_multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int buf_multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
int str_multibyte = STRING_MULTIBYTE (newtext);
Lisp_Object rev_tbl;
int really_changed = 0;
diff --git a/src/syntax.c b/src/syntax.c
index 2f47d73d695..9aa34014f91 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -277,7 +277,7 @@ update_syntax_table (EMACS_INT charpos, int count, int init,
else
{
gl_state.use_global = 0;
- gl_state.current_syntax_table = current_buffer->syntax_table;
+ gl_state.current_syntax_table = B_ (current_buffer, syntax_table);
}
}
@@ -363,7 +363,7 @@ char_quoted (EMACS_INT charpos, EMACS_INT bytepos)
static INLINE EMACS_INT
dec_bytepos (EMACS_INT bytepos)
{
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
return bytepos - 1;
DEC_POS (bytepos);
@@ -779,7 +779,7 @@ DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0,
This is the one specified by the current buffer. */)
(void)
{
- return current_buffer->syntax_table;
+ return B_ (current_buffer, syntax_table);
}
DEFUN ("standard-syntax-table", Fstandard_syntax_table,
@@ -824,7 +824,7 @@ One argument, a syntax table. */)
{
int idx;
check_syntax_table (table);
- current_buffer->syntax_table = table;
+ B_ (current_buffer, syntax_table) = table;
/* Indicate that this buffer now has a specified syntax table. */
idx = PER_BUFFER_VAR_IDX (syntax_table);
SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
@@ -1035,7 +1035,7 @@ usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */)
CHECK_CHARACTER (c);
if (NILP (syntax_table))
- syntax_table = current_buffer->syntax_table;
+ syntax_table = B_ (current_buffer, syntax_table);
else
check_syntax_table (syntax_table);
@@ -1450,7 +1450,7 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl
if (XINT (lim) < BEGV)
XSETFASTINT (lim, BEGV);
- multibyte = (!NILP (current_buffer->enable_multibyte_characters)
+ multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters))
&& (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
string_multibyte = SBYTES (string) > SCHARS (string);
@@ -1936,7 +1936,7 @@ skip_syntaxes (int forwardp, Lisp_Object string, Lisp_Object lim)
if (forwardp ? (PT >= XFASTINT (lim)) : (PT <= XFASTINT (lim)))
return make_number (0);
- multibyte = (!NILP (current_buffer->enable_multibyte_characters)
+ multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters))
&& (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
memset (fastmap, 0, sizeof fastmap);
@@ -2703,7 +2703,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
while (from > stop)
{
temp_pos = from_byte;
- if (! NILP (current_buffer->enable_multibyte_characters))
+ if (! NILP (B_ (current_buffer, enable_multibyte_characters)))
DEC_POS (temp_pos);
else
temp_pos--;
diff --git a/src/syntax.h b/src/syntax.h
index bea66d1fada..75937a7c121 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -24,7 +24,7 @@ extern void update_syntax_table (EMACS_INT, int, int, Lisp_Object);
/* The standard syntax table is stored where it will automatically
be used in all new buffers. */
-#define Vstandard_syntax_table buffer_defaults.syntax_table
+#define Vstandard_syntax_table B_ (&buffer_defaults, syntax_table)
/* A syntax table is a chartable whose elements are cons cells
(CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char
@@ -79,7 +79,7 @@ enum syntaxcode
# define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table
#else
# define SYNTAX_ENTRY SYNTAX_ENTRY_INT
-# define CURRENT_SYNTAX_TABLE current_buffer->syntax_table
+# define CURRENT_SYNTAX_TABLE B_ (current_buffer, syntax_table)
#endif
#define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c))
@@ -204,7 +204,7 @@ extern char syntax_code_spec[16];
do \
{ \
gl_state.use_global = 0; \
- gl_state.current_syntax_table = current_buffer->syntax_table; \
+ gl_state.current_syntax_table = B_ (current_buffer, syntax_table); \
} while (0)
/* This macro should be called with FROM at the start of forward
diff --git a/src/undo.c b/src/undo.c
index 933982ec30c..f6953fabfec 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -73,12 +73,12 @@ record_point (EMACS_INT pt)
Fundo_boundary ();
last_undo_buffer = current_buffer;
- if (CONSP (current_buffer->undo_list))
+ if (CONSP (B_ (current_buffer, undo_list)))
{
/* Set AT_BOUNDARY to 1 only when we have nothing other than
marker adjustment before undo boundary. */
- Lisp_Object tail = current_buffer->undo_list, elt;
+ Lisp_Object tail = B_ (current_buffer, undo_list), elt;
while (1)
{
@@ -103,8 +103,8 @@ record_point (EMACS_INT pt)
if (at_boundary
&& current_buffer == last_boundary_buffer
&& last_boundary_position != pt)
- current_buffer->undo_list
- = Fcons (make_number (last_boundary_position), current_buffer->undo_list);
+ B_ (current_buffer, undo_list)
+ = Fcons (make_number (last_boundary_position), B_ (current_buffer, undo_list));
}
/* Record an insertion that just happened or is about to happen,
@@ -117,17 +117,17 @@ record_insert (EMACS_INT beg, EMACS_INT length)
{
Lisp_Object lbeg, lend;
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return;
record_point (beg);
/* If this is following another insertion and consecutive with it
in the buffer, combine the two. */
- if (CONSP (current_buffer->undo_list))
+ if (CONSP (B_ (current_buffer, undo_list)))
{
Lisp_Object elt;
- elt = XCAR (current_buffer->undo_list);
+ elt = XCAR (B_ (current_buffer, undo_list));
if (CONSP (elt)
&& INTEGERP (XCAR (elt))
&& INTEGERP (XCDR (elt))
@@ -140,8 +140,8 @@ record_insert (EMACS_INT beg, EMACS_INT length)
XSETFASTINT (lbeg, beg);
XSETINT (lend, beg + length);
- current_buffer->undo_list = Fcons (Fcons (lbeg, lend),
- current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = Fcons (Fcons (lbeg, lend),
+ B_ (current_buffer, undo_list));
}
/* Record that a deletion is about to take place,
@@ -152,7 +152,7 @@ record_delete (EMACS_INT beg, Lisp_Object string)
{
Lisp_Object sbeg;
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return;
if (PT == beg + SCHARS (string))
@@ -166,8 +166,8 @@ record_delete (EMACS_INT beg, Lisp_Object string)
record_point (beg);
}
- current_buffer->undo_list
- = Fcons (Fcons (string, sbeg), current_buffer->undo_list);
+ B_ (current_buffer, undo_list)
+ = Fcons (Fcons (string, sbeg), B_ (current_buffer, undo_list));
}
/* Record the fact that MARKER is about to be adjusted by ADJUSTMENT.
@@ -178,7 +178,7 @@ record_delete (EMACS_INT beg, Lisp_Object string)
void
record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment)
{
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return;
/* 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)
Fundo_boundary ();
last_undo_buffer = current_buffer;
- current_buffer->undo_list
+ B_ (current_buffer, undo_list)
= Fcons (Fcons (marker, make_number (adjustment)),
- current_buffer->undo_list);
+ B_ (current_buffer, undo_list));
}
/* Record that a replacement is about to take place,
@@ -215,7 +215,7 @@ record_first_change (void)
Lisp_Object high, low;
struct buffer *base_buffer = current_buffer;
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return;
if (current_buffer != last_undo_buffer)
@@ -227,7 +227,7 @@ record_first_change (void)
XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff);
XSETFASTINT (low, base_buffer->modtime & 0xffff);
- current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = Fcons (Fcons (Qt, Fcons (high, low)), B_ (current_buffer, undo_list));
}
/* Record a change in property PROP (whose old value was VAL)
@@ -242,7 +242,7 @@ record_property_change (EMACS_INT beg, EMACS_INT length,
struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer);
int boundary = 0;
- if (EQ (buf->undo_list, Qt))
+ if (EQ (B_ (buf, undo_list), Qt))
return;
/* 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,
XSETINT (lbeg, beg);
XSETINT (lend, beg + length);
entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend))));
- current_buffer->undo_list = Fcons (entry, current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = Fcons (entry, B_ (current_buffer, undo_list));
current_buffer = obuf;
}
@@ -277,9 +277,9 @@ but another undo command will undo to the previous boundary. */)
(void)
{
Lisp_Object tem;
- if (EQ (current_buffer->undo_list, Qt))
+ if (EQ (B_ (current_buffer, undo_list), Qt))
return Qnil;
- tem = Fcar (current_buffer->undo_list);
+ tem = Fcar (B_ (current_buffer, undo_list));
if (!NILP (tem))
{
/* 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. */)
{
/* If we have preallocated the cons cell to use here,
use that one. */
- XSETCDR (pending_boundary, current_buffer->undo_list);
- current_buffer->undo_list = pending_boundary;
+ XSETCDR (pending_boundary, B_ (current_buffer, undo_list));
+ B_ (current_buffer, undo_list) = pending_boundary;
pending_boundary = Qnil;
}
else
- current_buffer->undo_list = Fcons (Qnil, current_buffer->undo_list);
+ B_ (current_buffer, undo_list) = Fcons (Qnil, B_ (current_buffer, undo_list));
}
last_boundary_position = PT;
last_boundary_buffer = current_buffer;
@@ -321,7 +321,7 @@ truncate_undo_list (struct buffer *b)
record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
set_buffer_internal (b);
- list = b->undo_list;
+ list = B_ (b, undo_list);
prev = Qnil;
next = list;
@@ -433,7 +433,7 @@ truncate_undo_list (struct buffer *b)
XSETCDR (last_boundary, Qnil);
/* There's nothing we decided to keep, so clear it out. */
else
- b->undo_list = Qnil;
+ B_ (b, undo_list) = Qnil;
unbind_to (count, Qnil);
}
@@ -470,13 +470,13 @@ Return what remains of the list. */)
/* In a writable buffer, enable undoing read-only text that is so
because of text properties. */
- if (NILP (current_buffer->read_only))
+ if (NILP (B_ (current_buffer, read_only)))
specbind (Qinhibit_read_only, Qt);
/* Don't let `intangible' properties interfere with undo. */
specbind (Qinhibit_point_motion_hooks, Qt);
- oldlist = current_buffer->undo_list;
+ oldlist = B_ (current_buffer, undo_list);
while (arg > 0)
{
@@ -631,9 +631,9 @@ Return what remains of the list. */)
so the test in `undo' for continuing an undo series
will work right. */
if (did_apply
- && EQ (oldlist, current_buffer->undo_list))
- current_buffer->undo_list
- = Fcons (list3 (Qapply, Qcdr, Qnil), current_buffer->undo_list);
+ && EQ (oldlist, B_ (current_buffer, undo_list)))
+ B_ (current_buffer, undo_list)
+ = Fcons (list3 (Qapply, Qcdr, Qnil), B_ (current_buffer, undo_list));
UNGCPRO;
return unbind_to (count, list);
diff --git a/src/window.c b/src/window.c
index b158073a3db..4d700cfad5e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1359,8 +1359,8 @@ window_display_table (struct window *w)
{
struct buffer *b = XBUFFER (w->buffer);
- if (DISP_TABLE_P (b->display_table))
- dp = XCHAR_TABLE (b->display_table);
+ if (DISP_TABLE_P (B_ (b, display_table)))
+ dp = XCHAR_TABLE (B_ (b, display_table));
else if (DISP_TABLE_P (Vstandard_display_table))
dp = XCHAR_TABLE (Vstandard_display_table);
}
@@ -1414,9 +1414,9 @@ unshow_buffer (register struct window *w)
So don't clobber point in that buffer. */
if (! EQ (buf, XWINDOW (selected_window)->buffer)
/* This line helps to fix Horsley's testbug.el bug. */
- && !(WINDOWP (b->last_selected_window)
- && w != XWINDOW (b->last_selected_window)
- && EQ (buf, XWINDOW (b->last_selected_window)->buffer)))
+ && !(WINDOWP (B_ (b, last_selected_window))
+ && w != XWINDOW (B_ (b, last_selected_window))
+ && EQ (buf, XWINDOW (B_ (b, last_selected_window))->buffer)))
temp_set_point_both (b,
clip_to_bounds (BUF_BEGV (b),
XMARKER (w->pointm)->charpos,
@@ -1425,9 +1425,9 @@ unshow_buffer (register struct window *w)
marker_byte_position (w->pointm),
BUF_ZV_BYTE (b)));
- if (WINDOWP (b->last_selected_window)
- && w == XWINDOW (b->last_selected_window))
- b->last_selected_window = Qnil;
+ if (WINDOWP (B_ (b, last_selected_window))
+ && w == XWINDOW (B_ (b, last_selected_window)))
+ B_ (b, last_selected_window) = Qnil;
}
/* 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
/* Check for a window that has a killed buffer. */
case CHECK_ALL_WINDOWS:
if (! NILP (w->buffer)
- && NILP (XBUFFER (w->buffer)->name))
+ && NILP (B_ (XBUFFER (w->buffer), name)))
abort ();
break;
@@ -2729,7 +2729,7 @@ window_min_size_2 (struct window *w, int width_p, int safe_p)
{
int safe_size = (MIN_SAFE_WINDOW_HEIGHT
+ ((BUFFERP (w->buffer)
- && !NILP (XBUFFER (w->buffer)->mode_line_format))
+ && !NILP (B_ (XBUFFER (w->buffer), mode_line_format)))
? 1 : 0));
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
w->buffer = buffer;
if (EQ (window, selected_window))
- b->last_selected_window = window;
+ B_ (b, last_selected_window) = window;
/* Let redisplay errors through. */
b->display_error_modiff = 0;
/* Update time stamps of buffer display. */
- if (INTEGERP (b->display_count))
- XSETINT (b->display_count, XINT (b->display_count) + 1);
- b->display_time = Fcurrent_time ();
+ if (INTEGERP (B_ (b, display_count)))
+ XSETINT (B_ (b, display_count), XINT (B_ (b, display_count)) + 1);
+ B_ (b, display_time) = Fcurrent_time ();
XSETFASTINT (w->window_end_pos, 0);
XSETFASTINT (w->window_end_vpos, 0);
@@ -3421,18 +3421,18 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
w->left_margin_cols = w->right_margin_cols = Qnil;
Fset_window_fringes (window,
- b->left_fringe_width, b->right_fringe_width,
- b->fringes_outside_margins);
+ B_ (b, left_fringe_width), B_ (b, right_fringe_width),
+ B_ (b, fringes_outside_margins));
Fset_window_scroll_bars (window,
- b->scroll_bar_width,
- b->vertical_scroll_bar_type, Qnil);
+ B_ (b, scroll_bar_width),
+ B_ (b, vertical_scroll_bar_type), Qnil);
w->left_margin_cols = save_left;
w->right_margin_cols = save_right;
Fset_window_margins (window,
- b->left_margin_cols, b->right_margin_cols);
+ B_ (b, left_margin_cols), B_ (b, right_margin_cols));
}
if (run_hooks_p)
@@ -3469,7 +3469,7 @@ This function runs `window-scroll-functions' before running
XSETWINDOW (window, w);
buffer = Fget_buffer (buffer_or_name);
CHECK_BUFFER (buffer);
- if (NILP (XBUFFER (buffer)->name))
+ if (NILP (B_ (XBUFFER (buffer), name)))
error ("Attempt to display deleted buffer");
tem = w->buffer;
@@ -3481,7 +3481,7 @@ This function runs `window-scroll-functions' before running
if (EQ (tem, buffer))
return Qnil;
else if (EQ (w->dedicated, Qt))
- error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name));
+ error ("Window is dedicated to `%s'", SDATA (B_ (XBUFFER (tem), name)));
else
w->dedicated = Qnil;
@@ -3552,7 +3552,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
Fset_buffer (w->buffer);
- XBUFFER (w->buffer)->last_selected_window = window;
+ B_ (XBUFFER (w->buffer), last_selected_window) = window;
/* Go to the point recorded in the window.
This is important when the buffer is in more
@@ -3640,7 +3640,7 @@ displaying that buffer. */)
if (STRINGP (object))
object = Fget_buffer (object);
- if (BUFFERP (object) && !NILP (XBUFFER (object)->name))
+ if (BUFFERP (object) && !NILP (B_ (XBUFFER (object), name)))
{
/* Walk all windows looking for buffer, and force update
of each of those windows. */
@@ -3663,7 +3663,7 @@ temp_output_buffer_show (register Lisp_Object buf)
register Lisp_Object window;
register struct window *w;
- XBUFFER (buf)->directory = current_buffer->directory;
+ B_ (XBUFFER (buf), directory) = B_ (current_buffer, directory);
Fset_buffer (buf);
BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF;
@@ -5878,7 +5878,7 @@ the return value is nil. Otherwise the value is t. */)
saved_windows = XVECTOR (data->saved_windows);
new_current_buffer = data->current_buffer;
- if (NILP (XBUFFER (new_current_buffer)->name))
+ if (NILP (B_ (XBUFFER (new_current_buffer), name)))
new_current_buffer = Qnil;
else
{
@@ -6063,14 +6063,14 @@ the return value is nil. Otherwise the value is t. */)
w->buffer = p->buffer;
else
{
- if (!NILP (XBUFFER (p->buffer)->name))
+ if (!NILP (B_ (XBUFFER (p->buffer), name)))
/* If saved buffer is alive, install it. */
{
w->buffer = p->buffer;
w->start_at_line_beg = p->start_at_line_beg;
set_marker_restricted (w->start, p->start, w->buffer);
set_marker_restricted (w->pointm, p->pointm, w->buffer);
- Fset_marker (XBUFFER (w->buffer)->mark,
+ Fset_marker (B_ (XBUFFER (w->buffer), mark),
p->mark, w->buffer);
/* As documented in Fcurrent_window_configuration, don't
@@ -6080,7 +6080,7 @@ the return value is nil. Otherwise the value is t. */)
&& XBUFFER (p->buffer) == current_buffer)
Fgoto_char (w->pointm);
}
- else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name))
+ else if (NILP (w->buffer) || NILP (B_ (XBUFFER (w->buffer), name)))
/* Else unless window has a live buffer, get one. */
{
w->buffer = Fcdr (Fcar (Vbuffer_alist));
@@ -6121,7 +6121,7 @@ the return value is nil. Otherwise the value is t. */)
has been restored into it. We already swapped out that point
from that window's old buffer. */
select_window (data->current_window, Qnil, 1);
- XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
+ B_ (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window)
= selected_window;
if (NILP (data->focus_frame)
@@ -6322,7 +6322,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
p->start = Fcopy_marker (w->start, Qnil);
p->start_at_line_beg = w->start_at_line_beg;
- tem = XBUFFER (w->buffer)->mark;
+ tem = B_ (XBUFFER (w->buffer), mark);
p->mark = Fcopy_marker (tem, Qnil);
}
else
diff --git a/src/xdisp.c b/src/xdisp.c
index b9b77e34b9d..68f7835f0d7 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,
if (WINDOW_WANTS_MODELINE_P (w))
current_mode_line_height
= display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
- current_buffer->mode_line_format);
+ B_ (current_buffer, mode_line_format));
if (WINDOW_WANTS_HEADER_LINE_P (w))
current_header_line_height
= display_mode_line (w, HEADER_LINE_FACE_ID,
- current_buffer->header_line_format);
+ B_ (current_buffer, header_line_format));
start_display (&it, w, top);
move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
@@ -2405,10 +2405,10 @@ init_iterator (struct it *it, struct window *w,
if (base_face_id == DEFAULT_FACE_ID
&& FRAME_WINDOW_P (it->f))
{
- if (NATNUMP (current_buffer->extra_line_spacing))
- it->extra_line_spacing = XFASTINT (current_buffer->extra_line_spacing);
- else if (FLOATP (current_buffer->extra_line_spacing))
- it->extra_line_spacing = (XFLOAT_DATA (current_buffer->extra_line_spacing)
+ if (NATNUMP (B_ (current_buffer, extra_line_spacing)))
+ it->extra_line_spacing = XFASTINT (B_ (current_buffer, extra_line_spacing));
+ else if (FLOATP (B_ (current_buffer, extra_line_spacing)))
+ it->extra_line_spacing = (XFLOAT_DATA (B_ (current_buffer, extra_line_spacing))
* FRAME_LINE_HEIGHT (it->f));
else if (it->f->extra_line_spacing > 0)
it->extra_line_spacing = it->f->extra_line_spacing;
@@ -2431,36 +2431,36 @@ init_iterator (struct it *it, struct window *w,
it->override_ascent = -1;
/* Are control characters displayed as `^C'? */
- it->ctl_arrow_p = !NILP (current_buffer->ctl_arrow);
+ it->ctl_arrow_p = !NILP (B_ (current_buffer, ctl_arrow));
/* -1 means everything between a CR and the following line end
is invisible. >0 means lines indented more than this value are
invisible. */
- it->selective = (INTEGERP (current_buffer->selective_display)
- ? XFASTINT (current_buffer->selective_display)
- : (!NILP (current_buffer->selective_display)
+ it->selective = (INTEGERP (B_ (current_buffer, selective_display))
+ ? XFASTINT (B_ (current_buffer, selective_display))
+ : (!NILP (B_ (current_buffer, selective_display))
? -1 : 0));
it->selective_display_ellipsis_p
- = !NILP (current_buffer->selective_display_ellipses);
+ = !NILP (B_ (current_buffer, selective_display_ellipses));
/* Display table to use. */
it->dp = window_display_table (w);
/* Are multibyte characters enabled in current_buffer? */
- it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
+ it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters));
/* Do we need to reorder bidirectional text? Not if this is a
unibyte buffer: by definition, none of the single-byte characters
are strong R2L, so no reordering is needed. And bidi.c doesn't
support unibyte buffers anyway. */
it->bidi_p
- = !NILP (current_buffer->bidi_display_reordering) && it->multibyte_p;
+ = !NILP (B_ (current_buffer, bidi_display_reordering)) && it->multibyte_p;
/* Non-zero if we should highlight the region. */
highlight_region_p
= (!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active)
- && XMARKER (current_buffer->mark)->buffer != 0);
+ && !NILP (B_ (current_buffer, mark_active))
+ && XMARKER (B_ (current_buffer, mark))->buffer != 0);
/* Set IT->region_beg_charpos and IT->region_end_charpos to the
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,
&& WINDOWP (minibuf_selected_window)
&& w == XWINDOW (minibuf_selected_window))))
{
- EMACS_INT charpos = marker_position (current_buffer->mark);
+ EMACS_INT charpos = marker_position (B_ (current_buffer, mark));
it->region_beg_charpos = min (PT, charpos);
it->region_end_charpos = max (PT, charpos);
}
@@ -2494,7 +2494,7 @@ init_iterator (struct it *it, struct window *w,
it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger);
/* Correct bogus values of tab_width. */
- it->tab_width = XINT (current_buffer->tab_width);
+ it->tab_width = XINT (B_ (current_buffer, tab_width));
if (it->tab_width <= 0 || it->tab_width > 1000)
it->tab_width = 8;
@@ -2508,8 +2508,8 @@ init_iterator (struct it *it, struct window *w,
&& (WINDOW_TOTAL_COLS (it->w)
< XINT (Vtruncate_partial_width_windows))))))
it->line_wrap = TRUNCATE;
- else if (NILP (current_buffer->truncate_lines))
- it->line_wrap = NILP (current_buffer->word_wrap)
+ else if (NILP (B_ (current_buffer, truncate_lines)))
+ it->line_wrap = NILP (B_ (current_buffer, word_wrap))
? WINDOW_WRAP : WORD_WRAP;
else
it->line_wrap = TRUNCATE;
@@ -2611,9 +2611,9 @@ init_iterator (struct it *it, struct window *w,
{
/* Note the paragraph direction that this buffer wants to
use. */
- if (EQ (current_buffer->bidi_paragraph_direction, Qleft_to_right))
+ if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qleft_to_right))
it->paragraph_embedding = L2R;
- else if (EQ (current_buffer->bidi_paragraph_direction, Qright_to_left))
+ else if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qright_to_left))
it->paragraph_embedding = R2L;
else
it->paragraph_embedding = NEUTRAL_DIR;
@@ -5411,7 +5411,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
it->method = GET_FROM_BUFFER;
it->object = it->w->buffer;
it->area = TEXT_AREA;
- it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
+ it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters));
it->sp = 0;
it->string_from_display_prop_p = 0;
it->face_before_selective_p = 0;
@@ -7919,7 +7919,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
old_deactivate_mark = Vdeactivate_mark;
oldbuf = current_buffer;
Fset_buffer (Fget_buffer_create (Vmessages_buffer_name));
- current_buffer->undo_list = Qt;
+ B_ (current_buffer, undo_list) = Qt;
oldpoint = message_dolog_marker1;
set_marker_restricted (oldpoint, make_number (PT), Qnil);
@@ -7943,7 +7943,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
/* Insert the string--maybe converting multibyte to single byte
or vice versa, so that all the text fits the buffer. */
if (multibyte
- && NILP (current_buffer->enable_multibyte_characters))
+ && NILP (B_ (current_buffer, enable_multibyte_characters)))
{
EMACS_INT i;
int c, char_bytes;
@@ -7961,7 +7961,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
}
}
else if (! multibyte
- && ! NILP (current_buffer->enable_multibyte_characters))
+ && ! NILP (B_ (current_buffer, enable_multibyte_characters)))
{
EMACS_INT i;
int c, char_bytes;
@@ -8460,7 +8460,7 @@ update_echo_area (void)
Lisp_Object string;
string = Fcurrent_message ();
message3 (string, SBYTES (string),
- !NILP (current_buffer->enable_multibyte_characters));
+ !NILP (B_ (current_buffer, enable_multibyte_characters)));
}
}
@@ -8475,7 +8475,7 @@ ensure_echo_area_buffers (void)
for (i = 0; i < 2; ++i)
if (!BUFFERP (echo_buffer[i])
- || NILP (XBUFFER (echo_buffer[i])->name))
+ || NILP (B_ (XBUFFER (echo_buffer[i]), name)))
{
char name[30];
Lisp_Object old_buffer;
@@ -8484,7 +8484,7 @@ ensure_echo_area_buffers (void)
old_buffer = echo_buffer[i];
sprintf (name, " *Echo Area %d*", i);
echo_buffer[i] = Fget_buffer_create (build_string (name));
- XBUFFER (echo_buffer[i])->truncate_lines = Qnil;
+ B_ (XBUFFER (echo_buffer[i]), truncate_lines) = Qnil;
/* to force word wrap in echo area -
it was decided to postpone this*/
/* XBUFFER (echo_buffer[i])->word_wrap = Qt; */
@@ -8577,8 +8577,8 @@ with_echo_area_buffer (struct window *w, int which,
set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
}
- current_buffer->undo_list = Qt;
- current_buffer->read_only = Qnil;
+ B_ (current_buffer, undo_list) = Qt;
+ B_ (current_buffer, read_only) = Qnil;
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
@@ -8691,7 +8691,7 @@ setup_echo_area_for_printing (int multibyte_p)
/* Switch to that buffer and clear it. */
set_buffer_internal (XBUFFER (echo_area_buffer[0]));
- current_buffer->truncate_lines = Qnil;
+ B_ (current_buffer, truncate_lines) = Qnil;
if (Z > BEG)
{
@@ -8705,7 +8705,7 @@ setup_echo_area_for_printing (int multibyte_p)
/* Set up the buffer for the multibyteness we need. */
if (multibyte_p
- != !NILP (current_buffer->enable_multibyte_characters))
+ != !NILP (B_ (current_buffer, enable_multibyte_characters)))
Fset_buffer_multibyte (multibyte_p ? Qt : Qnil);
/* Raise the frame containing the echo area. */
@@ -8734,7 +8734,7 @@ setup_echo_area_for_printing (int multibyte_p)
{
/* Someone switched buffers between print requests. */
set_buffer_internal (XBUFFER (echo_area_buffer[0]));
- current_buffer->truncate_lines = Qnil;
+ B_ (current_buffer, truncate_lines) = Qnil;
}
}
}
@@ -9177,12 +9177,12 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby
/* Change multibyteness of the echo buffer appropriately. */
if (message_enable_multibyte
- != !NILP (current_buffer->enable_multibyte_characters))
+ != !NILP (B_ (current_buffer, enable_multibyte_characters)))
Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil);
- current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil;
- if (!NILP (current_buffer->bidi_display_reordering))
- current_buffer->bidi_paragraph_direction = Qleft_to_right;
+ B_ (current_buffer, truncate_lines) = message_truncate_lines ? Qt : Qnil;
+ if (!NILP (B_ (current_buffer, bidi_display_reordering)))
+ B_ (current_buffer, bidi_paragraph_direction) = Qleft_to_right;
/* Insert new message at BEG. */
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
if (nbytes == 0)
nbytes = strlen (s);
- if (multibyte_p && NILP (current_buffer->enable_multibyte_characters))
+ if (multibyte_p && NILP (B_ (current_buffer, enable_multibyte_characters)))
{
/* Convert from multi-byte to single-byte. */
EMACS_INT i;
@@ -9223,7 +9223,7 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby
}
}
else if (!multibyte_p
- && !NILP (current_buffer->enable_multibyte_characters))
+ && !NILP (B_ (current_buffer, enable_multibyte_characters)))
{
/* Convert from single-byte to multi-byte. */
EMACS_INT i;
@@ -9808,7 +9808,7 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
< BUF_MODIFF (XBUFFER (w->buffer)))
!= !NILP (w->last_had_star))
|| ((!NILP (Vtransient_mark_mode)
- && !NILP (XBUFFER (w->buffer)->mark_active))
+ && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
!= !NILP (w->region_showing)))
{
struct buffer *prev = current_buffer;
@@ -10006,7 +10006,7 @@ update_tool_bar (struct frame *f, int save_match_data)
< BUF_MODIFF (XBUFFER (w->buffer)))
!= !NILP (w->last_had_star))
|| ((!NILP (Vtransient_mark_mode)
- && !NILP (XBUFFER (w->buffer)->mark_active))
+ && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
!= !NILP (w->region_showing)))
{
struct buffer *prev = current_buffer;
@@ -11097,8 +11097,8 @@ text_outside_line_unchanged_p (struct window *w,
/* If selective display, can't optimize if changes start at the
beginning of the line. */
if (unchanged_p
- && INTEGERP (current_buffer->selective_display)
- && XINT (current_buffer->selective_display) > 0
+ && INTEGERP (B_ (current_buffer, selective_display))
+ && XINT (B_ (current_buffer, selective_display)) > 0
&& (BEG_UNCHANGED < start || GPT <= start))
unchanged_p = 0;
@@ -11126,8 +11126,8 @@ text_outside_line_unchanged_p (struct window *w,
require to redisplay the whole paragraph. It might be worthwhile
to find the paragraph limits and widen the range of redisplayed
lines to that, but for now just give up this optimization. */
- if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
- && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction))
+ if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
+ && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction)))
unchanged_p = 0;
}
@@ -11662,11 +11662,11 @@ redisplay_internal (int preserve_echo_area)
the whole window. The assignment to this_line_start_pos prevents
the optimization directly below this if-statement. */
if (((!NILP (Vtransient_mark_mode)
- && !NILP (XBUFFER (w->buffer)->mark_active))
+ && !NILP (B_ (XBUFFER (w->buffer), mark_active)))
!= !NILP (w->region_showing))
|| (!NILP (w->region_showing)
&& !EQ (w->region_showing,
- Fmarker_position (XBUFFER (w->buffer)->mark))))
+ Fmarker_position (B_ (XBUFFER (w->buffer), mark)))))
CHARPOS (this_line_start_pos) = 0;
/* Optimize the case that only the line containing the cursor in the
@@ -11826,8 +11826,8 @@ redisplay_internal (int preserve_echo_area)
/* If highlighting the region, or if the cursor is in the echo area,
then we can't just move the cursor. */
else if (! (!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
- && (EQ (selected_window, current_buffer->last_selected_window)
+ && !NILP (B_ (current_buffer, mark_active)))
+ && (EQ (selected_window, B_ (current_buffer, last_selected_window))
|| highlight_nonselected_windows)
&& NILP (w->region_showing)
&& NILP (Vshow_trailing_whitespace)
@@ -13033,8 +13033,8 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
scroll_max = (max (scroll_step,
max (arg_scroll_conservatively, temp_scroll_step))
* FRAME_LINE_HEIGHT (f));
- else if (NUMBERP (current_buffer->scroll_down_aggressively)
- || NUMBERP (current_buffer->scroll_up_aggressively))
+ else if (NUMBERP (B_ (current_buffer, scroll_down_aggressively))
+ || NUMBERP (B_ (current_buffer, scroll_up_aggressively)))
/* We're trying to scroll because of aggressive scrolling but no
scroll_step is set. Choose an arbitrary one. */
scroll_max = 10 * FRAME_LINE_HEIGHT (f);
@@ -13099,7 +13099,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
amount_to_scroll = scroll_max;
else
{
- aggressive = current_buffer->scroll_up_aggressively;
+ aggressive = B_ (current_buffer, scroll_up_aggressively);
height = WINDOW_BOX_TEXT_HEIGHT (w);
if (NUMBERP (aggressive))
{
@@ -13182,7 +13182,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
amount_to_scroll = scroll_max;
else
{
- aggressive = current_buffer->scroll_down_aggressively;
+ aggressive = B_ (current_buffer, scroll_down_aggressively);
height = WINDOW_BOX_TEXT_HEIGHT (w);
if (NUMBERP (aggressive))
{
@@ -13363,7 +13363,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
region exists, cursor movement has to do more than just
set the cursor. */
&& !(!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
+ && !NILP (B_ (current_buffer, mark_active)))
&& NILP (w->region_showing)
&& NILP (Vshow_trailing_whitespace)
/* Right after splitting windows, last_point may be nil. */
@@ -13518,7 +13518,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
must_scroll = 1;
}
else if (rc != CURSOR_MOVEMENT_SUCCESS
- && !NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
{
/* If rows are bidi-reordered and point moved, back up
until we find a row that does not belong to a
@@ -13576,7 +13576,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
else if (scroll_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
else if (rc != CURSOR_MOVEMENT_SUCCESS
- && !NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
{
/* With bidi-reordered rows, there could be more than
one candidate row whose start and end positions
@@ -13876,7 +13876,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
struct Lisp_Char_Table *disptab = buffer_display_table ();
if (! disptab_matches_widthtab (disptab,
- XVECTOR (current_buffer->width_table)))
+ XVECTOR (B_ (current_buffer, width_table))))
{
invalidate_region_cache (current_buffer,
current_buffer->width_run_cache,
@@ -13998,7 +13998,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
/* If we are highlighting the region, then we just changed
the region, so redisplay to show it. */
if (!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
+ && !NILP (B_ (current_buffer, mark_active)))
{
clear_glyph_matrix (w->desired_matrix);
if (!try_window (window, startp, 0))
@@ -14161,8 +14161,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
if ((scroll_conservatively
|| emacs_scroll_step
|| temp_scroll_step
- || NUMBERP (current_buffer->scroll_up_aggressively)
- || NUMBERP (current_buffer->scroll_down_aggressively))
+ || NUMBERP (B_ (current_buffer, scroll_up_aggressively))
+ || NUMBERP (B_ (current_buffer, scroll_down_aggressively)))
&& !current_buffer->clip_changed
&& CHARPOS (startp) >= BEGV
&& CHARPOS (startp) <= ZV)
@@ -14605,7 +14605,7 @@ try_window_reusing_current_matrix (struct window *w)
/* Can't do this if region may have changed. */
if ((!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
+ && !NILP (B_ (current_buffer, mark_active)))
|| !NILP (w->region_showing)
|| !NILP (Vshow_trailing_whitespace))
return 0;
@@ -14948,7 +14948,7 @@ try_window_reusing_current_matrix (struct window *w)
/* Can't use this optimization with bidi-reordered glyph
rows, unless cursor is already at point. */
- if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)))
{
if (!(w->cursor.hpos >= 0
&& w->cursor.hpos < row->used[TEXT_AREA]
@@ -15262,7 +15262,7 @@ row_containing_pos (struct window *w, EMACS_INT charpos,
{
struct glyph *g;
- if (NILP (XBUFFER (w->buffer)->bidi_display_reordering)
+ if (NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
|| (!best_row && !row->continued_p))
return row;
/* In bidi-reordered rows, there could be several rows
@@ -15409,7 +15409,7 @@ try_window_id (struct window *w)
/* Can't use this if highlighting a region because a cursor movement
will do more than just set the cursor. */
if (!NILP (Vtransient_mark_mode)
- && !NILP (current_buffer->mark_active))
+ && !NILP (B_ (current_buffer, mark_active)))
GIVE_UP (9);
/* Likewise if highlighting trailing whitespace. */
@@ -15429,7 +15429,7 @@ try_window_id (struct window *w)
wrapped line can change the wrap position, altering the line
above it. It might be worthwhile to handle this more
intelligently, but for now just redisplay from scratch. */
- if (!NILP (XBUFFER (w->buffer)->word_wrap))
+ if (!NILP (B_ (XBUFFER (w->buffer), word_wrap)))
GIVE_UP (21);
/* Under bidi reordering, adding or deleting a character in the
@@ -15440,8 +15440,8 @@ try_window_id (struct window *w)
to find the paragraph limits and widen the range of redisplayed
lines to that, but for now just give up this optimization and
redisplay from scratch. */
- if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
- && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction))
+ if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))
+ && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction)))
GIVE_UP (22);
/* Make sure beg_unchanged and end_unchanged are up to date. Do it
@@ -16412,7 +16412,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
it.glyph_row->used[TEXT_AREA] = 0;
SET_TEXT_POS (it.position, 0, 0);
- multibyte_p = !NILP (buffer->enable_multibyte_characters);
+ multibyte_p = !NILP (B_ (buffer, enable_multibyte_characters));
p = arrow_string;
while (p < arrow_end)
{
@@ -17347,7 +17347,7 @@ display_line (struct it *it)
row->glyphs[TEXT_AREA]->charpos = -1;
row->displays_text_p = 0;
- if (!NILP (XBUFFER (it->w->buffer)->indicate_empty_lines)
+ if (!NILP (B_ (XBUFFER (it->w->buffer), indicate_empty_lines))
&& (!MINI_WINDOW_P (it->w)
|| (minibuf_level && EQ (it->window, minibuf_window))))
row->indicate_empty_line_p = 1;
@@ -17925,10 +17925,10 @@ See also `bidi-paragraph-direction'. */)
old = current_buffer;
}
- if (NILP (buf->bidi_display_reordering))
+ if (NILP (B_ (buf, bidi_display_reordering)))
return Qleft_to_right;
- else if (!NILP (buf->bidi_paragraph_direction))
- return buf->bidi_paragraph_direction;
+ else if (!NILP (B_ (buf, bidi_paragraph_direction)))
+ return B_ (buf, bidi_paragraph_direction);
else
{
/* Determine the direction from buffer text. We could try to
@@ -18187,14 +18187,14 @@ display_mode_lines (struct window *w)
/* Select mode line face based on the real selected window. */
display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w),
- current_buffer->mode_line_format);
+ B_ (current_buffer, mode_line_format));
++n;
}
if (WINDOW_WANTS_HEADER_LINE_P (w))
{
display_mode_line (w, HEADER_LINE_FACE_ID,
- current_buffer->header_line_format);
+ B_ (current_buffer, header_line_format));
++n;
}
@@ -19129,7 +19129,7 @@ static char *
decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag)
{
Lisp_Object val;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters));
const unsigned char *eol_str;
int eol_str_len;
/* The EOL conversion we are using. */
@@ -19225,7 +19225,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
switch (c)
{
case '*':
- if (!NILP (b->read_only))
+ if (!NILP (B_ (b, read_only)))
return "%";
if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
return "*";
@@ -19235,7 +19235,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
/* This differs from %* only for a modified read-only buffer. */
if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
return "*";
- if (!NILP (b->read_only))
+ if (!NILP (B_ (b, read_only)))
return "%";
return "-";
@@ -19297,7 +19297,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
}
case 'b':
- obj = b->name;
+ obj = B_ (b, name);
break;
case 'c':
@@ -19337,7 +19337,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
return "Emacs";
case 'f':
- obj = b->filename;
+ obj = B_ (b, filename);
break;
case 'i':
@@ -19473,7 +19473,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
break;
case 'm':
- obj = b->mode_name;
+ obj = B_ (b, mode_name);
break;
case 'n':
@@ -19558,7 +19558,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
{
int count = inhibit_garbage_collection ();
Lisp_Object val = call1 (intern ("file-remote-p"),
- current_buffer->directory);
+ B_ (current_buffer, directory));
unbind_to (count, Qnil);
if (NILP (val))
@@ -19593,7 +19593,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
(FRAME_TERMINAL_CODING (f)->id),
p, 0);
}
- p = decode_mode_spec_coding (b->buffer_file_coding_system,
+ p = decode_mode_spec_coding (B_ (b, buffer_file_coding_system),
p, eol_flag);
#if 0 /* This proves to be annoying; I think we can do without. -- rms. */
@@ -19643,8 +19643,8 @@ display_count_lines (EMACS_INT start, EMACS_INT start_byte,
/* If we are not in selective display mode,
check only for newlines. */
- int selective_display = (!NILP (current_buffer->selective_display)
- && !INTEGERP (current_buffer->selective_display));
+ int selective_display = (!NILP (B_ (current_buffer, selective_display))
+ && !INTEGERP (B_ (current_buffer, selective_display)));
if (count > 0)
{
@@ -23291,13 +23291,13 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
{
if (w == XWINDOW (echo_area_window))
{
- if (EQ (b->cursor_type, Qt) || NILP (b->cursor_type))
+ if (EQ (B_ (b, cursor_type), Qt) || NILP (B_ (b, cursor_type)))
{
*width = FRAME_CURSOR_WIDTH (f);
return FRAME_DESIRED_CURSOR (f);
}
else
- return get_specified_cursor_type (b->cursor_type, width);
+ return get_specified_cursor_type (B_ (b, cursor_type), width);
}
*active_cursor = 0;
@@ -23317,23 +23317,23 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
}
/* Never display a cursor in a window in which cursor-type is nil. */
- if (NILP (b->cursor_type))
+ if (NILP (B_ (b, cursor_type)))
return NO_CURSOR;
/* Get the normal cursor type for this window. */
- if (EQ (b->cursor_type, Qt))
+ if (EQ (B_ (b, cursor_type), Qt))
{
cursor_type = FRAME_DESIRED_CURSOR (f);
*width = FRAME_CURSOR_WIDTH (f);
}
else
- cursor_type = get_specified_cursor_type (b->cursor_type, width);
+ cursor_type = get_specified_cursor_type (B_ (b, cursor_type), width);
/* Use cursor-in-non-selected-windows instead
for non-selected window or frame. */
if (non_selected)
{
- alt_cursor = b->cursor_in_non_selected_windows;
+ alt_cursor = B_ (b, cursor_in_non_selected_windows);
if (!EQ (Qt, alt_cursor))
return get_specified_cursor_type (alt_cursor, width);
/* t means modify the normal cursor type. */
@@ -23380,7 +23380,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
/* Cursor is blinked off, so determine how to "toggle" it. */
/* First look for an entry matching the buffer's cursor-type in blink-cursor-alist. */
- if ((alt_cursor = Fassoc (b->cursor_type, Vblink_cursor_alist), !NILP (alt_cursor)))
+ if ((alt_cursor = Fassoc (B_ (b, cursor_type), Vblink_cursor_alist), !NILP (alt_cursor)))
return get_specified_cursor_type (XCDR (alt_cursor), width);
/* Then see if frame has specified a specific blink off cursor type. */
@@ -25496,11 +25496,11 @@ note_mouse_highlight (struct frame *f, int x, int y)
necessarily display the character whose position
is the smallest. */
Lisp_Object lim1 =
- NILP (XBUFFER (buffer)->bidi_display_reordering)
+ NILP (B_ (XBUFFER (buffer), bidi_display_reordering))
? Fmarker_position (w->start)
: Qnil;
Lisp_Object lim2 =
- NILP (XBUFFER (buffer)->bidi_display_reordering)
+ NILP (B_ (XBUFFER (buffer), bidi_display_reordering))
? make_number (BUF_Z (XBUFFER (buffer))
- XFASTINT (w->window_end_pos))
: Qnil;
diff --git a/src/xfaces.c b/src/xfaces.c
index 82ad0b9aeb6..9ae35a74bd1 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5970,7 +5970,7 @@ compute_char_face (struct frame *f, int ch, Lisp_Object prop)
{
int face_id;
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (B_ (current_buffer, enable_multibyte_characters)))
ch = 0;
if (NILP (prop))
diff --git a/src/xfns.c b/src/xfns.c
index ce2d91e0df1..062bb105d0a 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4610,7 +4610,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (buffer));
- current_buffer->truncate_lines = Qnil;
+ B_ (current_buffer, truncate_lines) = Qnil;
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
@@ -5106,7 +5106,7 @@ Text larger than the specified size is clipped. */)
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
- current_buffer->truncate_lines = Qnil;
+ B_ (current_buffer, truncate_lines) = Qnil;
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);