diff options
| author | Tom Tromey | 2011-02-14 08:39:19 -0700 |
|---|---|---|
| committer | Tom Tromey | 2011-02-14 08:39:19 -0700 |
| commit | 5d8ea1203d1e659bc77d953784a85a6e7da0ce95 (patch) | |
| tree | 1da71b86f9592b2f3390f0cd4d30ce41e74fbb55 /src | |
| parent | 42f6055717e74ea9541c5cf6fd0fc6501bd907fd (diff) | |
| download | emacs-5d8ea1203d1e659bc77d953784a85a6e7da0ce95.tar.gz emacs-5d8ea1203d1e659bc77d953784a85a6e7da0ce95.zip | |
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/ChangeLog | 137 | ||||
| -rw-r--r-- | src/alloc.c | 16 | ||||
| -rw-r--r-- | src/buffer.c | 680 | ||||
| -rw-r--r-- | src/buffer.h | 151 | ||||
| -rw-r--r-- | src/bytecode.c | 2 | ||||
| -rw-r--r-- | src/callint.c | 16 | ||||
| -rw-r--r-- | src/callproc.c | 12 | ||||
| -rw-r--r-- | src/casefiddle.c | 12 | ||||
| -rw-r--r-- | src/casetab.c | 10 | ||||
| -rw-r--r-- | src/category.c | 8 | ||||
| -rw-r--r-- | src/category.h | 2 | ||||
| -rw-r--r-- | src/character.c | 4 | ||||
| -rw-r--r-- | src/character.h | 12 | ||||
| -rw-r--r-- | src/charset.c | 2 | ||||
| -rw-r--r-- | src/cmds.c | 22 | ||||
| -rw-r--r-- | src/coding.c | 36 | ||||
| -rw-r--r-- | src/composite.c | 8 | ||||
| -rw-r--r-- | src/data.c | 24 | ||||
| -rw-r--r-- | src/dispextern.h | 6 | ||||
| -rw-r--r-- | src/dispnew.c | 8 | ||||
| -rw-r--r-- | src/editfns.c | 74 | ||||
| -rw-r--r-- | src/fileio.c | 174 | ||||
| -rw-r--r-- | src/filelock.c | 14 | ||||
| -rw-r--r-- | src/fns.c | 12 | ||||
| -rw-r--r-- | src/font.c | 2 | ||||
| -rw-r--r-- | src/frame.c | 2 | ||||
| -rw-r--r-- | src/fringe.c | 18 | ||||
| -rw-r--r-- | src/indent.c | 62 | ||||
| -rw-r--r-- | src/insdel.c | 56 | ||||
| -rw-r--r-- | src/intervals.c | 4 | ||||
| -rw-r--r-- | src/intervals.h | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 10 | ||||
| -rw-r--r-- | src/keymap.c | 12 | ||||
| -rw-r--r-- | src/lisp.h | 6 | ||||
| -rw-r--r-- | src/lread.c | 16 | ||||
| -rw-r--r-- | src/marker.c | 12 | ||||
| -rw-r--r-- | src/minibuf.c | 22 | ||||
| -rw-r--r-- | src/print.c | 40 | ||||
| -rw-r--r-- | src/process.c | 58 | ||||
| -rw-r--r-- | src/search.c | 48 | ||||
| -rw-r--r-- | src/syntax.c | 16 | ||||
| -rw-r--r-- | src/syntax.h | 6 | ||||
| -rw-r--r-- | src/undo.c | 62 | ||||
| -rw-r--r-- | src/window.c | 60 | ||||
| -rw-r--r-- | src/xdisp.c | 186 | ||||
| -rw-r--r-- | src/xfaces.c | 2 | ||||
| -rw-r--r-- | src/xfns.c | 4 |
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 @@ | |||
| 1 | 2011-02-14 Tom Tromey <tromey@parfait> | ||
| 2 | |||
| 3 | * composite.c (fill_gstring_header) | ||
| 4 | (composition_compute_stop_pos, composition_adjust_point) | ||
| 5 | (Ffind_composition_internal): Use B_. | ||
| 6 | * intervals.c (set_point_both, get_local_map): Use B_. | ||
| 7 | * callproc.c (Fcall_process, Fcall_process_region): Use B_. | ||
| 8 | * process.c (get_process, list_processes_1, Fstart_process) | ||
| 9 | (Fmake_serial_process, Fmake_network_process) | ||
| 10 | (read_process_output, send_process, exec_sentinel) | ||
| 11 | (status_notify, setup_process_coding_systems): Use B_. | ||
| 12 | * bytecode.c (Fbyte_code): Use B_. | ||
| 13 | * syntax.c (update_syntax_table, dec_bytepos, Fsyntax_table) | ||
| 14 | (Fset_syntax_table, Fmodify_syntax_entry, skip_chars) | ||
| 15 | (skip_syntaxes, scan_lists): Use B_. | ||
| 16 | * lread.c (readchar, unreadchar, openp, readevalloop) | ||
| 17 | (Feval_buffer, Feval_region): Use B_. | ||
| 18 | * print.c (printchar, strout, print_string, PRINTDECLARE) | ||
| 19 | (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup) | ||
| 20 | (print_object): Use B_. | ||
| 21 | * font.c (font_at): Use B_. | ||
| 22 | * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use | ||
| 23 | B_. | ||
| 24 | * callint.c (check_mark, Fcall_interactively): Use B_. | ||
| 25 | * editfns.c (region_limit, Fmark_marker, save_excursion_save) | ||
| 26 | (save_excursion_restore, Fprevious_char, Fchar_before) | ||
| 27 | (general_insert_function, Finsert_char, Finsert_byte) | ||
| 28 | (make_buffer_string_both, Finsert_buffer_substring) | ||
| 29 | (Fcompare_buffer_substrings, subst_char_in_region_unwind) | ||
| 30 | (subst_char_in_region_unwind_1, Fsubst_char_in_region) | ||
| 31 | (Ftranslate_region_internal, save_restriction_restore) | ||
| 32 | (Fchar_equal): Use B_. | ||
| 33 | * data.c (swap_in_symval_forwarding, set_internal) | ||
| 34 | (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p): | ||
| 35 | Use B_. | ||
| 36 | * undo.c (record_point, record_insert, record_delete) | ||
| 37 | (record_marker_adjustment, record_first_change) | ||
| 38 | (record_property_change, Fundo_boundary, truncate_undo_list) | ||
| 39 | (Fprimitive_undo): Use B_. | ||
| 40 | * search.c (compile_pattern_1, compile_pattern, looking_at_1) | ||
| 41 | (string_match_1, fast_looking_at, newline_cache_on_off) | ||
| 42 | (search_command, search_buffer, simple_search, boyer_moore) | ||
| 43 | (Freplace_match): Use B_. | ||
| 44 | * indent.c (buffer_display_table, recompute_width_table) | ||
| 45 | (width_run_cache_on_off, current_column, scan_for_column) | ||
| 46 | (Findent_to, position_indentation, compute_motion, vmotion): Use | ||
| 47 | B_. | ||
| 48 | * casefiddle.c (casify_object, casify_region): Use B_. | ||
| 49 | * casetab.c (Fcurrent_case_table, set_case_table): Use B_. | ||
| 50 | * cmds.c (Fself_insert_command, internal_self_insert): Use B_. | ||
| 51 | * fileio.c (Fexpand_file_name, Ffile_directory_p) | ||
| 52 | (Ffile_regular_p, Ffile_selinux_context) | ||
| 53 | (Fset_file_selinux_context, Ffile_modes, Fset_file_modes) | ||
| 54 | (Fset_file_times, Ffile_newer_than_file_p, decide_coding_unwind) | ||
| 55 | (Finsert_file_contents, choose_write_coding_system) | ||
| 56 | (Fwrite_region, build_annotations, Fverify_visited_file_modtime) | ||
| 57 | (Fset_visited_file_modtime, auto_save_error, auto_save_1) | ||
| 58 | (Fdo_auto_save, Fset_buffer_auto_saved): Use B_. | ||
| 59 | * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_. | ||
| 60 | * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) | ||
| 61 | (set_marker_both, set_marker_restricted_both, unchain_marker): Use | ||
| 62 | B_. | ||
| 63 | * insdel.c (check_markers, insert_char, insert_1_both) | ||
| 64 | (insert_from_string_1, insert_from_gap, insert_from_buffer_1) | ||
| 65 | (adjust_after_replace, replace_range, del_range_2) | ||
| 66 | (modify_region, prepare_to_modify_buffer) | ||
| 67 | (Fcombine_after_change_execute): Use B_. | ||
| 68 | * filelock.c (unlock_all_files, Flock_buffer, Funlock_buffer) | ||
| 69 | (unlock_buffer): Use B_. | ||
| 70 | * keymap.c (Flocal_key_binding, Fuse_local_map) | ||
| 71 | (Fcurrent_local_map, push_key_description) | ||
| 72 | (Fdescribe_buffer_bindings): Use B_. | ||
| 73 | * keyboard.c (command_loop_1, read_char_minibuf_menu_prompt) | ||
| 74 | (read_key_sequence): Use B_. | ||
| 75 | * fringe.c (get_logical_cursor_bitmap) | ||
| 76 | (get_logical_fringe_bitmap, update_window_fringes): Use B_. | ||
| 77 | * xfns.c (x_create_tip_frame, Fx_show_tip): Use B_. | ||
| 78 | * xfaces.c (compute_char_face): Use B_. | ||
| 79 | * character.c (chars_in_text, Fget_byte): Use B_. | ||
| 80 | * category.c (check_category_table, Fcategory_table) | ||
| 81 | (Fset_category_table, char_category_set): Use B_. | ||
| 82 | * coding.c (decode_coding, encode_coding) | ||
| 83 | (make_conversion_work_buffer, decode_coding_gap) | ||
| 84 | (decode_coding_object, encode_coding_object) | ||
| 85 | (Fdetect_coding_region, Ffind_coding_systems_region_internal) | ||
| 86 | (Funencodable_char_position, Fcheck_coding_systems_region): Use | ||
| 87 | B_. | ||
| 88 | * charset.c (Ffind_charset_region): Use B_. | ||
| 89 | * window.c (window_display_table, unshow_buffer, window_loop) | ||
| 90 | (window_min_size_2, set_window_buffer, Fset_window_buffer) | ||
| 91 | (select_window, Fforce_window_update, temp_output_buffer_show) | ||
| 92 | (Fset_window_configuration, save_window_save): Use B_. | ||
| 93 | * xdisp.c (pos_visible_p, init_iterator, reseat_1) | ||
| 94 | (message_dolog, update_echo_area, ensure_echo_area_buffers) | ||
| 95 | (with_echo_area_buffer, setup_echo_area_for_printing) | ||
| 96 | (set_message_1, update_menu_bar, update_tool_bar) | ||
| 97 | (text_outside_line_unchanged_p, redisplay_internal) | ||
| 98 | (try_scrolling, try_cursor_movement, redisplay_window) | ||
| 99 | (try_window_reusing_current_matrix, row_containing_pos) | ||
| 100 | (try_window_id, get_overlay_arrow_glyph_row, display_line) | ||
| 101 | (Fcurrent_bidi_paragraph_direction, display_mode_lines) | ||
| 102 | (decode_mode_spec_coding, decode_mode_spec, display_count_lines) | ||
| 103 | (get_window_cursor_type, note_mouse_highlight): Use B_. | ||
| 104 | * frame.c (make_frame_visible_1): Use B_. | ||
| 105 | * dispnew.c (Fframe_or_buffer_changed_p): Use B_. | ||
| 106 | * dispextern.h (WINDOW_WANTS_HEADER_LINE_P) | ||
| 107 | (WINDOW_WANTS_MODELINE_P): Use B_. | ||
| 108 | * syntax.h (Vstandard_syntax_table): Update. | ||
| 109 | (CURRENT_SYNTAX_TABLE, SETUP_BUFFER_SYNTAX_TABLE): Use B_. | ||
| 110 | * intervals.h (TEXT_PROP_MEANS_INVISIBLE): Update. | ||
| 111 | (TEXT_PROP_MEANS_INVISIBLE): Use B_. | ||
| 112 | * character.h (FETCH_CHAR_ADVANCE): Update. | ||
| 113 | (INC_BOTH, ASCII_CHAR_WIDTH, DEC_BOTH): Use B_. | ||
| 114 | * category.h (Vstandard_category_table): Update. | ||
| 115 | * lisp.h (DEFVAR_BUFFER_DEFAULTS): Update for change to field | ||
| 116 | names. | ||
| 117 | (DOWNCASE_TABLE, UPCASE_TABLE): Use B_. | ||
| 118 | * buffer.c (swapfield_): New macro. | ||
| 119 | (Fbuffer_swap_text): Use swapfield_ where appropriate. | ||
| 120 | (Fbuffer_live_p, Fget_file_buffer, get_truename_buffer) | ||
| 121 | (Fget_buffer_create, clone_per_buffer_values) | ||
| 122 | (Fmake_indirect_buffer, reset_buffer) | ||
| 123 | (reset_buffer_local_variables, Fbuffer_name, Fbuffer_file_name) | ||
| 124 | (Fbuffer_local_value, buffer_lisp_local_variables) | ||
| 125 | (Fset_buffer_modified_p, Frestore_buffer_modified_p) | ||
| 126 | (Frename_buffer, Fother_buffer, Fbuffer_enable_undo) | ||
| 127 | (Fkill_buffer, Fset_buffer_major_mode, set_buffer_internal_1) | ||
| 128 | (set_buffer_temp, Fset_buffer, set_buffer_if_live) | ||
| 129 | (Fbarf_if_buffer_read_only, Fbury_buffer, Ferase_buffer) | ||
| 130 | (Fbuffer_swap_text, Fset_buffer_multibyte) | ||
| 131 | (swap_out_buffer_local_variables, record_overlay_string) | ||
| 132 | (overlay_strings, init_buffer_once, init_buffer, syms_of_buffer): | ||
| 133 | Use B_. | ||
| 134 | * buffer.h (struct buffer): Rename all Lisp_Object fields. | ||
| 135 | (BUFFER_INTERNAL_FIELD, B_): New macro. | ||
| 136 | (FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE): Use B_. | ||
| 137 | |||
| 1 | 2011-02-14 Jan Djärv <jan.h.d@swipnet.se> | 138 | 2011-02-14 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 139 | ||
| 3 | * gtkutil.c (xg_tool_bar_menu_proxy): Handle case when tool bar label | 140 | * 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) | |||
| 3886 | must not have been killed. */ | 3886 | must not have been killed. */ |
| 3887 | return (m->type == MEM_TYPE_BUFFER | 3887 | return (m->type == MEM_TYPE_BUFFER |
| 3888 | && p == m->start | 3888 | && p == m->start |
| 3889 | && !NILP (((struct buffer *) p)->name)); | 3889 | && !NILP (((struct buffer *) p)->BUFFER_INTERNAL_FIELD (name))); |
| 3890 | } | 3890 | } |
| 3891 | 3891 | ||
| 3892 | #endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */ | 3892 | #endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */ |
| @@ -4872,11 +4872,11 @@ returns nil, because real GC can't be done. */) | |||
| 4872 | turned off in that buffer. Calling truncate_undo_list on | 4872 | turned off in that buffer. Calling truncate_undo_list on |
| 4873 | Qt tends to return NULL, which effectively turns undo back on. | 4873 | Qt tends to return NULL, which effectively turns undo back on. |
| 4874 | So don't call truncate_undo_list if undo_list is Qt. */ | 4874 | So don't call truncate_undo_list if undo_list is Qt. */ |
| 4875 | if (! NILP (nextb->name) && ! EQ (nextb->undo_list, Qt)) | 4875 | if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) |
| 4876 | truncate_undo_list (nextb); | 4876 | truncate_undo_list (nextb); |
| 4877 | 4877 | ||
| 4878 | /* Shrink buffer gaps, but skip indirect and dead buffers. */ | 4878 | /* Shrink buffer gaps, but skip indirect and dead buffers. */ |
| 4879 | if (nextb->base_buffer == 0 && !NILP (nextb->name) | 4879 | if (nextb->base_buffer == 0 && !NILP (nextb->BUFFER_INTERNAL_FIELD (name)) |
| 4880 | && ! nextb->text->inhibit_shrinking) | 4880 | && ! nextb->text->inhibit_shrinking) |
| 4881 | { | 4881 | { |
| 4882 | /* If a buffer's gap size is more than 10% of the buffer | 4882 | /* 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. */) | |||
| 5009 | turned off in that buffer. Calling truncate_undo_list on | 5009 | turned off in that buffer. Calling truncate_undo_list on |
| 5010 | Qt tends to return NULL, which effectively turns undo back on. | 5010 | Qt tends to return NULL, which effectively turns undo back on. |
| 5011 | So don't call truncate_undo_list if undo_list is Qt. */ | 5011 | So don't call truncate_undo_list if undo_list is Qt. */ |
| 5012 | if (! EQ (nextb->undo_list, Qt)) | 5012 | if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) |
| 5013 | { | 5013 | { |
| 5014 | Lisp_Object tail, prev; | 5014 | Lisp_Object tail, prev; |
| 5015 | tail = nextb->undo_list; | 5015 | tail = nextb->BUFFER_INTERNAL_FIELD (undo_list); |
| 5016 | prev = Qnil; | 5016 | prev = Qnil; |
| 5017 | while (CONSP (tail)) | 5017 | while (CONSP (tail)) |
| 5018 | { | 5018 | { |
| @@ -5021,7 +5021,7 @@ returns nil, because real GC can't be done. */) | |||
| 5021 | && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) | 5021 | && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) |
| 5022 | { | 5022 | { |
| 5023 | if (NILP (prev)) | 5023 | if (NILP (prev)) |
| 5024 | nextb->undo_list = tail = XCDR (tail); | 5024 | nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail); |
| 5025 | else | 5025 | else |
| 5026 | { | 5026 | { |
| 5027 | tail = XCDR (tail); | 5027 | tail = XCDR (tail); |
| @@ -5037,7 +5037,7 @@ returns nil, because real GC can't be done. */) | |||
| 5037 | } | 5037 | } |
| 5038 | /* Now that we have stripped the elements that need not be in the | 5038 | /* Now that we have stripped the elements that need not be in the |
| 5039 | undo_list any more, we can finally mark the list. */ | 5039 | undo_list any more, we can finally mark the list. */ |
| 5040 | mark_object (nextb->undo_list); | 5040 | mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list)); |
| 5041 | 5041 | ||
| 5042 | nextb = nextb->next; | 5042 | nextb = nextb->next; |
| 5043 | } | 5043 | } |
| @@ -5595,7 +5595,7 @@ mark_buffer (Lisp_Object buf) | |||
| 5595 | 5595 | ||
| 5596 | /* buffer-local Lisp variables start at `undo_list', | 5596 | /* buffer-local Lisp variables start at `undo_list', |
| 5597 | tho only the ones from `name' on are GC'd normally. */ | 5597 | tho only the ones from `name' on are GC'd normally. */ |
| 5598 | for (ptr = &buffer->name; | 5598 | for (ptr = &buffer->BUFFER_INTERNAL_FIELD (name); |
| 5599 | (char *)ptr < (char *)buffer + sizeof (struct buffer); | 5599 | (char *)ptr < (char *)buffer + sizeof (struct buffer); |
| 5600 | ptr++) | 5600 | ptr++) |
| 5601 | mark_object (*ptr); | 5601 | 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, | |||
| 162 | Value is nil if OBJECT is not a buffer or if it has been killed. */) | 162 | Value is nil if OBJECT is not a buffer or if it has been killed. */) |
| 163 | (Lisp_Object object) | 163 | (Lisp_Object object) |
| 164 | { | 164 | { |
| 165 | return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name)) | 165 | return ((BUFFERP (object) && ! NILP (B_ (XBUFFER (object), name))) |
| 166 | ? Qt : Qnil); | 166 | ? Qt : Qnil); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| @@ -266,8 +266,8 @@ See also `find-buffer-visiting'. */) | |||
| 266 | { | 266 | { |
| 267 | buf = Fcdr (XCAR (tail)); | 267 | buf = Fcdr (XCAR (tail)); |
| 268 | if (!BUFFERP (buf)) continue; | 268 | if (!BUFFERP (buf)) continue; |
| 269 | if (!STRINGP (XBUFFER (buf)->filename)) continue; | 269 | if (!STRINGP (B_ (XBUFFER (buf), filename))) continue; |
| 270 | tem = Fstring_equal (XBUFFER (buf)->filename, filename); | 270 | tem = Fstring_equal (B_ (XBUFFER (buf), filename), filename); |
| 271 | if (!NILP (tem)) | 271 | if (!NILP (tem)) |
| 272 | return buf; | 272 | return buf; |
| 273 | } | 273 | } |
| @@ -283,8 +283,8 @@ get_truename_buffer (register Lisp_Object filename) | |||
| 283 | { | 283 | { |
| 284 | buf = Fcdr (XCAR (tail)); | 284 | buf = Fcdr (XCAR (tail)); |
| 285 | if (!BUFFERP (buf)) continue; | 285 | if (!BUFFERP (buf)) continue; |
| 286 | if (!STRINGP (XBUFFER (buf)->file_truename)) continue; | 286 | if (!STRINGP (B_ (XBUFFER (buf), file_truename))) continue; |
| 287 | tem = Fstring_equal (XBUFFER (buf)->file_truename, filename); | 287 | tem = Fstring_equal (B_ (XBUFFER (buf), file_truename), filename); |
| 288 | if (!NILP (tem)) | 288 | if (!NILP (tem)) |
| 289 | return buf; | 289 | return buf; |
| 290 | } | 290 | } |
| @@ -353,7 +353,7 @@ even if it is dead. The return value is never nil. */) | |||
| 353 | 353 | ||
| 354 | b->newline_cache = 0; | 354 | b->newline_cache = 0; |
| 355 | b->width_run_cache = 0; | 355 | b->width_run_cache = 0; |
| 356 | b->width_table = Qnil; | 356 | B_ (b, width_table) = Qnil; |
| 357 | b->prevent_redisplay_optimizations_p = 1; | 357 | b->prevent_redisplay_optimizations_p = 1; |
| 358 | 358 | ||
| 359 | /* Put this on the chain of all buffers including killed ones. */ | 359 | /* Put this on the chain of all buffers including killed ones. */ |
| @@ -362,22 +362,22 @@ even if it is dead. The return value is never nil. */) | |||
| 362 | 362 | ||
| 363 | /* An ordinary buffer normally doesn't need markers | 363 | /* An ordinary buffer normally doesn't need markers |
| 364 | to handle BEGV and ZV. */ | 364 | to handle BEGV and ZV. */ |
| 365 | b->pt_marker = Qnil; | 365 | B_ (b, pt_marker) = Qnil; |
| 366 | b->begv_marker = Qnil; | 366 | B_ (b, begv_marker) = Qnil; |
| 367 | b->zv_marker = Qnil; | 367 | B_ (b, zv_marker) = Qnil; |
| 368 | 368 | ||
| 369 | name = Fcopy_sequence (buffer_or_name); | 369 | name = Fcopy_sequence (buffer_or_name); |
| 370 | STRING_SET_INTERVALS (name, NULL_INTERVAL); | 370 | STRING_SET_INTERVALS (name, NULL_INTERVAL); |
| 371 | b->name = name; | 371 | B_ (b, name) = name; |
| 372 | 372 | ||
| 373 | b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt; | 373 | B_ (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt; |
| 374 | 374 | ||
| 375 | reset_buffer (b); | 375 | reset_buffer (b); |
| 376 | reset_buffer_local_variables (b, 1); | 376 | reset_buffer_local_variables (b, 1); |
| 377 | 377 | ||
| 378 | b->mark = Fmake_marker (); | 378 | B_ (b, mark) = Fmake_marker (); |
| 379 | BUF_MARKERS (b) = NULL; | 379 | BUF_MARKERS (b) = NULL; |
| 380 | b->name = name; | 380 | B_ (b, name) = name; |
| 381 | 381 | ||
| 382 | /* Put this in the alist of all live buffers. */ | 382 | /* Put this in the alist of all live buffers. */ |
| 383 | XSETBUFFER (buffer, b); | 383 | XSETBUFFER (buffer, b); |
| @@ -486,7 +486,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) | |||
| 486 | 486 | ||
| 487 | /* Get (a copy of) the alist of Lisp-level local variables of FROM | 487 | /* Get (a copy of) the alist of Lisp-level local variables of FROM |
| 488 | and install that in TO. */ | 488 | and install that in TO. */ |
| 489 | to->local_var_alist = buffer_lisp_local_variables (from); | 489 | B_ (to, local_var_alist) = buffer_lisp_local_variables (from); |
| 490 | } | 490 | } |
| 491 | 491 | ||
| 492 | DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, | 492 | 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. */) | |||
| 512 | base_buffer = Fget_buffer (base_buffer); | 512 | base_buffer = Fget_buffer (base_buffer); |
| 513 | if (NILP (base_buffer)) | 513 | if (NILP (base_buffer)) |
| 514 | error ("No such buffer: `%s'", SDATA (tem)); | 514 | error ("No such buffer: `%s'", SDATA (tem)); |
| 515 | if (NILP (XBUFFER (base_buffer)->name)) | 515 | if (NILP (B_ (XBUFFER (base_buffer), name))) |
| 516 | error ("Base buffer has been killed"); | 516 | error ("Base buffer has been killed"); |
| 517 | 517 | ||
| 518 | if (SCHARS (name) == 0) | 518 | if (SCHARS (name) == 0) |
| @@ -536,7 +536,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 536 | 536 | ||
| 537 | b->newline_cache = 0; | 537 | b->newline_cache = 0; |
| 538 | b->width_run_cache = 0; | 538 | b->width_run_cache = 0; |
| 539 | b->width_table = Qnil; | 539 | B_ (b, width_table) = Qnil; |
| 540 | 540 | ||
| 541 | /* Put this on the chain of all buffers including killed ones. */ | 541 | /* Put this on the chain of all buffers including killed ones. */ |
| 542 | b->next = all_buffers; | 542 | b->next = all_buffers; |
| @@ -544,7 +544,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 544 | 544 | ||
| 545 | name = Fcopy_sequence (name); | 545 | name = Fcopy_sequence (name); |
| 546 | STRING_SET_INTERVALS (name, NULL_INTERVAL); | 546 | STRING_SET_INTERVALS (name, NULL_INTERVAL); |
| 547 | b->name = name; | 547 | B_ (b, name) = name; |
| 548 | 548 | ||
| 549 | reset_buffer (b); | 549 | reset_buffer (b); |
| 550 | reset_buffer_local_variables (b, 1); | 550 | reset_buffer_local_variables (b, 1); |
| @@ -553,57 +553,57 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 553 | XSETBUFFER (buf, b); | 553 | XSETBUFFER (buf, b); |
| 554 | Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); | 554 | Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); |
| 555 | 555 | ||
| 556 | b->mark = Fmake_marker (); | 556 | B_ (b, mark) = Fmake_marker (); |
| 557 | b->name = name; | 557 | B_ (b, name) = name; |
| 558 | 558 | ||
| 559 | /* The multibyte status belongs to the base buffer. */ | 559 | /* The multibyte status belongs to the base buffer. */ |
| 560 | b->enable_multibyte_characters = b->base_buffer->enable_multibyte_characters; | 560 | B_ (b, enable_multibyte_characters) = B_ (b->base_buffer, enable_multibyte_characters); |
| 561 | 561 | ||
| 562 | /* Make sure the base buffer has markers for its narrowing. */ | 562 | /* Make sure the base buffer has markers for its narrowing. */ |
| 563 | if (NILP (b->base_buffer->pt_marker)) | 563 | if (NILP (B_ (b->base_buffer, pt_marker))) |
| 564 | { | 564 | { |
| 565 | b->base_buffer->pt_marker = Fmake_marker (); | 565 | B_ (b->base_buffer, pt_marker) = Fmake_marker (); |
| 566 | set_marker_both (b->base_buffer->pt_marker, base_buffer, | 566 | set_marker_both (B_ (b->base_buffer, pt_marker), base_buffer, |
| 567 | BUF_PT (b->base_buffer), | 567 | BUF_PT (b->base_buffer), |
| 568 | BUF_PT_BYTE (b->base_buffer)); | 568 | BUF_PT_BYTE (b->base_buffer)); |
| 569 | } | 569 | } |
| 570 | if (NILP (b->base_buffer->begv_marker)) | 570 | if (NILP (B_ (b->base_buffer, begv_marker))) |
| 571 | { | 571 | { |
| 572 | b->base_buffer->begv_marker = Fmake_marker (); | 572 | B_ (b->base_buffer, begv_marker) = Fmake_marker (); |
| 573 | set_marker_both (b->base_buffer->begv_marker, base_buffer, | 573 | set_marker_both (B_ (b->base_buffer, begv_marker), base_buffer, |
| 574 | BUF_BEGV (b->base_buffer), | 574 | BUF_BEGV (b->base_buffer), |
| 575 | BUF_BEGV_BYTE (b->base_buffer)); | 575 | BUF_BEGV_BYTE (b->base_buffer)); |
| 576 | } | 576 | } |
| 577 | if (NILP (b->base_buffer->zv_marker)) | 577 | if (NILP (B_ (b->base_buffer, zv_marker))) |
| 578 | { | 578 | { |
| 579 | b->base_buffer->zv_marker = Fmake_marker (); | 579 | B_ (b->base_buffer, zv_marker) = Fmake_marker (); |
| 580 | set_marker_both (b->base_buffer->zv_marker, base_buffer, | 580 | set_marker_both (B_ (b->base_buffer, zv_marker), base_buffer, |
| 581 | BUF_ZV (b->base_buffer), | 581 | BUF_ZV (b->base_buffer), |
| 582 | BUF_ZV_BYTE (b->base_buffer)); | 582 | BUF_ZV_BYTE (b->base_buffer)); |
| 583 | XMARKER (b->base_buffer->zv_marker)->insertion_type = 1; | 583 | XMARKER (B_ (b->base_buffer, zv_marker))->insertion_type = 1; |
| 584 | } | 584 | } |
| 585 | 585 | ||
| 586 | if (NILP (clone)) | 586 | if (NILP (clone)) |
| 587 | { | 587 | { |
| 588 | /* Give the indirect buffer markers for its narrowing. */ | 588 | /* Give the indirect buffer markers for its narrowing. */ |
| 589 | b->pt_marker = Fmake_marker (); | 589 | B_ (b, pt_marker) = Fmake_marker (); |
| 590 | set_marker_both (b->pt_marker, buf, BUF_PT (b), BUF_PT_BYTE (b)); | 590 | set_marker_both (B_ (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b)); |
| 591 | b->begv_marker = Fmake_marker (); | 591 | B_ (b, begv_marker) = Fmake_marker (); |
| 592 | set_marker_both (b->begv_marker, buf, BUF_BEGV (b), BUF_BEGV_BYTE (b)); | 592 | set_marker_both (B_ (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b)); |
| 593 | b->zv_marker = Fmake_marker (); | 593 | B_ (b, zv_marker) = Fmake_marker (); |
| 594 | set_marker_both (b->zv_marker, buf, BUF_ZV (b), BUF_ZV_BYTE (b)); | 594 | set_marker_both (B_ (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b)); |
| 595 | XMARKER (b->zv_marker)->insertion_type = 1; | 595 | XMARKER (B_ (b, zv_marker))->insertion_type = 1; |
| 596 | } | 596 | } |
| 597 | else | 597 | else |
| 598 | { | 598 | { |
| 599 | struct buffer *old_b = current_buffer; | 599 | struct buffer *old_b = current_buffer; |
| 600 | 600 | ||
| 601 | clone_per_buffer_values (b->base_buffer, b); | 601 | clone_per_buffer_values (b->base_buffer, b); |
| 602 | b->filename = Qnil; | 602 | B_ (b, filename) = Qnil; |
| 603 | b->file_truename = Qnil; | 603 | B_ (b, file_truename) = Qnil; |
| 604 | b->display_count = make_number (0); | 604 | B_ (b, display_count) = make_number (0); |
| 605 | b->backed_up = Qnil; | 605 | B_ (b, backed_up) = Qnil; |
| 606 | b->auto_save_file_name = Qnil; | 606 | B_ (b, auto_save_file_name) = Qnil; |
| 607 | set_buffer_internal_1 (b); | 607 | set_buffer_internal_1 (b); |
| 608 | Fset (intern ("buffer-save-without-query"), Qnil); | 608 | Fset (intern ("buffer-save-without-query"), Qnil); |
| 609 | Fset (intern ("buffer-file-number"), Qnil); | 609 | Fset (intern ("buffer-file-number"), Qnil); |
| @@ -647,34 +647,34 @@ delete_all_overlays (struct buffer *b) | |||
| 647 | void | 647 | void |
| 648 | reset_buffer (register struct buffer *b) | 648 | reset_buffer (register struct buffer *b) |
| 649 | { | 649 | { |
| 650 | b->filename = Qnil; | 650 | B_ (b, filename) = Qnil; |
| 651 | b->file_truename = Qnil; | 651 | B_ (b, file_truename) = Qnil; |
| 652 | b->directory = (current_buffer) ? current_buffer->directory : Qnil; | 652 | B_ (b, directory) = (current_buffer) ? B_ (current_buffer, directory) : Qnil; |
| 653 | b->modtime = 0; | 653 | b->modtime = 0; |
| 654 | b->modtime_size = -1; | 654 | b->modtime_size = -1; |
| 655 | XSETFASTINT (b->save_length, 0); | 655 | XSETFASTINT (B_ (b, save_length), 0); |
| 656 | b->last_window_start = 1; | 656 | b->last_window_start = 1; |
| 657 | /* It is more conservative to start out "changed" than "unchanged". */ | 657 | /* It is more conservative to start out "changed" than "unchanged". */ |
| 658 | b->clip_changed = 0; | 658 | b->clip_changed = 0; |
| 659 | b->prevent_redisplay_optimizations_p = 1; | 659 | b->prevent_redisplay_optimizations_p = 1; |
| 660 | b->backed_up = Qnil; | 660 | B_ (b, backed_up) = Qnil; |
| 661 | BUF_AUTOSAVE_MODIFF (b) = 0; | 661 | BUF_AUTOSAVE_MODIFF (b) = 0; |
| 662 | b->auto_save_failure_time = -1; | 662 | b->auto_save_failure_time = -1; |
| 663 | b->auto_save_file_name = Qnil; | 663 | B_ (b, auto_save_file_name) = Qnil; |
| 664 | b->read_only = Qnil; | 664 | B_ (b, read_only) = Qnil; |
| 665 | b->overlays_before = NULL; | 665 | b->overlays_before = NULL; |
| 666 | b->overlays_after = NULL; | 666 | b->overlays_after = NULL; |
| 667 | b->overlay_center = BEG; | 667 | b->overlay_center = BEG; |
| 668 | b->mark_active = Qnil; | 668 | B_ (b, mark_active) = Qnil; |
| 669 | b->point_before_scroll = Qnil; | 669 | B_ (b, point_before_scroll) = Qnil; |
| 670 | b->file_format = Qnil; | 670 | B_ (b, file_format) = Qnil; |
| 671 | b->auto_save_file_format = Qt; | 671 | B_ (b, auto_save_file_format) = Qt; |
| 672 | b->last_selected_window = Qnil; | 672 | B_ (b, last_selected_window) = Qnil; |
| 673 | XSETINT (b->display_count, 0); | 673 | XSETINT (B_ (b, display_count), 0); |
| 674 | b->display_time = Qnil; | 674 | B_ (b, display_time) = Qnil; |
| 675 | b->enable_multibyte_characters = buffer_defaults.enable_multibyte_characters; | 675 | B_ (b, enable_multibyte_characters) = B_ (&buffer_defaults, enable_multibyte_characters); |
| 676 | b->cursor_type = buffer_defaults.cursor_type; | 676 | B_ (b, cursor_type) = B_ (&buffer_defaults, cursor_type); |
| 677 | b->extra_line_spacing = buffer_defaults.extra_line_spacing; | 677 | B_ (b, extra_line_spacing) = B_ (&buffer_defaults, extra_line_spacing); |
| 678 | 678 | ||
| 679 | b->display_error_modiff = 0; | 679 | b->display_error_modiff = 0; |
| 680 | } | 680 | } |
| @@ -698,10 +698,10 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too) | |||
| 698 | things that depend on the major mode. | 698 | things that depend on the major mode. |
| 699 | default-major-mode is handled at a higher level. | 699 | default-major-mode is handled at a higher level. |
| 700 | We ignore it here. */ | 700 | We ignore it here. */ |
| 701 | b->major_mode = Qfundamental_mode; | 701 | B_ (b, major_mode) = Qfundamental_mode; |
| 702 | b->keymap = Qnil; | 702 | B_ (b, keymap) = Qnil; |
| 703 | b->mode_name = QSFundamental; | 703 | B_ (b, mode_name) = QSFundamental; |
| 704 | b->minor_modes = Qnil; | 704 | B_ (b, minor_modes) = Qnil; |
| 705 | 705 | ||
| 706 | /* If the standard case table has been altered and invalidated, | 706 | /* If the standard case table has been altered and invalidated, |
| 707 | fix up its insides first. */ | 707 | fix up its insides first. */ |
| @@ -710,22 +710,22 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too) | |||
| 710 | && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2]))) | 710 | && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2]))) |
| 711 | Fset_standard_case_table (Vascii_downcase_table); | 711 | Fset_standard_case_table (Vascii_downcase_table); |
| 712 | 712 | ||
| 713 | b->downcase_table = Vascii_downcase_table; | 713 | B_ (b, downcase_table) = Vascii_downcase_table; |
| 714 | b->upcase_table = XCHAR_TABLE (Vascii_downcase_table)->extras[0]; | 714 | B_ (b, upcase_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[0]; |
| 715 | b->case_canon_table = XCHAR_TABLE (Vascii_downcase_table)->extras[1]; | 715 | B_ (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1]; |
| 716 | b->case_eqv_table = XCHAR_TABLE (Vascii_downcase_table)->extras[2]; | 716 | B_ (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2]; |
| 717 | b->invisibility_spec = Qt; | 717 | B_ (b, invisibility_spec) = Qt; |
| 718 | #ifndef DOS_NT | 718 | #ifndef DOS_NT |
| 719 | b->buffer_file_type = Qnil; | 719 | B_ (b, buffer_file_type) = Qnil; |
| 720 | #endif | 720 | #endif |
| 721 | 721 | ||
| 722 | /* Reset all (or most) per-buffer variables to their defaults. */ | 722 | /* Reset all (or most) per-buffer variables to their defaults. */ |
| 723 | if (permanent_too) | 723 | if (permanent_too) |
| 724 | b->local_var_alist = Qnil; | 724 | B_ (b, local_var_alist) = Qnil; |
| 725 | else | 725 | else |
| 726 | { | 726 | { |
| 727 | Lisp_Object tmp, prop, last = Qnil; | 727 | Lisp_Object tmp, prop, last = Qnil; |
| 728 | for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp)) | 728 | for (tmp = B_ (b, local_var_alist); CONSP (tmp); tmp = XCDR (tmp)) |
| 729 | if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local))) | 729 | if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local))) |
| 730 | { | 730 | { |
| 731 | /* If permanent-local, keep it. */ | 731 | /* If permanent-local, keep it. */ |
| @@ -755,7 +755,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too) | |||
| 755 | } | 755 | } |
| 756 | /* Delete this local variable. */ | 756 | /* Delete this local variable. */ |
| 757 | else if (NILP (last)) | 757 | else if (NILP (last)) |
| 758 | b->local_var_alist = XCDR (tmp); | 758 | B_ (b, local_var_alist) = XCDR (tmp); |
| 759 | else | 759 | else |
| 760 | XSETCDR (last, XCDR (tmp)); | 760 | XSETCDR (last, XCDR (tmp)); |
| 761 | } | 761 | } |
| @@ -830,9 +830,9 @@ Return nil if BUFFER has been killed. */) | |||
| 830 | (register Lisp_Object buffer) | 830 | (register Lisp_Object buffer) |
| 831 | { | 831 | { |
| 832 | if (NILP (buffer)) | 832 | if (NILP (buffer)) |
| 833 | return current_buffer->name; | 833 | return B_ (current_buffer, name); |
| 834 | CHECK_BUFFER (buffer); | 834 | CHECK_BUFFER (buffer); |
| 835 | return XBUFFER (buffer)->name; | 835 | return B_ (XBUFFER (buffer), name); |
| 836 | } | 836 | } |
| 837 | 837 | ||
| 838 | DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0, | 838 | 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. */) | |||
| 841 | (register Lisp_Object buffer) | 841 | (register Lisp_Object buffer) |
| 842 | { | 842 | { |
| 843 | if (NILP (buffer)) | 843 | if (NILP (buffer)) |
| 844 | return current_buffer->filename; | 844 | return B_ (current_buffer, filename); |
| 845 | CHECK_BUFFER (buffer); | 845 | CHECK_BUFFER (buffer); |
| 846 | return XBUFFER (buffer)->filename; | 846 | return B_ (XBUFFER (buffer), filename); |
| 847 | } | 847 | } |
| 848 | 848 | ||
| 849 | DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer, | 849 | DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer, |
| @@ -895,7 +895,7 @@ is the default binding of the variable. */) | |||
| 895 | { /* Look in local_var_alist. */ | 895 | { /* Look in local_var_alist. */ |
| 896 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); | 896 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); |
| 897 | XSETSYMBOL (variable, sym); /* Update In case of aliasing. */ | 897 | XSETSYMBOL (variable, sym); /* Update In case of aliasing. */ |
| 898 | result = Fassoc (variable, buf->local_var_alist); | 898 | result = Fassoc (variable, B_ (buf, local_var_alist)); |
| 899 | if (!NILP (result)) | 899 | if (!NILP (result)) |
| 900 | { | 900 | { |
| 901 | if (blv->fwd) | 901 | if (blv->fwd) |
| @@ -944,7 +944,7 @@ buffer_lisp_local_variables (struct buffer *buf) | |||
| 944 | { | 944 | { |
| 945 | Lisp_Object result = Qnil; | 945 | Lisp_Object result = Qnil; |
| 946 | register Lisp_Object tail; | 946 | register Lisp_Object tail; |
| 947 | for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | 947 | for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) |
| 948 | { | 948 | { |
| 949 | Lisp_Object val, elt; | 949 | Lisp_Object val, elt; |
| 950 | 950 | ||
| @@ -1043,9 +1043,9 @@ A non-nil FLAG means mark the buffer modified. */) | |||
| 1043 | /* If buffer becoming modified, lock the file. | 1043 | /* If buffer becoming modified, lock the file. |
| 1044 | If buffer becoming unmodified, unlock the file. */ | 1044 | If buffer becoming unmodified, unlock the file. */ |
| 1045 | 1045 | ||
| 1046 | fn = current_buffer->file_truename; | 1046 | fn = B_ (current_buffer, file_truename); |
| 1047 | /* Test buffer-file-name so that binding it to nil is effective. */ | 1047 | /* Test buffer-file-name so that binding it to nil is effective. */ |
| 1048 | if (!NILP (fn) && ! NILP (current_buffer->filename)) | 1048 | if (!NILP (fn) && ! NILP (B_ (current_buffer, filename))) |
| 1049 | { | 1049 | { |
| 1050 | already = SAVE_MODIFF < MODIFF; | 1050 | already = SAVE_MODIFF < MODIFF; |
| 1051 | if (!already && !NILP (flag)) | 1051 | if (!already && !NILP (flag)) |
| @@ -1110,9 +1110,9 @@ state of the current buffer. Use with care. */) | |||
| 1110 | /* If buffer becoming modified, lock the file. | 1110 | /* If buffer becoming modified, lock the file. |
| 1111 | If buffer becoming unmodified, unlock the file. */ | 1111 | If buffer becoming unmodified, unlock the file. */ |
| 1112 | 1112 | ||
| 1113 | fn = current_buffer->file_truename; | 1113 | fn = B_ (current_buffer, file_truename); |
| 1114 | /* Test buffer-file-name so that binding it to nil is effective. */ | 1114 | /* Test buffer-file-name so that binding it to nil is effective. */ |
| 1115 | if (!NILP (fn) && ! NILP (current_buffer->filename)) | 1115 | if (!NILP (fn) && ! NILP (B_ (current_buffer, filename))) |
| 1116 | { | 1116 | { |
| 1117 | int already = SAVE_MODIFF < MODIFF; | 1117 | int already = SAVE_MODIFF < MODIFF; |
| 1118 | if (!already && !NILP (flag)) | 1118 | if (!already && !NILP (flag)) |
| @@ -1199,14 +1199,14 @@ This does not change the name of the visited file (if any). */) | |||
| 1199 | with the original name. It makes UNIQUE equivalent to | 1199 | with the original name. It makes UNIQUE equivalent to |
| 1200 | (rename-buffer (generate-new-buffer-name NEWNAME)). */ | 1200 | (rename-buffer (generate-new-buffer-name NEWNAME)). */ |
| 1201 | if (NILP (unique) && XBUFFER (tem) == current_buffer) | 1201 | if (NILP (unique) && XBUFFER (tem) == current_buffer) |
| 1202 | return current_buffer->name; | 1202 | return B_ (current_buffer, name); |
| 1203 | if (!NILP (unique)) | 1203 | if (!NILP (unique)) |
| 1204 | newname = Fgenerate_new_buffer_name (newname, current_buffer->name); | 1204 | newname = Fgenerate_new_buffer_name (newname, B_ (current_buffer, name)); |
| 1205 | else | 1205 | else |
| 1206 | error ("Buffer name `%s' is in use", SDATA (newname)); | 1206 | error ("Buffer name `%s' is in use", SDATA (newname)); |
| 1207 | } | 1207 | } |
| 1208 | 1208 | ||
| 1209 | current_buffer->name = newname; | 1209 | B_ (current_buffer, name) = newname; |
| 1210 | 1210 | ||
| 1211 | /* Catch redisplay's attention. Unless we do this, the mode lines for | 1211 | /* Catch redisplay's attention. Unless we do this, the mode lines for |
| 1212 | any windows displaying current_buffer will stay unchanged. */ | 1212 | any windows displaying current_buffer will stay unchanged. */ |
| @@ -1214,11 +1214,11 @@ This does not change the name of the visited file (if any). */) | |||
| 1214 | 1214 | ||
| 1215 | XSETBUFFER (buf, current_buffer); | 1215 | XSETBUFFER (buf, current_buffer); |
| 1216 | Fsetcar (Frassq (buf, Vbuffer_alist), newname); | 1216 | Fsetcar (Frassq (buf, Vbuffer_alist), newname); |
| 1217 | if (NILP (current_buffer->filename) | 1217 | if (NILP (B_ (current_buffer, filename)) |
| 1218 | && !NILP (current_buffer->auto_save_file_name)) | 1218 | && !NILP (B_ (current_buffer, auto_save_file_name))) |
| 1219 | call0 (intern ("rename-auto-save-file")); | 1219 | call0 (intern ("rename-auto-save-file")); |
| 1220 | /* Refetch since that last call may have done GC. */ | 1220 | /* Refetch since that last call may have done GC. */ |
| 1221 | return current_buffer->name; | 1221 | return B_ (current_buffer, name); |
| 1222 | } | 1222 | } |
| 1223 | 1223 | ||
| 1224 | DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0, | 1224 | 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. */) | |||
| 1263 | continue; | 1263 | continue; |
| 1264 | if (NILP (buf)) | 1264 | if (NILP (buf)) |
| 1265 | continue; | 1265 | continue; |
| 1266 | if (NILP (XBUFFER (buf)->name)) | 1266 | if (NILP (B_ (XBUFFER (buf), name))) |
| 1267 | continue; | 1267 | continue; |
| 1268 | if (SREF (XBUFFER (buf)->name, 0) == ' ') | 1268 | if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') |
| 1269 | continue; | 1269 | continue; |
| 1270 | /* If the selected frame has a buffer_predicate, | 1270 | /* If the selected frame has a buffer_predicate, |
| 1271 | disregard buffers that don't fit the predicate. */ | 1271 | 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. */) | |||
| 1313 | nsberror (buffer); | 1313 | nsberror (buffer); |
| 1314 | } | 1314 | } |
| 1315 | 1315 | ||
| 1316 | if (EQ (XBUFFER (real_buffer)->undo_list, Qt)) | 1316 | if (EQ (B_ (XBUFFER (real_buffer), undo_list), Qt)) |
| 1317 | XBUFFER (real_buffer)->undo_list = Qnil; | 1317 | B_ (XBUFFER (real_buffer), undo_list) = Qnil; |
| 1318 | 1318 | ||
| 1319 | return Qnil; | 1319 | return Qnil; |
| 1320 | } | 1320 | } |
| @@ -1359,16 +1359,16 @@ with SIGHUP. */) | |||
| 1359 | b = XBUFFER (buffer); | 1359 | b = XBUFFER (buffer); |
| 1360 | 1360 | ||
| 1361 | /* Avoid trouble for buffer already dead. */ | 1361 | /* Avoid trouble for buffer already dead. */ |
| 1362 | if (NILP (b->name)) | 1362 | if (NILP (B_ (b, name))) |
| 1363 | return Qnil; | 1363 | return Qnil; |
| 1364 | 1364 | ||
| 1365 | /* Query if the buffer is still modified. */ | 1365 | /* Query if the buffer is still modified. */ |
| 1366 | if (INTERACTIVE && !NILP (b->filename) | 1366 | if (INTERACTIVE && !NILP (B_ (b, filename)) |
| 1367 | && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) | 1367 | && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) |
| 1368 | { | 1368 | { |
| 1369 | GCPRO1 (buffer); | 1369 | GCPRO1 (buffer); |
| 1370 | tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ", | 1370 | tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ", |
| 1371 | b->name, make_number (0))); | 1371 | B_ (b, name), make_number (0))); |
| 1372 | UNGCPRO; | 1372 | UNGCPRO; |
| 1373 | if (NILP (tem)) | 1373 | if (NILP (tem)) |
| 1374 | return Qnil; | 1374 | return Qnil; |
| @@ -1402,7 +1402,7 @@ with SIGHUP. */) | |||
| 1402 | if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) | 1402 | if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) |
| 1403 | return Qnil; | 1403 | return Qnil; |
| 1404 | 1404 | ||
| 1405 | if (NILP (b->name)) | 1405 | if (NILP (B_ (b, name))) |
| 1406 | return Qnil; | 1406 | return Qnil; |
| 1407 | 1407 | ||
| 1408 | /* When we kill a base buffer, kill all its indirect buffers. | 1408 | /* When we kill a base buffer, kill all its indirect buffers. |
| @@ -1417,7 +1417,7 @@ with SIGHUP. */) | |||
| 1417 | for (other = all_buffers; other; other = other->next) | 1417 | for (other = all_buffers; other; other = other->next) |
| 1418 | /* all_buffers contains dead buffers too; | 1418 | /* all_buffers contains dead buffers too; |
| 1419 | don't re-kill them. */ | 1419 | don't re-kill them. */ |
| 1420 | if (other->base_buffer == b && !NILP (other->name)) | 1420 | if (other->base_buffer == b && !NILP (B_ (other, name))) |
| 1421 | { | 1421 | { |
| 1422 | Lisp_Object buffer; | 1422 | Lisp_Object buffer; |
| 1423 | XSETBUFFER (buffer, other); | 1423 | XSETBUFFER (buffer, other); |
| @@ -1462,7 +1462,7 @@ with SIGHUP. */) | |||
| 1462 | /* Killing buffer processes may run sentinels which may | 1462 | /* Killing buffer processes may run sentinels which may |
| 1463 | have called kill-buffer. */ | 1463 | have called kill-buffer. */ |
| 1464 | 1464 | ||
| 1465 | if (NILP (b->name)) | 1465 | if (NILP (B_ (b, name))) |
| 1466 | return Qnil; | 1466 | return Qnil; |
| 1467 | 1467 | ||
| 1468 | clear_charpos_cache (b); | 1468 | clear_charpos_cache (b); |
| @@ -1476,7 +1476,7 @@ with SIGHUP. */) | |||
| 1476 | 1476 | ||
| 1477 | /* Delete any auto-save file, if we saved it in this session. | 1477 | /* Delete any auto-save file, if we saved it in this session. |
| 1478 | But not if the buffer is modified. */ | 1478 | But not if the buffer is modified. */ |
| 1479 | if (STRINGP (b->auto_save_file_name) | 1479 | if (STRINGP (B_ (b, auto_save_file_name)) |
| 1480 | && BUF_AUTOSAVE_MODIFF (b) != 0 | 1480 | && BUF_AUTOSAVE_MODIFF (b) != 0 |
| 1481 | && BUF_SAVE_MODIFF (b) < BUF_AUTOSAVE_MODIFF (b) | 1481 | && BUF_SAVE_MODIFF (b) < BUF_AUTOSAVE_MODIFF (b) |
| 1482 | && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) | 1482 | && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) |
| @@ -1485,7 +1485,7 @@ with SIGHUP. */) | |||
| 1485 | Lisp_Object tem; | 1485 | Lisp_Object tem; |
| 1486 | tem = Fsymbol_value (intern ("delete-auto-save-files")); | 1486 | tem = Fsymbol_value (intern ("delete-auto-save-files")); |
| 1487 | if (! NILP (tem)) | 1487 | if (! NILP (tem)) |
| 1488 | internal_delete_file (b->auto_save_file_name); | 1488 | internal_delete_file (B_ (b, auto_save_file_name)); |
| 1489 | } | 1489 | } |
| 1490 | 1490 | ||
| 1491 | if (b->base_buffer) | 1491 | if (b->base_buffer) |
| @@ -1525,7 +1525,7 @@ with SIGHUP. */) | |||
| 1525 | swap_out_buffer_local_variables (b); | 1525 | swap_out_buffer_local_variables (b); |
| 1526 | reset_buffer_local_variables (b, 1); | 1526 | reset_buffer_local_variables (b, 1); |
| 1527 | 1527 | ||
| 1528 | b->name = Qnil; | 1528 | B_ (b, name) = Qnil; |
| 1529 | 1529 | ||
| 1530 | BLOCK_INPUT; | 1530 | BLOCK_INPUT; |
| 1531 | if (! b->base_buffer) | 1531 | if (! b->base_buffer) |
| @@ -1541,9 +1541,9 @@ with SIGHUP. */) | |||
| 1541 | free_region_cache (b->width_run_cache); | 1541 | free_region_cache (b->width_run_cache); |
| 1542 | b->width_run_cache = 0; | 1542 | b->width_run_cache = 0; |
| 1543 | } | 1543 | } |
| 1544 | b->width_table = Qnil; | 1544 | B_ (b, width_table) = Qnil; |
| 1545 | UNBLOCK_INPUT; | 1545 | UNBLOCK_INPUT; |
| 1546 | b->undo_list = Qnil; | 1546 | B_ (b, undo_list) = Qnil; |
| 1547 | 1547 | ||
| 1548 | return Qt; | 1548 | return Qt; |
| 1549 | } | 1549 | } |
| @@ -1637,15 +1637,15 @@ the current buffer's major mode. */) | |||
| 1637 | 1637 | ||
| 1638 | CHECK_BUFFER (buffer); | 1638 | CHECK_BUFFER (buffer); |
| 1639 | 1639 | ||
| 1640 | if (STRINGP (XBUFFER (buffer)->name) | 1640 | if (STRINGP (B_ (XBUFFER (buffer), name)) |
| 1641 | && strcmp (SSDATA (XBUFFER (buffer)->name), "*scratch*") == 0) | 1641 | && strcmp (SSDATA (B_ (XBUFFER (buffer), name)), "*scratch*") == 0) |
| 1642 | function = find_symbol_value (intern ("initial-major-mode")); | 1642 | function = find_symbol_value (intern ("initial-major-mode")); |
| 1643 | else | 1643 | else |
| 1644 | { | 1644 | { |
| 1645 | function = buffer_defaults.major_mode; | 1645 | function = B_ (&buffer_defaults, major_mode); |
| 1646 | if (NILP (function) | 1646 | if (NILP (function) |
| 1647 | && NILP (Fget (current_buffer->major_mode, Qmode_class))) | 1647 | && NILP (Fget (B_ (current_buffer, major_mode), Qmode_class))) |
| 1648 | function = current_buffer->major_mode; | 1648 | function = B_ (current_buffer, major_mode); |
| 1649 | } | 1649 | } |
| 1650 | 1650 | ||
| 1651 | if (NILP (function) || EQ (function, Qfundamental_mode)) | 1651 | if (NILP (function) || EQ (function, Qfundamental_mode)) |
| @@ -1795,29 +1795,29 @@ set_buffer_internal_1 (register struct buffer *b) | |||
| 1795 | /* Put the undo list back in the base buffer, so that it appears | 1795 | /* Put the undo list back in the base buffer, so that it appears |
| 1796 | that an indirect buffer shares the undo list of its base. */ | 1796 | that an indirect buffer shares the undo list of its base. */ |
| 1797 | if (old_buf->base_buffer) | 1797 | if (old_buf->base_buffer) |
| 1798 | old_buf->base_buffer->undo_list = old_buf->undo_list; | 1798 | B_ (old_buf->base_buffer, undo_list) = B_ (old_buf, undo_list); |
| 1799 | 1799 | ||
| 1800 | /* If the old current buffer has markers to record PT, BEGV and ZV | 1800 | /* If the old current buffer has markers to record PT, BEGV and ZV |
| 1801 | when it is not current, update them now. */ | 1801 | when it is not current, update them now. */ |
| 1802 | if (! NILP (old_buf->pt_marker)) | 1802 | if (! NILP (B_ (old_buf, pt_marker))) |
| 1803 | { | 1803 | { |
| 1804 | Lisp_Object obuf; | 1804 | Lisp_Object obuf; |
| 1805 | XSETBUFFER (obuf, old_buf); | 1805 | XSETBUFFER (obuf, old_buf); |
| 1806 | set_marker_both (old_buf->pt_marker, obuf, | 1806 | set_marker_both (B_ (old_buf, pt_marker), obuf, |
| 1807 | BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); | 1807 | BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); |
| 1808 | } | 1808 | } |
| 1809 | if (! NILP (old_buf->begv_marker)) | 1809 | if (! NILP (B_ (old_buf, begv_marker))) |
| 1810 | { | 1810 | { |
| 1811 | Lisp_Object obuf; | 1811 | Lisp_Object obuf; |
| 1812 | XSETBUFFER (obuf, old_buf); | 1812 | XSETBUFFER (obuf, old_buf); |
| 1813 | set_marker_both (old_buf->begv_marker, obuf, | 1813 | set_marker_both (B_ (old_buf, begv_marker), obuf, |
| 1814 | BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); | 1814 | BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); |
| 1815 | } | 1815 | } |
| 1816 | if (! NILP (old_buf->zv_marker)) | 1816 | if (! NILP (B_ (old_buf, zv_marker))) |
| 1817 | { | 1817 | { |
| 1818 | Lisp_Object obuf; | 1818 | Lisp_Object obuf; |
| 1819 | XSETBUFFER (obuf, old_buf); | 1819 | XSETBUFFER (obuf, old_buf); |
| 1820 | set_marker_both (old_buf->zv_marker, obuf, | 1820 | set_marker_both (B_ (old_buf, zv_marker), obuf, |
| 1821 | BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); | 1821 | BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); |
| 1822 | } | 1822 | } |
| 1823 | } | 1823 | } |
| @@ -1825,24 +1825,24 @@ set_buffer_internal_1 (register struct buffer *b) | |||
| 1825 | /* Get the undo list from the base buffer, so that it appears | 1825 | /* Get the undo list from the base buffer, so that it appears |
| 1826 | that an indirect buffer shares the undo list of its base. */ | 1826 | that an indirect buffer shares the undo list of its base. */ |
| 1827 | if (b->base_buffer) | 1827 | if (b->base_buffer) |
| 1828 | b->undo_list = b->base_buffer->undo_list; | 1828 | B_ (b, undo_list) = B_ (b->base_buffer, undo_list); |
| 1829 | 1829 | ||
| 1830 | /* If the new current buffer has markers to record PT, BEGV and ZV | 1830 | /* If the new current buffer has markers to record PT, BEGV and ZV |
| 1831 | when it is not current, fetch them now. */ | 1831 | when it is not current, fetch them now. */ |
| 1832 | if (! NILP (b->pt_marker)) | 1832 | if (! NILP (B_ (b, pt_marker))) |
| 1833 | { | 1833 | { |
| 1834 | BUF_PT (b) = marker_position (b->pt_marker); | 1834 | BUF_PT (b) = marker_position (B_ (b, pt_marker)); |
| 1835 | BUF_PT_BYTE (b) = marker_byte_position (b->pt_marker); | 1835 | BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker)); |
| 1836 | } | 1836 | } |
| 1837 | if (! NILP (b->begv_marker)) | 1837 | if (! NILP (B_ (b, begv_marker))) |
| 1838 | { | 1838 | { |
| 1839 | BUF_BEGV (b) = marker_position (b->begv_marker); | 1839 | BUF_BEGV (b) = marker_position (B_ (b, begv_marker)); |
| 1840 | BUF_BEGV_BYTE (b) = marker_byte_position (b->begv_marker); | 1840 | BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker)); |
| 1841 | } | 1841 | } |
| 1842 | if (! NILP (b->zv_marker)) | 1842 | if (! NILP (B_ (b, zv_marker))) |
| 1843 | { | 1843 | { |
| 1844 | BUF_ZV (b) = marker_position (b->zv_marker); | 1844 | BUF_ZV (b) = marker_position (B_ (b, zv_marker)); |
| 1845 | BUF_ZV_BYTE (b) = marker_byte_position (b->zv_marker); | 1845 | BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker)); |
| 1846 | } | 1846 | } |
| 1847 | 1847 | ||
| 1848 | /* Look down buffer's list of local Lisp variables | 1848 | /* Look down buffer's list of local Lisp variables |
| @@ -1850,7 +1850,7 @@ set_buffer_internal_1 (register struct buffer *b) | |||
| 1850 | 1850 | ||
| 1851 | do | 1851 | do |
| 1852 | { | 1852 | { |
| 1853 | for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) | 1853 | for (tail = B_ (b, local_var_alist); CONSP (tail); tail = XCDR (tail)) |
| 1854 | { | 1854 | { |
| 1855 | Lisp_Object var = XCAR (XCAR (tail)); | 1855 | Lisp_Object var = XCAR (XCAR (tail)); |
| 1856 | struct Lisp_Symbol *sym = XSYMBOL (var); | 1856 | struct Lisp_Symbol *sym = XSYMBOL (var); |
| @@ -1883,45 +1883,45 @@ set_buffer_temp (struct buffer *b) | |||
| 1883 | { | 1883 | { |
| 1884 | /* If the old current buffer has markers to record PT, BEGV and ZV | 1884 | /* If the old current buffer has markers to record PT, BEGV and ZV |
| 1885 | when it is not current, update them now. */ | 1885 | when it is not current, update them now. */ |
| 1886 | if (! NILP (old_buf->pt_marker)) | 1886 | if (! NILP (B_ (old_buf, pt_marker))) |
| 1887 | { | 1887 | { |
| 1888 | Lisp_Object obuf; | 1888 | Lisp_Object obuf; |
| 1889 | XSETBUFFER (obuf, old_buf); | 1889 | XSETBUFFER (obuf, old_buf); |
| 1890 | set_marker_both (old_buf->pt_marker, obuf, | 1890 | set_marker_both (B_ (old_buf, pt_marker), obuf, |
| 1891 | BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); | 1891 | BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); |
| 1892 | } | 1892 | } |
| 1893 | if (! NILP (old_buf->begv_marker)) | 1893 | if (! NILP (B_ (old_buf, begv_marker))) |
| 1894 | { | 1894 | { |
| 1895 | Lisp_Object obuf; | 1895 | Lisp_Object obuf; |
| 1896 | XSETBUFFER (obuf, old_buf); | 1896 | XSETBUFFER (obuf, old_buf); |
| 1897 | set_marker_both (old_buf->begv_marker, obuf, | 1897 | set_marker_both (B_ (old_buf, begv_marker), obuf, |
| 1898 | BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); | 1898 | BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); |
| 1899 | } | 1899 | } |
| 1900 | if (! NILP (old_buf->zv_marker)) | 1900 | if (! NILP (B_ (old_buf, zv_marker))) |
| 1901 | { | 1901 | { |
| 1902 | Lisp_Object obuf; | 1902 | Lisp_Object obuf; |
| 1903 | XSETBUFFER (obuf, old_buf); | 1903 | XSETBUFFER (obuf, old_buf); |
| 1904 | set_marker_both (old_buf->zv_marker, obuf, | 1904 | set_marker_both (B_ (old_buf, zv_marker), obuf, |
| 1905 | BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); | 1905 | BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); |
| 1906 | } | 1906 | } |
| 1907 | } | 1907 | } |
| 1908 | 1908 | ||
| 1909 | /* If the new current buffer has markers to record PT, BEGV and ZV | 1909 | /* If the new current buffer has markers to record PT, BEGV and ZV |
| 1910 | when it is not current, fetch them now. */ | 1910 | when it is not current, fetch them now. */ |
| 1911 | if (! NILP (b->pt_marker)) | 1911 | if (! NILP (B_ (b, pt_marker))) |
| 1912 | { | 1912 | { |
| 1913 | BUF_PT (b) = marker_position (b->pt_marker); | 1913 | BUF_PT (b) = marker_position (B_ (b, pt_marker)); |
| 1914 | BUF_PT_BYTE (b) = marker_byte_position (b->pt_marker); | 1914 | BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker)); |
| 1915 | } | 1915 | } |
| 1916 | if (! NILP (b->begv_marker)) | 1916 | if (! NILP (B_ (b, begv_marker))) |
| 1917 | { | 1917 | { |
| 1918 | BUF_BEGV (b) = marker_position (b->begv_marker); | 1918 | BUF_BEGV (b) = marker_position (B_ (b, begv_marker)); |
| 1919 | BUF_BEGV_BYTE (b) = marker_byte_position (b->begv_marker); | 1919 | BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker)); |
| 1920 | } | 1920 | } |
| 1921 | if (! NILP (b->zv_marker)) | 1921 | if (! NILP (B_ (b, zv_marker))) |
| 1922 | { | 1922 | { |
| 1923 | BUF_ZV (b) = marker_position (b->zv_marker); | 1923 | BUF_ZV (b) = marker_position (B_ (b, zv_marker)); |
| 1924 | BUF_ZV_BYTE (b) = marker_byte_position (b->zv_marker); | 1924 | BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker)); |
| 1925 | } | 1925 | } |
| 1926 | } | 1926 | } |
| 1927 | 1927 | ||
| @@ -1938,7 +1938,7 @@ ends when the current command terminates. Use `switch-to-buffer' or | |||
| 1938 | buffer = Fget_buffer (buffer_or_name); | 1938 | buffer = Fget_buffer (buffer_or_name); |
| 1939 | if (NILP (buffer)) | 1939 | if (NILP (buffer)) |
| 1940 | nsberror (buffer_or_name); | 1940 | nsberror (buffer_or_name); |
| 1941 | if (NILP (XBUFFER (buffer)->name)) | 1941 | if (NILP (B_ (XBUFFER (buffer), name))) |
| 1942 | error ("Selecting deleted buffer"); | 1942 | error ("Selecting deleted buffer"); |
| 1943 | set_buffer_internal (XBUFFER (buffer)); | 1943 | set_buffer_internal (XBUFFER (buffer)); |
| 1944 | return buffer; | 1944 | return buffer; |
| @@ -1949,7 +1949,7 @@ ends when the current command terminates. Use `switch-to-buffer' or | |||
| 1949 | Lisp_Object | 1949 | Lisp_Object |
| 1950 | set_buffer_if_live (Lisp_Object buffer) | 1950 | set_buffer_if_live (Lisp_Object buffer) |
| 1951 | { | 1951 | { |
| 1952 | if (! NILP (XBUFFER (buffer)->name)) | 1952 | if (! NILP (B_ (XBUFFER (buffer), name))) |
| 1953 | Fset_buffer (buffer); | 1953 | Fset_buffer (buffer); |
| 1954 | return Qnil; | 1954 | return Qnil; |
| 1955 | } | 1955 | } |
| @@ -1959,7 +1959,7 @@ DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only, | |||
| 1959 | doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) | 1959 | doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) |
| 1960 | (void) | 1960 | (void) |
| 1961 | { | 1961 | { |
| 1962 | if (!NILP (current_buffer->read_only) | 1962 | if (!NILP (B_ (current_buffer, read_only)) |
| 1963 | && NILP (Vinhibit_read_only)) | 1963 | && NILP (Vinhibit_read_only)) |
| 1964 | xsignal1 (Qbuffer_read_only, Fcurrent_buffer ()); | 1964 | xsignal1 (Qbuffer_read_only, Fcurrent_buffer ()); |
| 1965 | return Qnil; | 1965 | return Qnil; |
| @@ -2008,7 +2008,7 @@ its frame, iconify that frame. */) | |||
| 2008 | 2008 | ||
| 2009 | /* Move buffer to the end of the buffer list. Do nothing if the | 2009 | /* Move buffer to the end of the buffer list. Do nothing if the |
| 2010 | buffer is killed. */ | 2010 | buffer is killed. */ |
| 2011 | if (!NILP (XBUFFER (buffer)->name)) | 2011 | if (!NILP (B_ (XBUFFER (buffer), name))) |
| 2012 | { | 2012 | { |
| 2013 | Lisp_Object aelt, link; | 2013 | Lisp_Object aelt, link; |
| 2014 | 2014 | ||
| @@ -2041,7 +2041,7 @@ so the buffer is truly empty after this. */) | |||
| 2041 | /* Prevent warnings, or suspension of auto saving, that would happen | 2041 | /* Prevent warnings, or suspension of auto saving, that would happen |
| 2042 | if future size is less than past size. Use of erase-buffer | 2042 | if future size is less than past size. Use of erase-buffer |
| 2043 | implies that the future text is not really related to the past text. */ | 2043 | implies that the future text is not really related to the past text. */ |
| 2044 | XSETFASTINT (current_buffer->save_length, 0); | 2044 | XSETFASTINT (B_ (current_buffer, save_length), 0); |
| 2045 | return Qnil; | 2045 | return Qnil; |
| 2046 | } | 2046 | } |
| 2047 | 2047 | ||
| @@ -2111,7 +2111,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | |||
| 2111 | CHECK_BUFFER (buffer); | 2111 | CHECK_BUFFER (buffer); |
| 2112 | other_buffer = XBUFFER (buffer); | 2112 | other_buffer = XBUFFER (buffer); |
| 2113 | 2113 | ||
| 2114 | if (NILP (other_buffer->name)) | 2114 | if (NILP (B_ (other_buffer, name))) |
| 2115 | error ("Cannot swap a dead buffer's text"); | 2115 | error ("Cannot swap a dead buffer's text"); |
| 2116 | 2116 | ||
| 2117 | /* Actually, it probably works just fine. | 2117 | /* Actually, it probably works just fine. |
| @@ -2138,6 +2138,12 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | |||
| 2138 | other_buffer->field = current_buffer->field; \ | 2138 | other_buffer->field = current_buffer->field; \ |
| 2139 | current_buffer->field = tmp##field; \ | 2139 | current_buffer->field = tmp##field; \ |
| 2140 | } while (0) | 2140 | } while (0) |
| 2141 | #define swapfield_(field, type) \ | ||
| 2142 | do { \ | ||
| 2143 | type tmp##field = B_ (other_buffer, field); \ | ||
| 2144 | B_ (other_buffer, field) = B_ (current_buffer, field); \ | ||
| 2145 | B_ (current_buffer, field) = tmp##field; \ | ||
| 2146 | } while (0) | ||
| 2141 | 2147 | ||
| 2142 | swapfield (own_text, struct buffer_text); | 2148 | swapfield (own_text, struct buffer_text); |
| 2143 | eassert (current_buffer->text == ¤t_buffer->own_text); | 2149 | eassert (current_buffer->text == ¤t_buffer->own_text); |
| @@ -2165,18 +2171,18 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | |||
| 2165 | swapfield (overlays_before, struct Lisp_Overlay *); | 2171 | swapfield (overlays_before, struct Lisp_Overlay *); |
| 2166 | swapfield (overlays_after, struct Lisp_Overlay *); | 2172 | swapfield (overlays_after, struct Lisp_Overlay *); |
| 2167 | swapfield (overlay_center, EMACS_INT); | 2173 | swapfield (overlay_center, EMACS_INT); |
| 2168 | swapfield (undo_list, Lisp_Object); | 2174 | swapfield_ (undo_list, Lisp_Object); |
| 2169 | swapfield (mark, Lisp_Object); | 2175 | swapfield_ (mark, Lisp_Object); |
| 2170 | swapfield (enable_multibyte_characters, Lisp_Object); | 2176 | swapfield_ (enable_multibyte_characters, Lisp_Object); |
| 2171 | swapfield (bidi_display_reordering, Lisp_Object); | 2177 | swapfield_ (bidi_display_reordering, Lisp_Object); |
| 2172 | swapfield (bidi_paragraph_direction, Lisp_Object); | 2178 | swapfield_ (bidi_paragraph_direction, Lisp_Object); |
| 2173 | /* FIXME: Not sure what we should do with these *_marker fields. | 2179 | /* FIXME: Not sure what we should do with these *_marker fields. |
| 2174 | Hopefully they're just nil anyway. */ | 2180 | Hopefully they're just nil anyway. */ |
| 2175 | swapfield (pt_marker, Lisp_Object); | 2181 | swapfield_ (pt_marker, Lisp_Object); |
| 2176 | swapfield (begv_marker, Lisp_Object); | 2182 | swapfield_ (begv_marker, Lisp_Object); |
| 2177 | swapfield (zv_marker, Lisp_Object); | 2183 | swapfield_ (zv_marker, Lisp_Object); |
| 2178 | current_buffer->point_before_scroll = Qnil; | 2184 | B_ (current_buffer, point_before_scroll) = Qnil; |
| 2179 | other_buffer->point_before_scroll = Qnil; | 2185 | B_ (other_buffer, point_before_scroll) = Qnil; |
| 2180 | 2186 | ||
| 2181 | current_buffer->text->modiff++; other_buffer->text->modiff++; | 2187 | current_buffer->text->modiff++; other_buffer->text->modiff++; |
| 2182 | current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++; | 2188 | current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++; |
| @@ -2250,21 +2256,21 @@ current buffer is cleared. */) | |||
| 2250 | EMACS_INT begv, zv; | 2256 | EMACS_INT begv, zv; |
| 2251 | int narrowed = (BEG != BEGV || Z != ZV); | 2257 | int narrowed = (BEG != BEGV || Z != ZV); |
| 2252 | int modified_p = !NILP (Fbuffer_modified_p (Qnil)); | 2258 | int modified_p = !NILP (Fbuffer_modified_p (Qnil)); |
| 2253 | Lisp_Object old_undo = current_buffer->undo_list; | 2259 | Lisp_Object old_undo = B_ (current_buffer, undo_list); |
| 2254 | struct gcpro gcpro1; | 2260 | struct gcpro gcpro1; |
| 2255 | 2261 | ||
| 2256 | if (current_buffer->base_buffer) | 2262 | if (current_buffer->base_buffer) |
| 2257 | error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); | 2263 | error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); |
| 2258 | 2264 | ||
| 2259 | /* Do nothing if nothing actually changes. */ | 2265 | /* Do nothing if nothing actually changes. */ |
| 2260 | if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters)) | 2266 | if (NILP (flag) == NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 2261 | return flag; | 2267 | return flag; |
| 2262 | 2268 | ||
| 2263 | GCPRO1 (old_undo); | 2269 | GCPRO1 (old_undo); |
| 2264 | 2270 | ||
| 2265 | /* Don't record these buffer changes. We will put a special undo entry | 2271 | /* Don't record these buffer changes. We will put a special undo entry |
| 2266 | instead. */ | 2272 | instead. */ |
| 2267 | current_buffer->undo_list = Qt; | 2273 | B_ (current_buffer, undo_list) = Qt; |
| 2268 | 2274 | ||
| 2269 | /* If the cached position is for this buffer, clear it out. */ | 2275 | /* If the cached position is for this buffer, clear it out. */ |
| 2270 | clear_charpos_cache (current_buffer); | 2276 | clear_charpos_cache (current_buffer); |
| @@ -2286,7 +2292,7 @@ current buffer is cleared. */) | |||
| 2286 | to calculate the old correspondences. */ | 2292 | to calculate the old correspondences. */ |
| 2287 | set_intervals_multibyte (0); | 2293 | set_intervals_multibyte (0); |
| 2288 | 2294 | ||
| 2289 | current_buffer->enable_multibyte_characters = Qnil; | 2295 | B_ (current_buffer, enable_multibyte_characters) = Qnil; |
| 2290 | 2296 | ||
| 2291 | Z = Z_BYTE; | 2297 | Z = Z_BYTE; |
| 2292 | BEGV = BEGV_BYTE; | 2298 | BEGV = BEGV_BYTE; |
| @@ -2424,7 +2430,7 @@ current buffer is cleared. */) | |||
| 2424 | 2430 | ||
| 2425 | /* Do this first, so that chars_in_text asks the right question. | 2431 | /* Do this first, so that chars_in_text asks the right question. |
| 2426 | set_intervals_multibyte needs it too. */ | 2432 | set_intervals_multibyte needs it too. */ |
| 2427 | current_buffer->enable_multibyte_characters = Qt; | 2433 | B_ (current_buffer, enable_multibyte_characters) = Qt; |
| 2428 | 2434 | ||
| 2429 | GPT_BYTE = advance_to_char_boundary (GPT_BYTE); | 2435 | GPT_BYTE = advance_to_char_boundary (GPT_BYTE); |
| 2430 | GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG; | 2436 | GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG; |
| @@ -2482,7 +2488,7 @@ current buffer is cleared. */) | |||
| 2482 | if (!EQ (old_undo, Qt)) | 2488 | if (!EQ (old_undo, Qt)) |
| 2483 | { | 2489 | { |
| 2484 | /* Represent all the above changes by a special undo entry. */ | 2490 | /* Represent all the above changes by a special undo entry. */ |
| 2485 | current_buffer->undo_list = Fcons (list3 (Qapply, | 2491 | B_ (current_buffer, undo_list) = Fcons (list3 (Qapply, |
| 2486 | intern ("set-buffer-multibyte"), | 2492 | intern ("set-buffer-multibyte"), |
| 2487 | NILP (flag) ? Qt : Qnil), | 2493 | NILP (flag) ? Qt : Qnil), |
| 2488 | old_undo); | 2494 | old_undo); |
| @@ -2498,10 +2504,10 @@ current buffer is cleared. */) | |||
| 2498 | /* Copy this buffer's new multibyte status | 2504 | /* Copy this buffer's new multibyte status |
| 2499 | into all of its indirect buffers. */ | 2505 | into all of its indirect buffers. */ |
| 2500 | for (other = all_buffers; other; other = other->next) | 2506 | for (other = all_buffers; other; other = other->next) |
| 2501 | if (other->base_buffer == current_buffer && !NILP (other->name)) | 2507 | if (other->base_buffer == current_buffer && !NILP (B_ (other, name))) |
| 2502 | { | 2508 | { |
| 2503 | other->enable_multibyte_characters | 2509 | B_ (other, enable_multibyte_characters) |
| 2504 | = current_buffer->enable_multibyte_characters; | 2510 | = B_ (current_buffer, enable_multibyte_characters); |
| 2505 | other->prevent_redisplay_optimizations_p = 1; | 2511 | other->prevent_redisplay_optimizations_p = 1; |
| 2506 | } | 2512 | } |
| 2507 | 2513 | ||
| @@ -2568,7 +2574,7 @@ swap_out_buffer_local_variables (struct buffer *b) | |||
| 2568 | Lisp_Object oalist, alist, buffer; | 2574 | Lisp_Object oalist, alist, buffer; |
| 2569 | 2575 | ||
| 2570 | XSETBUFFER (buffer, b); | 2576 | XSETBUFFER (buffer, b); |
| 2571 | oalist = b->local_var_alist; | 2577 | oalist = B_ (b, local_var_alist); |
| 2572 | 2578 | ||
| 2573 | for (alist = oalist; CONSP (alist); alist = XCDR (alist)) | 2579 | for (alist = oalist; CONSP (alist); alist = XCDR (alist)) |
| 2574 | { | 2580 | { |
| @@ -3072,7 +3078,7 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str | |||
| 3072 | ssl->buf[ssl->used].priority = (INTEGERP (pri) ? XINT (pri) : 0); | 3078 | ssl->buf[ssl->used].priority = (INTEGERP (pri) ? XINT (pri) : 0); |
| 3073 | ssl->used++; | 3079 | ssl->used++; |
| 3074 | 3080 | ||
| 3075 | if (NILP (current_buffer->enable_multibyte_characters)) | 3081 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 3076 | nbytes = SCHARS (str); | 3082 | nbytes = SCHARS (str); |
| 3077 | else if (! STRING_MULTIBYTE (str)) | 3083 | else if (! STRING_MULTIBYTE (str)) |
| 3078 | nbytes = count_size_as_multibyte (SDATA (str), | 3084 | nbytes = count_size_as_multibyte (SDATA (str), |
| @@ -3084,7 +3090,7 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str | |||
| 3084 | 3090 | ||
| 3085 | if (STRINGP (str2)) | 3091 | if (STRINGP (str2)) |
| 3086 | { | 3092 | { |
| 3087 | if (NILP (current_buffer->enable_multibyte_characters)) | 3093 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 3088 | nbytes = SCHARS (str2); | 3094 | nbytes = SCHARS (str2); |
| 3089 | else if (! STRING_MULTIBYTE (str2)) | 3095 | else if (! STRING_MULTIBYTE (str2)) |
| 3090 | nbytes = count_size_as_multibyte (SDATA (str2), | 3096 | nbytes = count_size_as_multibyte (SDATA (str2), |
| @@ -3114,7 +3120,7 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr) | |||
| 3114 | Lisp_Object overlay, window, str; | 3120 | Lisp_Object overlay, window, str; |
| 3115 | struct Lisp_Overlay *ov; | 3121 | struct Lisp_Overlay *ov; |
| 3116 | EMACS_INT startpos, endpos; | 3122 | EMACS_INT startpos, endpos; |
| 3117 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 3123 | int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 3118 | 3124 | ||
| 3119 | overlay_heads.used = overlay_heads.bytes = 0; | 3125 | overlay_heads.used = overlay_heads.bytes = 0; |
| 3120 | overlay_tails.used = overlay_tails.bytes = 0; | 3126 | overlay_tails.used = overlay_tails.bytes = 0; |
| @@ -4985,9 +4991,9 @@ init_buffer_once (void) | |||
| 4985 | /* Make sure all markable slots in buffer_defaults | 4991 | /* Make sure all markable slots in buffer_defaults |
| 4986 | are initialized reasonably, so mark_buffer won't choke. */ | 4992 | are initialized reasonably, so mark_buffer won't choke. */ |
| 4987 | reset_buffer (&buffer_defaults); | 4993 | reset_buffer (&buffer_defaults); |
| 4988 | eassert (EQ (buffer_defaults.name, make_number (0))); | 4994 | eassert (EQ (B_ (&buffer_defaults, name), make_number (0))); |
| 4989 | reset_buffer_local_variables (&buffer_defaults, 1); | 4995 | reset_buffer_local_variables (&buffer_defaults, 1); |
| 4990 | eassert (EQ (buffer_local_symbols.name, make_number (0))); | 4996 | eassert (EQ (B_ (&buffer_local_symbols, name), make_number (0))); |
| 4991 | reset_buffer (&buffer_local_symbols); | 4997 | reset_buffer (&buffer_local_symbols); |
| 4992 | reset_buffer_local_variables (&buffer_local_symbols, 1); | 4998 | reset_buffer_local_variables (&buffer_local_symbols, 1); |
| 4993 | /* Prevent GC from getting confused. */ | 4999 | /* Prevent GC from getting confused. */ |
| @@ -5004,60 +5010,60 @@ init_buffer_once (void) | |||
| 5004 | /* Must do these before making the first buffer! */ | 5010 | /* Must do these before making the first buffer! */ |
| 5005 | 5011 | ||
| 5006 | /* real setup is done in bindings.el */ | 5012 | /* real setup is done in bindings.el */ |
| 5007 | buffer_defaults.mode_line_format = make_pure_c_string ("%-"); | 5013 | B_ (&buffer_defaults, mode_line_format) = make_pure_c_string ("%-"); |
| 5008 | buffer_defaults.header_line_format = Qnil; | 5014 | B_ (&buffer_defaults, header_line_format) = Qnil; |
| 5009 | buffer_defaults.abbrev_mode = Qnil; | 5015 | B_ (&buffer_defaults, abbrev_mode) = Qnil; |
| 5010 | buffer_defaults.overwrite_mode = Qnil; | 5016 | B_ (&buffer_defaults, overwrite_mode) = Qnil; |
| 5011 | buffer_defaults.case_fold_search = Qt; | 5017 | B_ (&buffer_defaults, case_fold_search) = Qt; |
| 5012 | buffer_defaults.auto_fill_function = Qnil; | 5018 | B_ (&buffer_defaults, auto_fill_function) = Qnil; |
| 5013 | buffer_defaults.selective_display = Qnil; | 5019 | B_ (&buffer_defaults, selective_display) = Qnil; |
| 5014 | #ifndef old | 5020 | #ifndef old |
| 5015 | buffer_defaults.selective_display_ellipses = Qt; | 5021 | B_ (&buffer_defaults, selective_display_ellipses) = Qt; |
| 5016 | #endif | 5022 | #endif |
| 5017 | buffer_defaults.abbrev_table = Qnil; | 5023 | B_ (&buffer_defaults, abbrev_table) = Qnil; |
| 5018 | buffer_defaults.display_table = Qnil; | 5024 | B_ (&buffer_defaults, display_table) = Qnil; |
| 5019 | buffer_defaults.undo_list = Qnil; | 5025 | B_ (&buffer_defaults, undo_list) = Qnil; |
| 5020 | buffer_defaults.mark_active = Qnil; | 5026 | B_ (&buffer_defaults, mark_active) = Qnil; |
| 5021 | buffer_defaults.file_format = Qnil; | 5027 | B_ (&buffer_defaults, file_format) = Qnil; |
| 5022 | buffer_defaults.auto_save_file_format = Qt; | 5028 | B_ (&buffer_defaults, auto_save_file_format) = Qt; |
| 5023 | buffer_defaults.overlays_before = NULL; | 5029 | buffer_defaults.overlays_before = NULL; |
| 5024 | buffer_defaults.overlays_after = NULL; | 5030 | buffer_defaults.overlays_after = NULL; |
| 5025 | buffer_defaults.overlay_center = BEG; | 5031 | buffer_defaults.overlay_center = BEG; |
| 5026 | 5032 | ||
| 5027 | XSETFASTINT (buffer_defaults.tab_width, 8); | 5033 | XSETFASTINT (B_ (&buffer_defaults, tab_width), 8); |
| 5028 | buffer_defaults.truncate_lines = Qnil; | 5034 | B_ (&buffer_defaults, truncate_lines) = Qnil; |
| 5029 | buffer_defaults.word_wrap = Qnil; | 5035 | B_ (&buffer_defaults, word_wrap) = Qnil; |
| 5030 | buffer_defaults.ctl_arrow = Qt; | 5036 | B_ (&buffer_defaults, ctl_arrow) = Qt; |
| 5031 | buffer_defaults.bidi_display_reordering = Qnil; | 5037 | B_ (&buffer_defaults, bidi_display_reordering) = Qnil; |
| 5032 | buffer_defaults.bidi_paragraph_direction = Qnil; | 5038 | B_ (&buffer_defaults, bidi_paragraph_direction) = Qnil; |
| 5033 | buffer_defaults.cursor_type = Qt; | 5039 | B_ (&buffer_defaults, cursor_type) = Qt; |
| 5034 | buffer_defaults.extra_line_spacing = Qnil; | 5040 | B_ (&buffer_defaults, extra_line_spacing) = Qnil; |
| 5035 | buffer_defaults.cursor_in_non_selected_windows = Qt; | 5041 | B_ (&buffer_defaults, cursor_in_non_selected_windows) = Qt; |
| 5036 | 5042 | ||
| 5037 | #ifdef DOS_NT | 5043 | #ifdef DOS_NT |
| 5038 | buffer_defaults.buffer_file_type = Qnil; /* TEXT */ | 5044 | buffer_defaults.buffer_file_type = Qnil; /* TEXT */ |
| 5039 | #endif | 5045 | #endif |
| 5040 | buffer_defaults.enable_multibyte_characters = Qt; | 5046 | B_ (&buffer_defaults, enable_multibyte_characters) = Qt; |
| 5041 | buffer_defaults.buffer_file_coding_system = Qnil; | 5047 | B_ (&buffer_defaults, buffer_file_coding_system) = Qnil; |
| 5042 | XSETFASTINT (buffer_defaults.fill_column, 70); | 5048 | XSETFASTINT (B_ (&buffer_defaults, fill_column), 70); |
| 5043 | XSETFASTINT (buffer_defaults.left_margin, 0); | 5049 | XSETFASTINT (B_ (&buffer_defaults, left_margin), 0); |
| 5044 | buffer_defaults.cache_long_line_scans = Qnil; | 5050 | B_ (&buffer_defaults, cache_long_line_scans) = Qnil; |
| 5045 | buffer_defaults.file_truename = Qnil; | 5051 | B_ (&buffer_defaults, file_truename) = Qnil; |
| 5046 | XSETFASTINT (buffer_defaults.display_count, 0); | 5052 | XSETFASTINT (B_ (&buffer_defaults, display_count), 0); |
| 5047 | XSETFASTINT (buffer_defaults.left_margin_cols, 0); | 5053 | XSETFASTINT (B_ (&buffer_defaults, left_margin_cols), 0); |
| 5048 | XSETFASTINT (buffer_defaults.right_margin_cols, 0); | 5054 | XSETFASTINT (B_ (&buffer_defaults, right_margin_cols), 0); |
| 5049 | buffer_defaults.left_fringe_width = Qnil; | 5055 | B_ (&buffer_defaults, left_fringe_width) = Qnil; |
| 5050 | buffer_defaults.right_fringe_width = Qnil; | 5056 | B_ (&buffer_defaults, right_fringe_width) = Qnil; |
| 5051 | buffer_defaults.fringes_outside_margins = Qnil; | 5057 | B_ (&buffer_defaults, fringes_outside_margins) = Qnil; |
| 5052 | buffer_defaults.scroll_bar_width = Qnil; | 5058 | B_ (&buffer_defaults, scroll_bar_width) = Qnil; |
| 5053 | buffer_defaults.vertical_scroll_bar_type = Qt; | 5059 | B_ (&buffer_defaults, vertical_scroll_bar_type) = Qt; |
| 5054 | buffer_defaults.indicate_empty_lines = Qnil; | 5060 | B_ (&buffer_defaults, indicate_empty_lines) = Qnil; |
| 5055 | buffer_defaults.indicate_buffer_boundaries = Qnil; | 5061 | B_ (&buffer_defaults, indicate_buffer_boundaries) = Qnil; |
| 5056 | buffer_defaults.fringe_indicator_alist = Qnil; | 5062 | B_ (&buffer_defaults, fringe_indicator_alist) = Qnil; |
| 5057 | buffer_defaults.fringe_cursor_alist = Qnil; | 5063 | B_ (&buffer_defaults, fringe_cursor_alist) = Qnil; |
| 5058 | buffer_defaults.scroll_up_aggressively = Qnil; | 5064 | B_ (&buffer_defaults, scroll_up_aggressively) = Qnil; |
| 5059 | buffer_defaults.scroll_down_aggressively = Qnil; | 5065 | B_ (&buffer_defaults, scroll_down_aggressively) = Qnil; |
| 5060 | buffer_defaults.display_time = Qnil; | 5066 | B_ (&buffer_defaults, display_time) = Qnil; |
| 5061 | 5067 | ||
| 5062 | /* Assign the local-flags to the slots that have default values. | 5068 | /* Assign the local-flags to the slots that have default values. |
| 5063 | The local flag is a bit that is used in the buffer | 5069 | The local flag is a bit that is used in the buffer |
| @@ -5069,73 +5075,73 @@ init_buffer_once (void) | |||
| 5069 | 5075 | ||
| 5070 | /* 0 means not a lisp var, -1 means always local, else mask */ | 5076 | /* 0 means not a lisp var, -1 means always local, else mask */ |
| 5071 | memset (&buffer_local_flags, 0, sizeof buffer_local_flags); | 5077 | memset (&buffer_local_flags, 0, sizeof buffer_local_flags); |
| 5072 | XSETINT (buffer_local_flags.filename, -1); | 5078 | XSETINT (B_ (&buffer_local_flags, filename), -1); |
| 5073 | XSETINT (buffer_local_flags.directory, -1); | 5079 | XSETINT (B_ (&buffer_local_flags, directory), -1); |
| 5074 | XSETINT (buffer_local_flags.backed_up, -1); | 5080 | XSETINT (B_ (&buffer_local_flags, backed_up), -1); |
| 5075 | XSETINT (buffer_local_flags.save_length, -1); | 5081 | XSETINT (B_ (&buffer_local_flags, save_length), -1); |
| 5076 | XSETINT (buffer_local_flags.auto_save_file_name, -1); | 5082 | XSETINT (B_ (&buffer_local_flags, auto_save_file_name), -1); |
| 5077 | XSETINT (buffer_local_flags.read_only, -1); | 5083 | XSETINT (B_ (&buffer_local_flags, read_only), -1); |
| 5078 | XSETINT (buffer_local_flags.major_mode, -1); | 5084 | XSETINT (B_ (&buffer_local_flags, major_mode), -1); |
| 5079 | XSETINT (buffer_local_flags.mode_name, -1); | 5085 | XSETINT (B_ (&buffer_local_flags, mode_name), -1); |
| 5080 | XSETINT (buffer_local_flags.undo_list, -1); | 5086 | XSETINT (B_ (&buffer_local_flags, undo_list), -1); |
| 5081 | XSETINT (buffer_local_flags.mark_active, -1); | 5087 | XSETINT (B_ (&buffer_local_flags, mark_active), -1); |
| 5082 | XSETINT (buffer_local_flags.point_before_scroll, -1); | 5088 | XSETINT (B_ (&buffer_local_flags, point_before_scroll), -1); |
| 5083 | XSETINT (buffer_local_flags.file_truename, -1); | 5089 | XSETINT (B_ (&buffer_local_flags, file_truename), -1); |
| 5084 | XSETINT (buffer_local_flags.invisibility_spec, -1); | 5090 | XSETINT (B_ (&buffer_local_flags, invisibility_spec), -1); |
| 5085 | XSETINT (buffer_local_flags.file_format, -1); | 5091 | XSETINT (B_ (&buffer_local_flags, file_format), -1); |
| 5086 | XSETINT (buffer_local_flags.auto_save_file_format, -1); | 5092 | XSETINT (B_ (&buffer_local_flags, auto_save_file_format), -1); |
| 5087 | XSETINT (buffer_local_flags.display_count, -1); | 5093 | XSETINT (B_ (&buffer_local_flags, display_count), -1); |
| 5088 | XSETINT (buffer_local_flags.display_time, -1); | 5094 | XSETINT (B_ (&buffer_local_flags, display_time), -1); |
| 5089 | XSETINT (buffer_local_flags.enable_multibyte_characters, -1); | 5095 | XSETINT (B_ (&buffer_local_flags, enable_multibyte_characters), -1); |
| 5090 | 5096 | ||
| 5091 | idx = 1; | 5097 | idx = 1; |
| 5092 | XSETFASTINT (buffer_local_flags.mode_line_format, idx); ++idx; | 5098 | XSETFASTINT (B_ (&buffer_local_flags, mode_line_format), idx); ++idx; |
| 5093 | XSETFASTINT (buffer_local_flags.abbrev_mode, idx); ++idx; | 5099 | XSETFASTINT (B_ (&buffer_local_flags, abbrev_mode), idx); ++idx; |
| 5094 | XSETFASTINT (buffer_local_flags.overwrite_mode, idx); ++idx; | 5100 | XSETFASTINT (B_ (&buffer_local_flags, overwrite_mode), idx); ++idx; |
| 5095 | XSETFASTINT (buffer_local_flags.case_fold_search, idx); ++idx; | 5101 | XSETFASTINT (B_ (&buffer_local_flags, case_fold_search), idx); ++idx; |
| 5096 | XSETFASTINT (buffer_local_flags.auto_fill_function, idx); ++idx; | 5102 | XSETFASTINT (B_ (&buffer_local_flags, auto_fill_function), idx); ++idx; |
| 5097 | XSETFASTINT (buffer_local_flags.selective_display, idx); ++idx; | 5103 | XSETFASTINT (B_ (&buffer_local_flags, selective_display), idx); ++idx; |
| 5098 | #ifndef old | 5104 | #ifndef old |
| 5099 | XSETFASTINT (buffer_local_flags.selective_display_ellipses, idx); ++idx; | 5105 | XSETFASTINT (B_ (&buffer_local_flags, selective_display_ellipses), idx); ++idx; |
| 5100 | #endif | 5106 | #endif |
| 5101 | XSETFASTINT (buffer_local_flags.tab_width, idx); ++idx; | 5107 | XSETFASTINT (B_ (&buffer_local_flags, tab_width), idx); ++idx; |
| 5102 | XSETFASTINT (buffer_local_flags.truncate_lines, idx); ++idx; | 5108 | XSETFASTINT (B_ (&buffer_local_flags, truncate_lines), idx); ++idx; |
| 5103 | XSETFASTINT (buffer_local_flags.word_wrap, idx); ++idx; | 5109 | XSETFASTINT (B_ (&buffer_local_flags, word_wrap), idx); ++idx; |
| 5104 | XSETFASTINT (buffer_local_flags.ctl_arrow, idx); ++idx; | 5110 | XSETFASTINT (B_ (&buffer_local_flags, ctl_arrow), idx); ++idx; |
| 5105 | XSETFASTINT (buffer_local_flags.fill_column, idx); ++idx; | 5111 | XSETFASTINT (B_ (&buffer_local_flags, fill_column), idx); ++idx; |
| 5106 | XSETFASTINT (buffer_local_flags.left_margin, idx); ++idx; | 5112 | XSETFASTINT (B_ (&buffer_local_flags, left_margin), idx); ++idx; |
| 5107 | XSETFASTINT (buffer_local_flags.abbrev_table, idx); ++idx; | 5113 | XSETFASTINT (B_ (&buffer_local_flags, abbrev_table), idx); ++idx; |
| 5108 | XSETFASTINT (buffer_local_flags.display_table, idx); ++idx; | 5114 | XSETFASTINT (B_ (&buffer_local_flags, display_table), idx); ++idx; |
| 5109 | #ifdef DOS_NT | 5115 | #ifdef DOS_NT |
| 5110 | XSETFASTINT (buffer_local_flags.buffer_file_type, idx); | 5116 | XSETFASTINT (buffer_local_flags.buffer_file_type, idx); |
| 5111 | /* Make this one a permanent local. */ | 5117 | /* Make this one a permanent local. */ |
| 5112 | buffer_permanent_local_flags[idx++] = 1; | 5118 | buffer_permanent_local_flags[idx++] = 1; |
| 5113 | #endif | 5119 | #endif |
| 5114 | XSETFASTINT (buffer_local_flags.syntax_table, idx); ++idx; | 5120 | XSETFASTINT (B_ (&buffer_local_flags, syntax_table), idx); ++idx; |
| 5115 | XSETFASTINT (buffer_local_flags.cache_long_line_scans, idx); ++idx; | 5121 | XSETFASTINT (B_ (&buffer_local_flags, cache_long_line_scans), idx); ++idx; |
| 5116 | XSETFASTINT (buffer_local_flags.category_table, idx); ++idx; | 5122 | XSETFASTINT (B_ (&buffer_local_flags, category_table), idx); ++idx; |
| 5117 | XSETFASTINT (buffer_local_flags.bidi_display_reordering, idx); ++idx; | 5123 | XSETFASTINT (B_ (&buffer_local_flags, bidi_display_reordering), idx); ++idx; |
| 5118 | XSETFASTINT (buffer_local_flags.bidi_paragraph_direction, idx); ++idx; | 5124 | XSETFASTINT (B_ (&buffer_local_flags, bidi_paragraph_direction), idx); ++idx; |
| 5119 | XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx); | 5125 | XSETFASTINT (B_ (&buffer_local_flags, buffer_file_coding_system), idx); |
| 5120 | /* Make this one a permanent local. */ | 5126 | /* Make this one a permanent local. */ |
| 5121 | buffer_permanent_local_flags[idx++] = 1; | 5127 | buffer_permanent_local_flags[idx++] = 1; |
| 5122 | XSETFASTINT (buffer_local_flags.left_margin_cols, idx); ++idx; | 5128 | XSETFASTINT (B_ (&buffer_local_flags, left_margin_cols), idx); ++idx; |
| 5123 | XSETFASTINT (buffer_local_flags.right_margin_cols, idx); ++idx; | 5129 | XSETFASTINT (B_ (&buffer_local_flags, right_margin_cols), idx); ++idx; |
| 5124 | XSETFASTINT (buffer_local_flags.left_fringe_width, idx); ++idx; | 5130 | XSETFASTINT (B_ (&buffer_local_flags, left_fringe_width), idx); ++idx; |
| 5125 | XSETFASTINT (buffer_local_flags.right_fringe_width, idx); ++idx; | 5131 | XSETFASTINT (B_ (&buffer_local_flags, right_fringe_width), idx); ++idx; |
| 5126 | XSETFASTINT (buffer_local_flags.fringes_outside_margins, idx); ++idx; | 5132 | XSETFASTINT (B_ (&buffer_local_flags, fringes_outside_margins), idx); ++idx; |
| 5127 | XSETFASTINT (buffer_local_flags.scroll_bar_width, idx); ++idx; | 5133 | XSETFASTINT (B_ (&buffer_local_flags, scroll_bar_width), idx); ++idx; |
| 5128 | XSETFASTINT (buffer_local_flags.vertical_scroll_bar_type, idx); ++idx; | 5134 | XSETFASTINT (B_ (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx; |
| 5129 | XSETFASTINT (buffer_local_flags.indicate_empty_lines, idx); ++idx; | 5135 | XSETFASTINT (B_ (&buffer_local_flags, indicate_empty_lines), idx); ++idx; |
| 5130 | XSETFASTINT (buffer_local_flags.indicate_buffer_boundaries, idx); ++idx; | 5136 | XSETFASTINT (B_ (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx; |
| 5131 | XSETFASTINT (buffer_local_flags.fringe_indicator_alist, idx); ++idx; | 5137 | XSETFASTINT (B_ (&buffer_local_flags, fringe_indicator_alist), idx); ++idx; |
| 5132 | XSETFASTINT (buffer_local_flags.fringe_cursor_alist, idx); ++idx; | 5138 | XSETFASTINT (B_ (&buffer_local_flags, fringe_cursor_alist), idx); ++idx; |
| 5133 | XSETFASTINT (buffer_local_flags.scroll_up_aggressively, idx); ++idx; | 5139 | XSETFASTINT (B_ (&buffer_local_flags, scroll_up_aggressively), idx); ++idx; |
| 5134 | XSETFASTINT (buffer_local_flags.scroll_down_aggressively, idx); ++idx; | 5140 | XSETFASTINT (B_ (&buffer_local_flags, scroll_down_aggressively), idx); ++idx; |
| 5135 | XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx; | 5141 | XSETFASTINT (B_ (&buffer_local_flags, header_line_format), idx); ++idx; |
| 5136 | XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx; | 5142 | XSETFASTINT (B_ (&buffer_local_flags, cursor_type), idx); ++idx; |
| 5137 | XSETFASTINT (buffer_local_flags.extra_line_spacing, idx); ++idx; | 5143 | XSETFASTINT (B_ (&buffer_local_flags, extra_line_spacing), idx); ++idx; |
| 5138 | XSETFASTINT (buffer_local_flags.cursor_in_non_selected_windows, idx); ++idx; | 5144 | XSETFASTINT (B_ (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx; |
| 5139 | 5145 | ||
| 5140 | /* Need more room? */ | 5146 | /* Need more room? */ |
| 5141 | if (idx >= MAX_PER_BUFFER_VARS) | 5147 | if (idx >= MAX_PER_BUFFER_VARS) |
| @@ -5149,7 +5155,7 @@ init_buffer_once (void) | |||
| 5149 | QSFundamental = make_pure_c_string ("Fundamental"); | 5155 | QSFundamental = make_pure_c_string ("Fundamental"); |
| 5150 | 5156 | ||
| 5151 | Qfundamental_mode = intern_c_string ("fundamental-mode"); | 5157 | Qfundamental_mode = intern_c_string ("fundamental-mode"); |
| 5152 | buffer_defaults.major_mode = Qfundamental_mode; | 5158 | B_ (&buffer_defaults, major_mode) = Qfundamental_mode; |
| 5153 | 5159 | ||
| 5154 | Qmode_class = intern_c_string ("mode-class"); | 5160 | Qmode_class = intern_c_string ("mode-class"); |
| 5155 | 5161 | ||
| @@ -5192,7 +5198,7 @@ init_buffer (void) | |||
| 5192 | #endif /* USE_MMAP_FOR_BUFFERS */ | 5198 | #endif /* USE_MMAP_FOR_BUFFERS */ |
| 5193 | 5199 | ||
| 5194 | Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); | 5200 | Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); |
| 5195 | if (NILP (buffer_defaults.enable_multibyte_characters)) | 5201 | if (NILP (B_ (&buffer_defaults, enable_multibyte_characters))) |
| 5196 | Fset_buffer_multibyte (Qnil); | 5202 | Fset_buffer_multibyte (Qnil); |
| 5197 | 5203 | ||
| 5198 | pwd = get_current_dir_name (); | 5204 | pwd = get_current_dir_name (); |
| @@ -5213,28 +5219,28 @@ init_buffer (void) | |||
| 5213 | pwd[len + 1] = '\0'; | 5219 | pwd[len + 1] = '\0'; |
| 5214 | } | 5220 | } |
| 5215 | 5221 | ||
| 5216 | current_buffer->directory = make_unibyte_string (pwd, strlen (pwd)); | 5222 | B_ (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd)); |
| 5217 | if (! NILP (buffer_defaults.enable_multibyte_characters)) | 5223 | if (! NILP (B_ (&buffer_defaults, enable_multibyte_characters))) |
| 5218 | /* At this moment, we still don't know how to decode the | 5224 | /* At this moment, we still don't know how to decode the |
| 5219 | directory name. So, we keep the bytes in multibyte form so | 5225 | directory name. So, we keep the bytes in multibyte form so |
| 5220 | that ENCODE_FILE correctly gets the original bytes. */ | 5226 | that ENCODE_FILE correctly gets the original bytes. */ |
| 5221 | current_buffer->directory | 5227 | B_ (current_buffer, directory) |
| 5222 | = string_to_multibyte (current_buffer->directory); | 5228 | = string_to_multibyte (B_ (current_buffer, directory)); |
| 5223 | 5229 | ||
| 5224 | /* Add /: to the front of the name | 5230 | /* Add /: to the front of the name |
| 5225 | if it would otherwise be treated as magic. */ | 5231 | if it would otherwise be treated as magic. */ |
| 5226 | temp = Ffind_file_name_handler (current_buffer->directory, Qt); | 5232 | temp = Ffind_file_name_handler (B_ (current_buffer, directory), Qt); |
| 5227 | if (! NILP (temp) | 5233 | if (! NILP (temp) |
| 5228 | /* If the default dir is just /, TEMP is non-nil | 5234 | /* If the default dir is just /, TEMP is non-nil |
| 5229 | because of the ange-ftp completion handler. | 5235 | because of the ange-ftp completion handler. |
| 5230 | However, it is not necessary to turn / into /:/. | 5236 | However, it is not necessary to turn / into /:/. |
| 5231 | So avoid doing that. */ | 5237 | So avoid doing that. */ |
| 5232 | && strcmp ("/", SSDATA (current_buffer->directory))) | 5238 | && strcmp ("/", SSDATA (B_ (current_buffer, directory)))) |
| 5233 | current_buffer->directory | 5239 | B_ (current_buffer, directory) |
| 5234 | = concat2 (build_string ("/:"), current_buffer->directory); | 5240 | = concat2 (build_string ("/:"), B_ (current_buffer, directory)); |
| 5235 | 5241 | ||
| 5236 | temp = get_minibuffer (0); | 5242 | temp = get_minibuffer (0); |
| 5237 | XBUFFER (temp)->directory = current_buffer->directory; | 5243 | B_ (XBUFFER (temp), directory) = B_ (current_buffer, directory); |
| 5238 | 5244 | ||
| 5239 | free (pwd); | 5245 | free (pwd); |
| 5240 | } | 5246 | } |
| @@ -5485,13 +5491,13 @@ This value applies in buffers that don't have their own local values. | |||
| 5485 | This is the same as (default-value 'scroll-down-aggressively). */); | 5491 | This is the same as (default-value 'scroll-down-aggressively). */); |
| 5486 | 5492 | ||
| 5487 | DEFVAR_PER_BUFFER ("header-line-format", | 5493 | DEFVAR_PER_BUFFER ("header-line-format", |
| 5488 | ¤t_buffer->header_line_format, | 5494 | &B_ (current_buffer, header_line_format), |
| 5489 | Qnil, | 5495 | Qnil, |
| 5490 | doc: /* Analogous to `mode-line-format', but controls the header line. | 5496 | doc: /* Analogous to `mode-line-format', but controls the header line. |
| 5491 | The header line appears, optionally, at the top of a window; | 5497 | The header line appears, optionally, at the top of a window; |
| 5492 | the mode line appears at the bottom. */); | 5498 | the mode line appears at the bottom. */); |
| 5493 | 5499 | ||
| 5494 | DEFVAR_PER_BUFFER ("mode-line-format", ¤t_buffer->mode_line_format, | 5500 | DEFVAR_PER_BUFFER ("mode-line-format", &B_ (current_buffer, mode_line_format), |
| 5495 | Qnil, | 5501 | Qnil, |
| 5496 | doc: /* Template for displaying mode line for current buffer. | 5502 | doc: /* Template for displaying mode line for current buffer. |
| 5497 | Each buffer has its own value of this variable. | 5503 | Each buffer has its own value of this variable. |
| @@ -5548,7 +5554,7 @@ Decimal digits after the % specify field width to which to pad. */); | |||
| 5548 | DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode, | 5554 | DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode, |
| 5549 | doc: /* *Value of `major-mode' for new buffers. */); | 5555 | doc: /* *Value of `major-mode' for new buffers. */); |
| 5550 | 5556 | ||
| 5551 | DEFVAR_PER_BUFFER ("major-mode", ¤t_buffer->major_mode, | 5557 | DEFVAR_PER_BUFFER ("major-mode", &B_ (current_buffer, major_mode), |
| 5552 | make_number (Lisp_Symbol), | 5558 | make_number (Lisp_Symbol), |
| 5553 | doc: /* Symbol for current buffer's major mode. | 5559 | doc: /* Symbol for current buffer's major mode. |
| 5554 | The default value (normally `fundamental-mode') affects new buffers. | 5560 | 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 | |||
| 5561 | variables such as `buffer-read-only' and `buffer-file-coding-system' | 5567 | variables such as `buffer-read-only' and `buffer-file-coding-system' |
| 5562 | to be set up. */); | 5568 | to be set up. */); |
| 5563 | 5569 | ||
| 5564 | DEFVAR_PER_BUFFER ("mode-name", ¤t_buffer->mode_name, | 5570 | DEFVAR_PER_BUFFER ("mode-name", &B_ (current_buffer, mode_name), |
| 5565 | Qnil, | 5571 | Qnil, |
| 5566 | doc: /* Pretty name of current buffer's major mode. | 5572 | doc: /* Pretty name of current buffer's major mode. |
| 5567 | Usually a string, but can use any of the constructs for `mode-line-format', | 5573 | Usually a string, but can use any of the constructs for `mode-line-format', |
| 5568 | which see. | 5574 | which see. |
| 5569 | Format with `format-mode-line' to produce a string value. */); | 5575 | Format with `format-mode-line' to produce a string value. */); |
| 5570 | 5576 | ||
| 5571 | DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, | 5577 | DEFVAR_PER_BUFFER ("local-abbrev-table", &B_ (current_buffer, abbrev_table), Qnil, |
| 5572 | doc: /* Local (mode-specific) abbrev table of current buffer. */); | 5578 | doc: /* Local (mode-specific) abbrev table of current buffer. */); |
| 5573 | 5579 | ||
| 5574 | DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil, | 5580 | DEFVAR_PER_BUFFER ("abbrev-mode", &B_ (current_buffer, abbrev_mode), Qnil, |
| 5575 | doc: /* Non-nil if Abbrev mode is enabled. | 5581 | doc: /* Non-nil if Abbrev mode is enabled. |
| 5576 | Use the command `abbrev-mode' to change this variable. */); | 5582 | Use the command `abbrev-mode' to change this variable. */); |
| 5577 | 5583 | ||
| 5578 | DEFVAR_PER_BUFFER ("case-fold-search", ¤t_buffer->case_fold_search, | 5584 | DEFVAR_PER_BUFFER ("case-fold-search", &B_ (current_buffer, case_fold_search), |
| 5579 | Qnil, | 5585 | Qnil, |
| 5580 | doc: /* *Non-nil if searches and matches should ignore case. */); | 5586 | doc: /* *Non-nil if searches and matches should ignore case. */); |
| 5581 | 5587 | ||
| 5582 | DEFVAR_PER_BUFFER ("fill-column", ¤t_buffer->fill_column, | 5588 | DEFVAR_PER_BUFFER ("fill-column", &B_ (current_buffer, fill_column), |
| 5583 | make_number (LISP_INT_TAG), | 5589 | make_number (LISP_INT_TAG), |
| 5584 | doc: /* *Column beyond which automatic line-wrapping should happen. | 5590 | doc: /* *Column beyond which automatic line-wrapping should happen. |
| 5585 | Interactively, you can set the buffer local value using \\[set-fill-column]. */); | 5591 | Interactively, you can set the buffer local value using \\[set-fill-column]. */); |
| 5586 | 5592 | ||
| 5587 | DEFVAR_PER_BUFFER ("left-margin", ¤t_buffer->left_margin, | 5593 | DEFVAR_PER_BUFFER ("left-margin", &B_ (current_buffer, left_margin), |
| 5588 | make_number (LISP_INT_TAG), | 5594 | make_number (LISP_INT_TAG), |
| 5589 | doc: /* *Column for the default `indent-line-function' to indent to. | 5595 | doc: /* *Column for the default `indent-line-function' to indent to. |
| 5590 | Linefeed indents to this column in Fundamental mode. */); | 5596 | Linefeed indents to this column in Fundamental mode. */); |
| 5591 | 5597 | ||
| 5592 | DEFVAR_PER_BUFFER ("tab-width", ¤t_buffer->tab_width, | 5598 | DEFVAR_PER_BUFFER ("tab-width", &B_ (current_buffer, tab_width), |
| 5593 | make_number (LISP_INT_TAG), | 5599 | make_number (LISP_INT_TAG), |
| 5594 | doc: /* *Distance between tab stops (for display of tab characters), in columns. */); | 5600 | doc: /* *Distance between tab stops (for display of tab characters), in columns. */); |
| 5595 | 5601 | ||
| 5596 | DEFVAR_PER_BUFFER ("ctl-arrow", ¤t_buffer->ctl_arrow, Qnil, | 5602 | DEFVAR_PER_BUFFER ("ctl-arrow", &B_ (current_buffer, ctl_arrow), Qnil, |
| 5597 | doc: /* *Non-nil means display control chars with uparrow. | 5603 | doc: /* *Non-nil means display control chars with uparrow. |
| 5598 | A value of nil means use backslash and octal digits. | 5604 | A value of nil means use backslash and octal digits. |
| 5599 | This variable does not apply to characters whose display is specified | 5605 | This variable does not apply to characters whose display is specified |
| 5600 | in the current display table (if there is one). */); | 5606 | in the current display table (if there is one). */); |
| 5601 | 5607 | ||
| 5602 | DEFVAR_PER_BUFFER ("enable-multibyte-characters", | 5608 | DEFVAR_PER_BUFFER ("enable-multibyte-characters", |
| 5603 | ¤t_buffer->enable_multibyte_characters, | 5609 | &B_ (current_buffer, enable_multibyte_characters), |
| 5604 | Qnil, | 5610 | Qnil, |
| 5605 | doc: /* Non-nil means the buffer contents are regarded as multi-byte characters. | 5611 | doc: /* Non-nil means the buffer contents are regarded as multi-byte characters. |
| 5606 | Otherwise they are regarded as unibyte. This affects the display, | 5612 | Otherwise they are regarded as unibyte. This affects the display, |
| @@ -5614,7 +5620,7 @@ See also variable `default-enable-multibyte-characters' and Info node | |||
| 5614 | XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1; | 5620 | XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1; |
| 5615 | 5621 | ||
| 5616 | DEFVAR_PER_BUFFER ("buffer-file-coding-system", | 5622 | DEFVAR_PER_BUFFER ("buffer-file-coding-system", |
| 5617 | ¤t_buffer->buffer_file_coding_system, Qnil, | 5623 | &B_ (current_buffer, buffer_file_coding_system), Qnil, |
| 5618 | doc: /* Coding system to be used for encoding the buffer contents on saving. | 5624 | doc: /* Coding system to be used for encoding the buffer contents on saving. |
| 5619 | This variable applies to saving the buffer, and also to `write-region' | 5625 | This variable applies to saving the buffer, and also to `write-region' |
| 5620 | and other functions that use `write-region'. | 5626 | and other functions that use `write-region'. |
| @@ -5632,11 +5638,11 @@ The variable `coding-system-for-write', if non-nil, overrides this variable. | |||
| 5632 | This variable is never applied to a way of decoding a file while reading it. */); | 5638 | This variable is never applied to a way of decoding a file while reading it. */); |
| 5633 | 5639 | ||
| 5634 | DEFVAR_PER_BUFFER ("bidi-display-reordering", | 5640 | DEFVAR_PER_BUFFER ("bidi-display-reordering", |
| 5635 | ¤t_buffer->bidi_display_reordering, Qnil, | 5641 | &B_ (current_buffer, bidi_display_reordering), Qnil, |
| 5636 | doc: /* Non-nil means reorder bidirectional text for display in the visual order. */); | 5642 | doc: /* Non-nil means reorder bidirectional text for display in the visual order. */); |
| 5637 | 5643 | ||
| 5638 | DEFVAR_PER_BUFFER ("bidi-paragraph-direction", | 5644 | DEFVAR_PER_BUFFER ("bidi-paragraph-direction", |
| 5639 | ¤t_buffer->bidi_paragraph_direction, Qnil, | 5645 | &B_ (current_buffer, bidi_paragraph_direction), Qnil, |
| 5640 | doc: /* *If non-nil, forces directionality of text paragraphs in the buffer. | 5646 | doc: /* *If non-nil, forces directionality of text paragraphs in the buffer. |
| 5641 | 5647 | ||
| 5642 | If this is nil (the default), the direction of each paragraph is | 5648 | If this is nil (the default), the direction of each paragraph is |
| @@ -5647,7 +5653,7 @@ Any other value is treated as nil. | |||
| 5647 | This variable has no effect unless the buffer's value of | 5653 | This variable has no effect unless the buffer's value of |
| 5648 | \`bidi-display-reordering' is non-nil. */); | 5654 | \`bidi-display-reordering' is non-nil. */); |
| 5649 | 5655 | ||
| 5650 | DEFVAR_PER_BUFFER ("truncate-lines", ¤t_buffer->truncate_lines, Qnil, | 5656 | DEFVAR_PER_BUFFER ("truncate-lines", &B_ (current_buffer, truncate_lines), Qnil, |
| 5651 | doc: /* *Non-nil means do not display continuation lines. | 5657 | doc: /* *Non-nil means do not display continuation lines. |
| 5652 | Instead, give each line of text just one screen line. | 5658 | Instead, give each line of text just one screen line. |
| 5653 | 5659 | ||
| @@ -5655,7 +5661,7 @@ Note that this is overridden by the variable | |||
| 5655 | `truncate-partial-width-windows' if that variable is non-nil | 5661 | `truncate-partial-width-windows' if that variable is non-nil |
| 5656 | and this buffer is not full-frame width. */); | 5662 | and this buffer is not full-frame width. */); |
| 5657 | 5663 | ||
| 5658 | DEFVAR_PER_BUFFER ("word-wrap", ¤t_buffer->word_wrap, Qnil, | 5664 | DEFVAR_PER_BUFFER ("word-wrap", &B_ (current_buffer, word_wrap), Qnil, |
| 5659 | doc: /* *Non-nil means to use word-wrapping for continuation lines. | 5665 | doc: /* *Non-nil means to use word-wrapping for continuation lines. |
| 5660 | When word-wrapping is on, continuation lines are wrapped at the space | 5666 | When word-wrapping is on, continuation lines are wrapped at the space |
| 5661 | or tab character nearest to the right window edge. | 5667 | or tab character nearest to the right window edge. |
| @@ -5676,12 +5682,12 @@ On those systems, it is automatically local in every buffer. | |||
| 5676 | On other systems, this variable is normally always nil. */); | 5682 | On other systems, this variable is normally always nil. */); |
| 5677 | #endif | 5683 | #endif |
| 5678 | 5684 | ||
| 5679 | DEFVAR_PER_BUFFER ("default-directory", ¤t_buffer->directory, | 5685 | DEFVAR_PER_BUFFER ("default-directory", &B_ (current_buffer, directory), |
| 5680 | make_number (Lisp_String), | 5686 | make_number (Lisp_String), |
| 5681 | doc: /* Name of default directory of current buffer. Should end with slash. | 5687 | doc: /* Name of default directory of current buffer. Should end with slash. |
| 5682 | To interactively change the default directory, use command `cd'. */); | 5688 | To interactively change the default directory, use command `cd'. */); |
| 5683 | 5689 | ||
| 5684 | DEFVAR_PER_BUFFER ("auto-fill-function", ¤t_buffer->auto_fill_function, | 5690 | DEFVAR_PER_BUFFER ("auto-fill-function", &B_ (current_buffer, auto_fill_function), |
| 5685 | Qnil, | 5691 | Qnil, |
| 5686 | doc: /* Function called (if non-nil) to perform auto-fill. | 5692 | doc: /* Function called (if non-nil) to perform auto-fill. |
| 5687 | It is called after self-inserting any character specified in | 5693 | It is called after self-inserting any character specified in |
| @@ -5689,30 +5695,30 @@ the `auto-fill-chars' table. | |||
| 5689 | NOTE: This variable is not a hook; | 5695 | NOTE: This variable is not a hook; |
| 5690 | its value may not be a list of functions. */); | 5696 | its value may not be a list of functions. */); |
| 5691 | 5697 | ||
| 5692 | DEFVAR_PER_BUFFER ("buffer-file-name", ¤t_buffer->filename, | 5698 | DEFVAR_PER_BUFFER ("buffer-file-name", &B_ (current_buffer, filename), |
| 5693 | make_number (Lisp_String), | 5699 | make_number (Lisp_String), |
| 5694 | doc: /* Name of file visited in current buffer, or nil if not visiting a file. */); | 5700 | doc: /* Name of file visited in current buffer, or nil if not visiting a file. */); |
| 5695 | 5701 | ||
| 5696 | DEFVAR_PER_BUFFER ("buffer-file-truename", ¤t_buffer->file_truename, | 5702 | DEFVAR_PER_BUFFER ("buffer-file-truename", &B_ (current_buffer, file_truename), |
| 5697 | make_number (Lisp_String), | 5703 | make_number (Lisp_String), |
| 5698 | doc: /* Abbreviated truename of file visited in current buffer, or nil if none. | 5704 | doc: /* Abbreviated truename of file visited in current buffer, or nil if none. |
| 5699 | The truename of a file is calculated by `file-truename' | 5705 | The truename of a file is calculated by `file-truename' |
| 5700 | and then abbreviated with `abbreviate-file-name'. */); | 5706 | and then abbreviated with `abbreviate-file-name'. */); |
| 5701 | 5707 | ||
| 5702 | DEFVAR_PER_BUFFER ("buffer-auto-save-file-name", | 5708 | DEFVAR_PER_BUFFER ("buffer-auto-save-file-name", |
| 5703 | ¤t_buffer->auto_save_file_name, | 5709 | &B_ (current_buffer, auto_save_file_name), |
| 5704 | make_number (Lisp_String), | 5710 | make_number (Lisp_String), |
| 5705 | doc: /* Name of file for auto-saving current buffer. | 5711 | doc: /* Name of file for auto-saving current buffer. |
| 5706 | If it is nil, that means don't auto-save this buffer. */); | 5712 | If it is nil, that means don't auto-save this buffer. */); |
| 5707 | 5713 | ||
| 5708 | DEFVAR_PER_BUFFER ("buffer-read-only", ¤t_buffer->read_only, Qnil, | 5714 | DEFVAR_PER_BUFFER ("buffer-read-only", &B_ (current_buffer, read_only), Qnil, |
| 5709 | doc: /* Non-nil if this buffer is read-only. */); | 5715 | doc: /* Non-nil if this buffer is read-only. */); |
| 5710 | 5716 | ||
| 5711 | DEFVAR_PER_BUFFER ("buffer-backed-up", ¤t_buffer->backed_up, Qnil, | 5717 | DEFVAR_PER_BUFFER ("buffer-backed-up", &B_ (current_buffer, backed_up), Qnil, |
| 5712 | doc: /* Non-nil if this buffer's file has been backed up. | 5718 | doc: /* Non-nil if this buffer's file has been backed up. |
| 5713 | Backing up is done before the first time the file is saved. */); | 5719 | Backing up is done before the first time the file is saved. */); |
| 5714 | 5720 | ||
| 5715 | DEFVAR_PER_BUFFER ("buffer-saved-size", ¤t_buffer->save_length, | 5721 | DEFVAR_PER_BUFFER ("buffer-saved-size", &B_ (current_buffer, save_length), |
| 5716 | make_number (LISP_INT_TAG), | 5722 | make_number (LISP_INT_TAG), |
| 5717 | doc: /* Length of current buffer when last read in, saved or auto-saved. | 5723 | doc: /* Length of current buffer when last read in, saved or auto-saved. |
| 5718 | 0 initially. | 5724 | 0 initially. |
| @@ -5722,7 +5728,7 @@ If you set this to -2, that means don't turn off auto-saving in this buffer | |||
| 5722 | if its text size shrinks. If you use `buffer-swap-text' on a buffer, | 5728 | if its text size shrinks. If you use `buffer-swap-text' on a buffer, |
| 5723 | you probably should set this to -2 in that buffer. */); | 5729 | you probably should set this to -2 in that buffer. */); |
| 5724 | 5730 | ||
| 5725 | DEFVAR_PER_BUFFER ("selective-display", ¤t_buffer->selective_display, | 5731 | DEFVAR_PER_BUFFER ("selective-display", &B_ (current_buffer, selective_display), |
| 5726 | Qnil, | 5732 | Qnil, |
| 5727 | doc: /* Non-nil enables selective display. | 5733 | doc: /* Non-nil enables selective display. |
| 5728 | An integer N as value means display only lines | 5734 | An integer N as value means display only lines |
| @@ -5733,12 +5739,12 @@ in a file, save the ^M as a newline. */); | |||
| 5733 | 5739 | ||
| 5734 | #ifndef old | 5740 | #ifndef old |
| 5735 | DEFVAR_PER_BUFFER ("selective-display-ellipses", | 5741 | DEFVAR_PER_BUFFER ("selective-display-ellipses", |
| 5736 | ¤t_buffer->selective_display_ellipses, | 5742 | &B_ (current_buffer, selective_display_ellipses), |
| 5737 | Qnil, | 5743 | Qnil, |
| 5738 | doc: /* Non-nil means display ... on previous line when a line is invisible. */); | 5744 | doc: /* Non-nil means display ... on previous line when a line is invisible. */); |
| 5739 | #endif | 5745 | #endif |
| 5740 | 5746 | ||
| 5741 | DEFVAR_PER_BUFFER ("overwrite-mode", ¤t_buffer->overwrite_mode, Qnil, | 5747 | DEFVAR_PER_BUFFER ("overwrite-mode", &B_ (current_buffer, overwrite_mode), Qnil, |
| 5742 | doc: /* Non-nil if self-insertion should replace existing text. | 5748 | doc: /* Non-nil if self-insertion should replace existing text. |
| 5743 | The value should be one of `overwrite-mode-textual', | 5749 | The value should be one of `overwrite-mode-textual', |
| 5744 | `overwrite-mode-binary', or nil. | 5750 | `overwrite-mode-binary', or nil. |
| @@ -5747,7 +5753,7 @@ inserts at the end of a line, and inserts when point is before a tab, | |||
| 5747 | until the tab is filled in. | 5753 | until the tab is filled in. |
| 5748 | If `overwrite-mode-binary', self-insertion replaces newlines and tabs too. */); | 5754 | If `overwrite-mode-binary', self-insertion replaces newlines and tabs too. */); |
| 5749 | 5755 | ||
| 5750 | DEFVAR_PER_BUFFER ("buffer-display-table", ¤t_buffer->display_table, | 5756 | DEFVAR_PER_BUFFER ("buffer-display-table", &B_ (current_buffer, display_table), |
| 5751 | Qnil, | 5757 | Qnil, |
| 5752 | doc: /* Display table that controls display of the contents of current buffer. | 5758 | doc: /* Display table that controls display of the contents of current buffer. |
| 5753 | 5759 | ||
| @@ -5784,39 +5790,39 @@ In addition, a char-table has six extra slots to control the display of: | |||
| 5784 | 5790 | ||
| 5785 | See also the functions `display-table-slot' and `set-display-table-slot'. */); | 5791 | See also the functions `display-table-slot' and `set-display-table-slot'. */); |
| 5786 | 5792 | ||
| 5787 | DEFVAR_PER_BUFFER ("left-margin-width", ¤t_buffer->left_margin_cols, | 5793 | DEFVAR_PER_BUFFER ("left-margin-width", &B_ (current_buffer, left_margin_cols), |
| 5788 | Qnil, | 5794 | Qnil, |
| 5789 | doc: /* *Width of left marginal area for display of a buffer. | 5795 | doc: /* *Width of left marginal area for display of a buffer. |
| 5790 | A value of nil means no marginal area. */); | 5796 | A value of nil means no marginal area. */); |
| 5791 | 5797 | ||
| 5792 | DEFVAR_PER_BUFFER ("right-margin-width", ¤t_buffer->right_margin_cols, | 5798 | DEFVAR_PER_BUFFER ("right-margin-width", &B_ (current_buffer, right_margin_cols), |
| 5793 | Qnil, | 5799 | Qnil, |
| 5794 | doc: /* *Width of right marginal area for display of a buffer. | 5800 | doc: /* *Width of right marginal area for display of a buffer. |
| 5795 | A value of nil means no marginal area. */); | 5801 | A value of nil means no marginal area. */); |
| 5796 | 5802 | ||
| 5797 | DEFVAR_PER_BUFFER ("left-fringe-width", ¤t_buffer->left_fringe_width, | 5803 | DEFVAR_PER_BUFFER ("left-fringe-width", &B_ (current_buffer, left_fringe_width), |
| 5798 | Qnil, | 5804 | Qnil, |
| 5799 | doc: /* *Width of this buffer's left fringe (in pixels). | 5805 | doc: /* *Width of this buffer's left fringe (in pixels). |
| 5800 | A value of 0 means no left fringe is shown in this buffer's window. | 5806 | A value of 0 means no left fringe is shown in this buffer's window. |
| 5801 | A value of nil means to use the left fringe width from the window's frame. */); | 5807 | A value of nil means to use the left fringe width from the window's frame. */); |
| 5802 | 5808 | ||
| 5803 | DEFVAR_PER_BUFFER ("right-fringe-width", ¤t_buffer->right_fringe_width, | 5809 | DEFVAR_PER_BUFFER ("right-fringe-width", &B_ (current_buffer, right_fringe_width), |
| 5804 | Qnil, | 5810 | Qnil, |
| 5805 | doc: /* *Width of this buffer's right fringe (in pixels). | 5811 | doc: /* *Width of this buffer's right fringe (in pixels). |
| 5806 | A value of 0 means no right fringe is shown in this buffer's window. | 5812 | A value of 0 means no right fringe is shown in this buffer's window. |
| 5807 | A value of nil means to use the right fringe width from the window's frame. */); | 5813 | A value of nil means to use the right fringe width from the window's frame. */); |
| 5808 | 5814 | ||
| 5809 | DEFVAR_PER_BUFFER ("fringes-outside-margins", ¤t_buffer->fringes_outside_margins, | 5815 | DEFVAR_PER_BUFFER ("fringes-outside-margins", &B_ (current_buffer, fringes_outside_margins), |
| 5810 | Qnil, | 5816 | Qnil, |
| 5811 | doc: /* *Non-nil means to display fringes outside display margins. | 5817 | doc: /* *Non-nil means to display fringes outside display margins. |
| 5812 | A value of nil means to display fringes between margins and buffer text. */); | 5818 | A value of nil means to display fringes between margins and buffer text. */); |
| 5813 | 5819 | ||
| 5814 | DEFVAR_PER_BUFFER ("scroll-bar-width", ¤t_buffer->scroll_bar_width, | 5820 | DEFVAR_PER_BUFFER ("scroll-bar-width", &B_ (current_buffer, scroll_bar_width), |
| 5815 | Qnil, | 5821 | Qnil, |
| 5816 | doc: /* *Width of this buffer's scroll bars in pixels. | 5822 | doc: /* *Width of this buffer's scroll bars in pixels. |
| 5817 | A value of nil means to use the scroll bar width from the window's frame. */); | 5823 | A value of nil means to use the scroll bar width from the window's frame. */); |
| 5818 | 5824 | ||
| 5819 | DEFVAR_PER_BUFFER ("vertical-scroll-bar", ¤t_buffer->vertical_scroll_bar_type, | 5825 | DEFVAR_PER_BUFFER ("vertical-scroll-bar", &B_ (current_buffer, vertical_scroll_bar_type), |
| 5820 | Qnil, | 5826 | Qnil, |
| 5821 | doc: /* *Position of this buffer's vertical scroll bar. | 5827 | doc: /* *Position of this buffer's vertical scroll bar. |
| 5822 | The value takes effect whenever you tell a window to display this buffer; | 5828 | 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. | |||
| 5827 | A value of t (the default) means do whatever the window's frame specifies. */); | 5833 | A value of t (the default) means do whatever the window's frame specifies. */); |
| 5828 | 5834 | ||
| 5829 | DEFVAR_PER_BUFFER ("indicate-empty-lines", | 5835 | DEFVAR_PER_BUFFER ("indicate-empty-lines", |
| 5830 | ¤t_buffer->indicate_empty_lines, Qnil, | 5836 | &B_ (current_buffer, indicate_empty_lines), Qnil, |
| 5831 | doc: /* *Visually indicate empty lines after the buffer end. | 5837 | doc: /* *Visually indicate empty lines after the buffer end. |
| 5832 | If non-nil, a bitmap is displayed in the left fringe of a window on | 5838 | If non-nil, a bitmap is displayed in the left fringe of a window on |
| 5833 | window-systems. */); | 5839 | window-systems. */); |
| 5834 | 5840 | ||
| 5835 | DEFVAR_PER_BUFFER ("indicate-buffer-boundaries", | 5841 | DEFVAR_PER_BUFFER ("indicate-buffer-boundaries", |
| 5836 | ¤t_buffer->indicate_buffer_boundaries, Qnil, | 5842 | &B_ (current_buffer, indicate_buffer_boundaries), Qnil, |
| 5837 | doc: /* *Visually indicate buffer boundaries and scrolling. | 5843 | doc: /* *Visually indicate buffer boundaries and scrolling. |
| 5838 | If non-nil, the first and last line of the buffer are marked in the fringe | 5844 | If non-nil, the first and last line of the buffer are marked in the fringe |
| 5839 | of a window on window-systems with angle bitmaps, or if the window can be | 5845 | 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 | |||
| 5858 | fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */); | 5864 | fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */); |
| 5859 | 5865 | ||
| 5860 | DEFVAR_PER_BUFFER ("fringe-indicator-alist", | 5866 | DEFVAR_PER_BUFFER ("fringe-indicator-alist", |
| 5861 | ¤t_buffer->fringe_indicator_alist, Qnil, | 5867 | &B_ (current_buffer, fringe_indicator_alist), Qnil, |
| 5862 | doc: /* *Mapping from logical to physical fringe indicator bitmaps. | 5868 | doc: /* *Mapping from logical to physical fringe indicator bitmaps. |
| 5863 | The value is an alist where each element (INDICATOR . BITMAPS) | 5869 | The value is an alist where each element (INDICATOR . BITMAPS) |
| 5864 | specifies the fringe bitmaps used to display a specific logical | 5870 | 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 | |||
| 5877 | symbol which is used in both left and right fringes. */); | 5883 | symbol which is used in both left and right fringes. */); |
| 5878 | 5884 | ||
| 5879 | DEFVAR_PER_BUFFER ("fringe-cursor-alist", | 5885 | DEFVAR_PER_BUFFER ("fringe-cursor-alist", |
| 5880 | ¤t_buffer->fringe_cursor_alist, Qnil, | 5886 | &B_ (current_buffer, fringe_cursor_alist), Qnil, |
| 5881 | doc: /* *Mapping from logical to physical fringe cursor bitmaps. | 5887 | doc: /* *Mapping from logical to physical fringe cursor bitmaps. |
| 5882 | The value is an alist where each element (CURSOR . BITMAP) | 5888 | The value is an alist where each element (CURSOR . BITMAP) |
| 5883 | specifies the fringe bitmaps used to display a specific logical | 5889 | specifies the fringe bitmaps used to display a specific logical |
| @@ -5892,7 +5898,7 @@ BITMAP is the corresponding fringe bitmap shown for the logical | |||
| 5892 | cursor type. */); | 5898 | cursor type. */); |
| 5893 | 5899 | ||
| 5894 | DEFVAR_PER_BUFFER ("scroll-up-aggressively", | 5900 | DEFVAR_PER_BUFFER ("scroll-up-aggressively", |
| 5895 | ¤t_buffer->scroll_up_aggressively, Qnil, | 5901 | &B_ (current_buffer, scroll_up_aggressively), Qnil, |
| 5896 | doc: /* How far to scroll windows upward. | 5902 | doc: /* How far to scroll windows upward. |
| 5897 | If you move point off the bottom, the window scrolls automatically. | 5903 | If you move point off the bottom, the window scrolls automatically. |
| 5898 | This variable controls how far it scrolls. The value nil, the default, | 5904 | 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 | |||
| 5905 | between 0.0 and 1.0, inclusive. */); | 5911 | between 0.0 and 1.0, inclusive. */); |
| 5906 | 5912 | ||
| 5907 | DEFVAR_PER_BUFFER ("scroll-down-aggressively", | 5913 | DEFVAR_PER_BUFFER ("scroll-down-aggressively", |
| 5908 | ¤t_buffer->scroll_down_aggressively, Qnil, | 5914 | &B_ (current_buffer, scroll_down_aggressively), Qnil, |
| 5909 | doc: /* How far to scroll windows downward. | 5915 | doc: /* How far to scroll windows downward. |
| 5910 | If you move point off the top, the window scrolls automatically. | 5916 | If you move point off the top, the window scrolls automatically. |
| 5911 | This variable controls how far it scrolls. The value nil, the default, | 5917 | This variable controls how far it scrolls. The value nil, the default, |
| @@ -5960,7 +5966,7 @@ from happening repeatedly and making Emacs nonfunctional. */); | |||
| 5960 | The functions are run using the `run-hooks' function. */); | 5966 | The functions are run using the `run-hooks' function. */); |
| 5961 | Vfirst_change_hook = Qnil; | 5967 | Vfirst_change_hook = Qnil; |
| 5962 | 5968 | ||
| 5963 | DEFVAR_PER_BUFFER ("buffer-undo-list", ¤t_buffer->undo_list, Qnil, | 5969 | DEFVAR_PER_BUFFER ("buffer-undo-list", &B_ (current_buffer, undo_list), Qnil, |
| 5964 | doc: /* List of undo entries in current buffer. | 5970 | doc: /* List of undo entries in current buffer. |
| 5965 | Recent changes come first; older changes follow newer. | 5971 | Recent changes come first; older changes follow newer. |
| 5966 | 5972 | ||
| @@ -6001,10 +6007,10 @@ the changes between two undo boundaries as a single step to be undone. | |||
| 6001 | 6007 | ||
| 6002 | If the value of the variable is t, undo information is not recorded. */); | 6008 | If the value of the variable is t, undo information is not recorded. */); |
| 6003 | 6009 | ||
| 6004 | DEFVAR_PER_BUFFER ("mark-active", ¤t_buffer->mark_active, Qnil, | 6010 | DEFVAR_PER_BUFFER ("mark-active", &B_ (current_buffer, mark_active), Qnil, |
| 6005 | doc: /* Non-nil means the mark and region are currently active in this buffer. */); | 6011 | doc: /* Non-nil means the mark and region are currently active in this buffer. */); |
| 6006 | 6012 | ||
| 6007 | DEFVAR_PER_BUFFER ("cache-long-line-scans", ¤t_buffer->cache_long_line_scans, Qnil, | 6013 | DEFVAR_PER_BUFFER ("cache-long-line-scans", &B_ (current_buffer, cache_long_line_scans), Qnil, |
| 6008 | doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly. | 6014 | doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly. |
| 6009 | 6015 | ||
| 6010 | Normally, the line-motion functions work by scanning the buffer for | 6016 | Normally, the line-motion functions work by scanning the buffer for |
| @@ -6032,23 +6038,23 @@ maintained internally by the Emacs primitives. Enabling or disabling | |||
| 6032 | the cache should not affect the behavior of any of the motion | 6038 | the cache should not affect the behavior of any of the motion |
| 6033 | functions; it should only affect their performance. */); | 6039 | functions; it should only affect their performance. */); |
| 6034 | 6040 | ||
| 6035 | DEFVAR_PER_BUFFER ("point-before-scroll", ¤t_buffer->point_before_scroll, Qnil, | 6041 | DEFVAR_PER_BUFFER ("point-before-scroll", &B_ (current_buffer, point_before_scroll), Qnil, |
| 6036 | doc: /* Value of point before the last series of scroll operations, or nil. */); | 6042 | doc: /* Value of point before the last series of scroll operations, or nil. */); |
| 6037 | 6043 | ||
| 6038 | DEFVAR_PER_BUFFER ("buffer-file-format", ¤t_buffer->file_format, Qnil, | 6044 | DEFVAR_PER_BUFFER ("buffer-file-format", &B_ (current_buffer, file_format), Qnil, |
| 6039 | doc: /* List of formats to use when saving this buffer. | 6045 | doc: /* List of formats to use when saving this buffer. |
| 6040 | Formats are defined by `format-alist'. This variable is | 6046 | Formats are defined by `format-alist'. This variable is |
| 6041 | set when a file is visited. */); | 6047 | set when a file is visited. */); |
| 6042 | 6048 | ||
| 6043 | DEFVAR_PER_BUFFER ("buffer-auto-save-file-format", | 6049 | DEFVAR_PER_BUFFER ("buffer-auto-save-file-format", |
| 6044 | ¤t_buffer->auto_save_file_format, Qnil, | 6050 | &B_ (current_buffer, auto_save_file_format), Qnil, |
| 6045 | doc: /* *Format in which to write auto-save files. | 6051 | doc: /* *Format in which to write auto-save files. |
| 6046 | Should be a list of symbols naming formats that are defined in `format-alist'. | 6052 | Should be a list of symbols naming formats that are defined in `format-alist'. |
| 6047 | If it is t, which is the default, auto-save files are written in the | 6053 | If it is t, which is the default, auto-save files are written in the |
| 6048 | same format as a regular save would use. */); | 6054 | same format as a regular save would use. */); |
| 6049 | 6055 | ||
| 6050 | DEFVAR_PER_BUFFER ("buffer-invisibility-spec", | 6056 | DEFVAR_PER_BUFFER ("buffer-invisibility-spec", |
| 6051 | ¤t_buffer->invisibility_spec, Qnil, | 6057 | &B_ (current_buffer, invisibility_spec), Qnil, |
| 6052 | doc: /* Invisibility spec of this buffer. | 6058 | doc: /* Invisibility spec of this buffer. |
| 6053 | The default is t, which means that text is invisible | 6059 | The default is t, which means that text is invisible |
| 6054 | if it has a non-nil `invisible' property. | 6060 | if it has a non-nil `invisible' property. |
| @@ -6059,12 +6065,12 @@ then characters with property value PROP are invisible, | |||
| 6059 | and they have an ellipsis as well if ELLIPSIS is non-nil. */); | 6065 | and they have an ellipsis as well if ELLIPSIS is non-nil. */); |
| 6060 | 6066 | ||
| 6061 | DEFVAR_PER_BUFFER ("buffer-display-count", | 6067 | DEFVAR_PER_BUFFER ("buffer-display-count", |
| 6062 | ¤t_buffer->display_count, Qnil, | 6068 | &B_ (current_buffer, display_count), Qnil, |
| 6063 | doc: /* A number incremented each time this buffer is displayed in a window. | 6069 | doc: /* A number incremented each time this buffer is displayed in a window. |
| 6064 | The function `set-window-buffer' increments it. */); | 6070 | The function `set-window-buffer' increments it. */); |
| 6065 | 6071 | ||
| 6066 | DEFVAR_PER_BUFFER ("buffer-display-time", | 6072 | DEFVAR_PER_BUFFER ("buffer-display-time", |
| 6067 | ¤t_buffer->display_time, Qnil, | 6073 | &B_ (current_buffer, display_time), Qnil, |
| 6068 | doc: /* Time stamp updated each time this buffer is displayed in a window. | 6074 | doc: /* Time stamp updated each time this buffer is displayed in a window. |
| 6069 | The function `set-window-buffer' updates this variable | 6075 | The function `set-window-buffer' updates this variable |
| 6070 | to the value obtained by calling `current-time'. | 6076 | to the value obtained by calling `current-time'. |
| @@ -6099,7 +6105,7 @@ and disregard a `read-only' text property if the property value | |||
| 6099 | is a member of the list. */); | 6105 | is a member of the list. */); |
| 6100 | Vinhibit_read_only = Qnil; | 6106 | Vinhibit_read_only = Qnil; |
| 6101 | 6107 | ||
| 6102 | DEFVAR_PER_BUFFER ("cursor-type", ¤t_buffer->cursor_type, Qnil, | 6108 | DEFVAR_PER_BUFFER ("cursor-type", &B_ (current_buffer, cursor_type), Qnil, |
| 6103 | doc: /* Cursor to use when this buffer is in the selected window. | 6109 | doc: /* Cursor to use when this buffer is in the selected window. |
| 6104 | Values are interpreted as follows: | 6110 | Values are interpreted as follows: |
| 6105 | 6111 | ||
| @@ -6118,7 +6124,7 @@ cursor's appearance is instead controlled by the variable | |||
| 6118 | `cursor-in-non-selected-windows'. */); | 6124 | `cursor-in-non-selected-windows'. */); |
| 6119 | 6125 | ||
| 6120 | DEFVAR_PER_BUFFER ("line-spacing", | 6126 | DEFVAR_PER_BUFFER ("line-spacing", |
| 6121 | ¤t_buffer->extra_line_spacing, Qnil, | 6127 | &B_ (current_buffer, extra_line_spacing), Qnil, |
| 6122 | doc: /* Additional space to put between lines when displaying a buffer. | 6128 | doc: /* Additional space to put between lines when displaying a buffer. |
| 6123 | The space is measured in pixels, and put below lines on graphic displays, | 6129 | The space is measured in pixels, and put below lines on graphic displays, |
| 6124 | see `display-graphic-p'. | 6130 | see `display-graphic-p'. |
| @@ -6126,7 +6132,7 @@ If value is a floating point number, it specifies the spacing relative | |||
| 6126 | to the default frame line height. A value of nil means add no extra space. */); | 6132 | to the default frame line height. A value of nil means add no extra space. */); |
| 6127 | 6133 | ||
| 6128 | DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", | 6134 | DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", |
| 6129 | ¤t_buffer->cursor_in_non_selected_windows, Qnil, | 6135 | &B_ (current_buffer, cursor_in_non_selected_windows), Qnil, |
| 6130 | doc: /* *Non-nil means show a cursor in non-selected windows. | 6136 | doc: /* *Non-nil means show a cursor in non-selected windows. |
| 6131 | If nil, only shows a cursor in the selected window. | 6137 | If nil, only shows a cursor in the selected window. |
| 6132 | If t, displays a cursor related to the usual cursor type | 6138 | 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) | |||
| 321 | /* Return character at byte position POS. */ | 321 | /* Return character at byte position POS. */ |
| 322 | 322 | ||
| 323 | #define FETCH_CHAR(pos) \ | 323 | #define FETCH_CHAR(pos) \ |
| 324 | (!NILP (current_buffer->enable_multibyte_characters) \ | 324 | (!NILP (B_ (current_buffer, enable_multibyte_characters)) \ |
| 325 | ? FETCH_MULTIBYTE_CHAR ((pos)) \ | 325 | ? FETCH_MULTIBYTE_CHAR ((pos)) \ |
| 326 | : FETCH_BYTE ((pos))) | 326 | : FETCH_BYTE ((pos))) |
| 327 | 327 | ||
| @@ -346,7 +346,7 @@ extern unsigned char *_fetch_multibyte_char_p; | |||
| 346 | multibyte. */ | 346 | multibyte. */ |
| 347 | 347 | ||
| 348 | #define FETCH_CHAR_AS_MULTIBYTE(pos) \ | 348 | #define FETCH_CHAR_AS_MULTIBYTE(pos) \ |
| 349 | (!NILP (current_buffer->enable_multibyte_characters) \ | 349 | (!NILP (B_ (current_buffer, enable_multibyte_characters)) \ |
| 350 | ? FETCH_MULTIBYTE_CHAR ((pos)) \ | 350 | ? FETCH_MULTIBYTE_CHAR ((pos)) \ |
| 351 | : UNIBYTE_TO_CHAR (FETCH_BYTE ((pos)))) | 351 | : UNIBYTE_TO_CHAR (FETCH_BYTE ((pos)))) |
| 352 | 352 | ||
| @@ -464,6 +464,15 @@ struct buffer_text | |||
| 464 | int inhibit_shrinking; | 464 | int inhibit_shrinking; |
| 465 | }; | 465 | }; |
| 466 | 466 | ||
| 467 | /* Lisp fields in struct buffer are hidden from most code and accessed | ||
| 468 | via the B_ macro, below. Only select pieces of code, like the GC, | ||
| 469 | are allowed to use BUFFER_INTERNAL_FIELD. */ | ||
| 470 | #define BUFFER_INTERNAL_FIELD(field) field ## _ | ||
| 471 | |||
| 472 | /* Most code should use this macro to access Lisp fields in struct | ||
| 473 | buffer. */ | ||
| 474 | #define B_(buf, field) ((buf)->BUFFER_INTERNAL_FIELD (field)) | ||
| 475 | |||
| 467 | /* This is the structure that the buffer Lisp object points to. */ | 476 | /* This is the structure that the buffer Lisp object points to. */ |
| 468 | 477 | ||
| 469 | struct buffer | 478 | struct buffer |
| @@ -587,138 +596,138 @@ struct buffer | |||
| 587 | because local variables have to be right in the struct buffer. | 596 | because local variables have to be right in the struct buffer. |
| 588 | So we copy it around in set_buffer_internal. | 597 | So we copy it around in set_buffer_internal. |
| 589 | This comes before `name' because it is marked in a special way. */ | 598 | This comes before `name' because it is marked in a special way. */ |
| 590 | Lisp_Object undo_list; | 599 | Lisp_Object BUFFER_INTERNAL_FIELD (undo_list); |
| 591 | 600 | ||
| 592 | /* The name of this buffer. */ | 601 | /* The name of this buffer. */ |
| 593 | Lisp_Object name; | 602 | Lisp_Object BUFFER_INTERNAL_FIELD (name); |
| 594 | 603 | ||
| 595 | /* The name of the file visited in this buffer, or nil. */ | 604 | /* The name of the file visited in this buffer, or nil. */ |
| 596 | Lisp_Object filename; | 605 | Lisp_Object BUFFER_INTERNAL_FIELD (filename); |
| 597 | /* Dir for expanding relative file names. */ | 606 | /* Dir for expanding relative file names. */ |
| 598 | Lisp_Object directory; | 607 | Lisp_Object BUFFER_INTERNAL_FIELD (directory); |
| 599 | /* True if this buffer has been backed up (if you write to the | 608 | /* True if this buffer has been backed up (if you write to the |
| 600 | visited file and it hasn't been backed up, then a backup will | 609 | visited file and it hasn't been backed up, then a backup will |
| 601 | be made). */ | 610 | be made). */ |
| 602 | /* This isn't really used by the C code, so could be deleted. */ | 611 | /* This isn't really used by the C code, so could be deleted. */ |
| 603 | Lisp_Object backed_up; | 612 | Lisp_Object BUFFER_INTERNAL_FIELD (backed_up); |
| 604 | /* Length of file when last read or saved. | 613 | /* Length of file when last read or saved. |
| 605 | -1 means auto saving turned off because buffer shrank a lot. | 614 | -1 means auto saving turned off because buffer shrank a lot. |
| 606 | -2 means don't turn off auto saving if buffer shrinks. | 615 | -2 means don't turn off auto saving if buffer shrinks. |
| 607 | (That value is used with buffer-swap-text.) | 616 | (That value is used with buffer-swap-text.) |
| 608 | This is not in the struct buffer_text | 617 | This is not in the struct buffer_text |
| 609 | because it's not used in indirect buffers at all. */ | 618 | because it's not used in indirect buffers at all. */ |
| 610 | Lisp_Object save_length; | 619 | Lisp_Object BUFFER_INTERNAL_FIELD (save_length); |
| 611 | /* File name used for auto-saving this buffer. | 620 | /* File name used for auto-saving this buffer. |
| 612 | This is not in the struct buffer_text | 621 | This is not in the struct buffer_text |
| 613 | because it's not used in indirect buffers at all. */ | 622 | because it's not used in indirect buffers at all. */ |
| 614 | Lisp_Object auto_save_file_name; | 623 | Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_name); |
| 615 | 624 | ||
| 616 | /* Non-nil if buffer read-only. */ | 625 | /* Non-nil if buffer read-only. */ |
| 617 | Lisp_Object read_only; | 626 | Lisp_Object BUFFER_INTERNAL_FIELD (read_only); |
| 618 | /* "The mark". This is a marker which may | 627 | /* "The mark". This is a marker which may |
| 619 | point into this buffer or may point nowhere. */ | 628 | point into this buffer or may point nowhere. */ |
| 620 | Lisp_Object mark; | 629 | Lisp_Object BUFFER_INTERNAL_FIELD (mark); |
| 621 | 630 | ||
| 622 | /* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all | 631 | /* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all |
| 623 | per-buffer variables of this buffer. For locally unbound | 632 | per-buffer variables of this buffer. For locally unbound |
| 624 | symbols, just the symbol appears as the element. */ | 633 | symbols, just the symbol appears as the element. */ |
| 625 | Lisp_Object local_var_alist; | 634 | Lisp_Object BUFFER_INTERNAL_FIELD (local_var_alist); |
| 626 | 635 | ||
| 627 | /* Symbol naming major mode (eg, lisp-mode). */ | 636 | /* Symbol naming major mode (eg, lisp-mode). */ |
| 628 | Lisp_Object major_mode; | 637 | Lisp_Object BUFFER_INTERNAL_FIELD (major_mode); |
| 629 | /* Pretty name of major mode (eg, "Lisp"). */ | 638 | /* Pretty name of major mode (eg, "Lisp"). */ |
| 630 | Lisp_Object mode_name; | 639 | Lisp_Object BUFFER_INTERNAL_FIELD (mode_name); |
| 631 | /* Mode line element that controls format of mode line. */ | 640 | /* Mode line element that controls format of mode line. */ |
| 632 | Lisp_Object mode_line_format; | 641 | Lisp_Object BUFFER_INTERNAL_FIELD (mode_line_format); |
| 633 | 642 | ||
| 634 | /* Analogous to mode_line_format for the line displayed at the top | 643 | /* Analogous to mode_line_format for the line displayed at the top |
| 635 | of windows. Nil means don't display that line. */ | 644 | of windows. Nil means don't display that line. */ |
| 636 | Lisp_Object header_line_format; | 645 | Lisp_Object BUFFER_INTERNAL_FIELD (header_line_format); |
| 637 | 646 | ||
| 638 | /* Keys that are bound local to this buffer. */ | 647 | /* Keys that are bound local to this buffer. */ |
| 639 | Lisp_Object keymap; | 648 | Lisp_Object BUFFER_INTERNAL_FIELD (keymap); |
| 640 | /* This buffer's local abbrev table. */ | 649 | /* This buffer's local abbrev table. */ |
| 641 | Lisp_Object abbrev_table; | 650 | Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_table); |
| 642 | /* This buffer's syntax table. */ | 651 | /* This buffer's syntax table. */ |
| 643 | Lisp_Object syntax_table; | 652 | Lisp_Object BUFFER_INTERNAL_FIELD (syntax_table); |
| 644 | /* This buffer's category table. */ | 653 | /* This buffer's category table. */ |
| 645 | Lisp_Object category_table; | 654 | Lisp_Object BUFFER_INTERNAL_FIELD (category_table); |
| 646 | 655 | ||
| 647 | /* Values of several buffer-local variables. */ | 656 | /* Values of several buffer-local variables. */ |
| 648 | /* tab-width is buffer-local so that redisplay can find it | 657 | /* tab-width is buffer-local so that redisplay can find it |
| 649 | in buffers that are not current. */ | 658 | in buffers that are not current. */ |
| 650 | Lisp_Object case_fold_search; | 659 | Lisp_Object BUFFER_INTERNAL_FIELD (case_fold_search); |
| 651 | Lisp_Object tab_width; | 660 | Lisp_Object BUFFER_INTERNAL_FIELD (tab_width); |
| 652 | Lisp_Object fill_column; | 661 | Lisp_Object BUFFER_INTERNAL_FIELD (fill_column); |
| 653 | Lisp_Object left_margin; | 662 | Lisp_Object BUFFER_INTERNAL_FIELD (left_margin); |
| 654 | /* Function to call when insert space past fill column. */ | 663 | /* Function to call when insert space past fill column. */ |
| 655 | Lisp_Object auto_fill_function; | 664 | Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function); |
| 656 | /* nil: text, t: binary. | 665 | /* nil: text, t: binary. |
| 657 | This value is meaningful only on certain operating systems. */ | 666 | This value is meaningful only on certain operating systems. */ |
| 658 | /* Actually, we don't need this flag any more because end-of-line | 667 | /* Actually, we don't need this flag any more because end-of-line |
| 659 | is handled correctly according to the buffer-file-coding-system | 668 | is handled correctly according to the buffer-file-coding-system |
| 660 | of the buffer. Just keeping it for backward compatibility. */ | 669 | of the buffer. Just keeping it for backward compatibility. */ |
| 661 | Lisp_Object buffer_file_type; | 670 | Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_type); |
| 662 | 671 | ||
| 663 | /* Case table for case-conversion in this buffer. | 672 | /* Case table for case-conversion in this buffer. |
| 664 | This char-table maps each char into its lower-case version. */ | 673 | This char-table maps each char into its lower-case version. */ |
| 665 | Lisp_Object downcase_table; | 674 | Lisp_Object BUFFER_INTERNAL_FIELD (downcase_table); |
| 666 | /* Char-table mapping each char to its upper-case version. */ | 675 | /* Char-table mapping each char to its upper-case version. */ |
| 667 | Lisp_Object upcase_table; | 676 | Lisp_Object BUFFER_INTERNAL_FIELD (upcase_table); |
| 668 | /* Char-table for conversion for case-folding search. */ | 677 | /* Char-table for conversion for case-folding search. */ |
| 669 | Lisp_Object case_canon_table; | 678 | Lisp_Object BUFFER_INTERNAL_FIELD (case_canon_table); |
| 670 | /* Char-table of equivalences for case-folding search. */ | 679 | /* Char-table of equivalences for case-folding search. */ |
| 671 | Lisp_Object case_eqv_table; | 680 | Lisp_Object BUFFER_INTERNAL_FIELD (case_eqv_table); |
| 672 | 681 | ||
| 673 | /* Non-nil means do not display continuation lines. */ | 682 | /* Non-nil means do not display continuation lines. */ |
| 674 | Lisp_Object truncate_lines; | 683 | Lisp_Object BUFFER_INTERNAL_FIELD (truncate_lines); |
| 675 | /* Non-nil means to use word wrapping when displaying continuation lines. */ | 684 | /* Non-nil means to use word wrapping when displaying continuation lines. */ |
| 676 | Lisp_Object word_wrap; | 685 | Lisp_Object BUFFER_INTERNAL_FIELD (word_wrap); |
| 677 | /* Non-nil means display ctl chars with uparrow. */ | 686 | /* Non-nil means display ctl chars with uparrow. */ |
| 678 | Lisp_Object ctl_arrow; | 687 | Lisp_Object BUFFER_INTERNAL_FIELD (ctl_arrow); |
| 679 | /* Non-nil means reorder bidirectional text for display in the | 688 | /* Non-nil means reorder bidirectional text for display in the |
| 680 | visual order. */ | 689 | visual order. */ |
| 681 | Lisp_Object bidi_display_reordering; | 690 | Lisp_Object BUFFER_INTERNAL_FIELD (bidi_display_reordering); |
| 682 | /* If non-nil, specifies which direction of text to force in all the | 691 | /* If non-nil, specifies which direction of text to force in all the |
| 683 | paragraphs of the buffer. Nil means determine paragraph | 692 | paragraphs of the buffer. Nil means determine paragraph |
| 684 | direction dynamically for each paragraph. */ | 693 | direction dynamically for each paragraph. */ |
| 685 | Lisp_Object bidi_paragraph_direction; | 694 | Lisp_Object BUFFER_INTERNAL_FIELD (bidi_paragraph_direction); |
| 686 | /* Non-nil means do selective display; | 695 | /* Non-nil means do selective display; |
| 687 | see doc string in syms_of_buffer (buffer.c) for details. */ | 696 | see doc string in syms_of_buffer (buffer.c) for details. */ |
| 688 | Lisp_Object selective_display; | 697 | Lisp_Object BUFFER_INTERNAL_FIELD (selective_display); |
| 689 | #ifndef old | 698 | #ifndef old |
| 690 | /* Non-nil means show ... at end of line followed by invisible lines. */ | 699 | /* Non-nil means show ... at end of line followed by invisible lines. */ |
| 691 | Lisp_Object selective_display_ellipses; | 700 | Lisp_Object BUFFER_INTERNAL_FIELD (selective_display_ellipses); |
| 692 | #endif | 701 | #endif |
| 693 | /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ | 702 | /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ |
| 694 | Lisp_Object minor_modes; | 703 | Lisp_Object BUFFER_INTERNAL_FIELD (minor_modes); |
| 695 | /* t if "self-insertion" should overwrite; `binary' if it should also | 704 | /* t if "self-insertion" should overwrite; `binary' if it should also |
| 696 | overwrite newlines and tabs - for editing executables and the like. */ | 705 | overwrite newlines and tabs - for editing executables and the like. */ |
| 697 | Lisp_Object overwrite_mode; | 706 | Lisp_Object BUFFER_INTERNAL_FIELD (overwrite_mode); |
| 698 | /* non-nil means abbrev mode is on. Expand abbrevs automatically. */ | 707 | /* non-nil means abbrev mode is on. Expand abbrevs automatically. */ |
| 699 | Lisp_Object abbrev_mode; | 708 | Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_mode); |
| 700 | /* Display table to use for text in this buffer. */ | 709 | /* Display table to use for text in this buffer. */ |
| 701 | Lisp_Object display_table; | 710 | Lisp_Object BUFFER_INTERNAL_FIELD (display_table); |
| 702 | /* t means the mark and region are currently active. */ | 711 | /* t means the mark and region are currently active. */ |
| 703 | Lisp_Object mark_active; | 712 | Lisp_Object BUFFER_INTERNAL_FIELD (mark_active); |
| 704 | 713 | ||
| 705 | /* Non-nil means the buffer contents are regarded as multi-byte | 714 | /* Non-nil means the buffer contents are regarded as multi-byte |
| 706 | form of characters, not a binary code. */ | 715 | form of characters, not a binary code. */ |
| 707 | Lisp_Object enable_multibyte_characters; | 716 | Lisp_Object BUFFER_INTERNAL_FIELD (enable_multibyte_characters); |
| 708 | 717 | ||
| 709 | /* Coding system to be used for encoding the buffer contents on | 718 | /* Coding system to be used for encoding the buffer contents on |
| 710 | saving. */ | 719 | saving. */ |
| 711 | Lisp_Object buffer_file_coding_system; | 720 | Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_coding_system); |
| 712 | 721 | ||
| 713 | /* List of symbols naming the file format used for visited file. */ | 722 | /* List of symbols naming the file format used for visited file. */ |
| 714 | Lisp_Object file_format; | 723 | Lisp_Object BUFFER_INTERNAL_FIELD (file_format); |
| 715 | 724 | ||
| 716 | /* List of symbols naming the file format used for auto-save file. */ | 725 | /* List of symbols naming the file format used for auto-save file. */ |
| 717 | Lisp_Object auto_save_file_format; | 726 | Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_format); |
| 718 | 727 | ||
| 719 | /* True if the newline position cache and width run cache are | 728 | /* True if the newline position cache and width run cache are |
| 720 | enabled. See search.c and indent.c. */ | 729 | enabled. See search.c and indent.c. */ |
| 721 | Lisp_Object cache_long_line_scans; | 730 | Lisp_Object BUFFER_INTERNAL_FIELD (cache_long_line_scans); |
| 722 | 731 | ||
| 723 | /* If the width run cache is enabled, this table contains the | 732 | /* If the width run cache is enabled, this table contains the |
| 724 | character widths width_run_cache (see above) assumes. When we | 733 | character widths width_run_cache (see above) assumes. When we |
| @@ -726,99 +735,99 @@ struct buffer | |||
| 726 | current display table to see whether the display table has | 735 | current display table to see whether the display table has |
| 727 | affected the widths of any characters. If it has, we | 736 | affected the widths of any characters. If it has, we |
| 728 | invalidate the width run cache, and re-initialize width_table. */ | 737 | invalidate the width run cache, and re-initialize width_table. */ |
| 729 | Lisp_Object width_table; | 738 | Lisp_Object BUFFER_INTERNAL_FIELD (width_table); |
| 730 | 739 | ||
| 731 | /* In an indirect buffer, or a buffer that is the base of an | 740 | /* In an indirect buffer, or a buffer that is the base of an |
| 732 | indirect buffer, this holds a marker that records | 741 | indirect buffer, this holds a marker that records |
| 733 | PT for this buffer when the buffer is not current. */ | 742 | PT for this buffer when the buffer is not current. */ |
| 734 | Lisp_Object pt_marker; | 743 | Lisp_Object BUFFER_INTERNAL_FIELD (pt_marker); |
| 735 | 744 | ||
| 736 | /* In an indirect buffer, or a buffer that is the base of an | 745 | /* In an indirect buffer, or a buffer that is the base of an |
| 737 | indirect buffer, this holds a marker that records | 746 | indirect buffer, this holds a marker that records |
| 738 | BEGV for this buffer when the buffer is not current. */ | 747 | BEGV for this buffer when the buffer is not current. */ |
| 739 | Lisp_Object begv_marker; | 748 | Lisp_Object BUFFER_INTERNAL_FIELD (begv_marker); |
| 740 | 749 | ||
| 741 | /* In an indirect buffer, or a buffer that is the base of an | 750 | /* In an indirect buffer, or a buffer that is the base of an |
| 742 | indirect buffer, this holds a marker that records | 751 | indirect buffer, this holds a marker that records |
| 743 | ZV for this buffer when the buffer is not current. */ | 752 | ZV for this buffer when the buffer is not current. */ |
| 744 | Lisp_Object zv_marker; | 753 | Lisp_Object BUFFER_INTERNAL_FIELD (zv_marker); |
| 745 | 754 | ||
| 746 | /* This holds the point value before the last scroll operation. | 755 | /* This holds the point value before the last scroll operation. |
| 747 | Explicitly setting point sets this to nil. */ | 756 | Explicitly setting point sets this to nil. */ |
| 748 | Lisp_Object point_before_scroll; | 757 | Lisp_Object BUFFER_INTERNAL_FIELD (point_before_scroll); |
| 749 | 758 | ||
| 750 | /* Truename of the visited file, or nil. */ | 759 | /* Truename of the visited file, or nil. */ |
| 751 | Lisp_Object file_truename; | 760 | Lisp_Object BUFFER_INTERNAL_FIELD (file_truename); |
| 752 | 761 | ||
| 753 | /* Invisibility spec of this buffer. | 762 | /* Invisibility spec of this buffer. |
| 754 | t => any non-nil `invisible' property means invisible. | 763 | t => any non-nil `invisible' property means invisible. |
| 755 | A list => `invisible' property means invisible | 764 | A list => `invisible' property means invisible |
| 756 | if it is memq in that list. */ | 765 | if it is memq in that list. */ |
| 757 | Lisp_Object invisibility_spec; | 766 | Lisp_Object BUFFER_INTERNAL_FIELD (invisibility_spec); |
| 758 | 767 | ||
| 759 | /* This is the last window that was selected with this buffer in it, | 768 | /* This is the last window that was selected with this buffer in it, |
| 760 | or nil if that window no longer displays this buffer. */ | 769 | or nil if that window no longer displays this buffer. */ |
| 761 | Lisp_Object last_selected_window; | 770 | Lisp_Object BUFFER_INTERNAL_FIELD (last_selected_window); |
| 762 | 771 | ||
| 763 | /* Incremented each time the buffer is displayed in a window. */ | 772 | /* Incremented each time the buffer is displayed in a window. */ |
| 764 | Lisp_Object display_count; | 773 | Lisp_Object BUFFER_INTERNAL_FIELD (display_count); |
| 765 | 774 | ||
| 766 | /* Widths of left and right marginal areas for windows displaying | 775 | /* Widths of left and right marginal areas for windows displaying |
| 767 | this buffer. */ | 776 | this buffer. */ |
| 768 | Lisp_Object left_margin_cols, right_margin_cols; | 777 | Lisp_Object BUFFER_INTERNAL_FIELD (left_margin_cols), BUFFER_INTERNAL_FIELD (right_margin_cols); |
| 769 | 778 | ||
| 770 | /* Widths of left and right fringe areas for windows displaying | 779 | /* Widths of left and right fringe areas for windows displaying |
| 771 | this buffer. */ | 780 | this buffer. */ |
| 772 | Lisp_Object left_fringe_width, right_fringe_width; | 781 | Lisp_Object BUFFER_INTERNAL_FIELD (left_fringe_width), BUFFER_INTERNAL_FIELD (right_fringe_width); |
| 773 | 782 | ||
| 774 | /* Non-nil means fringes are drawn outside display margins; | 783 | /* Non-nil means fringes are drawn outside display margins; |
| 775 | othersize draw them between margin areas and text. */ | 784 | othersize draw them between margin areas and text. */ |
| 776 | Lisp_Object fringes_outside_margins; | 785 | Lisp_Object BUFFER_INTERNAL_FIELD (fringes_outside_margins); |
| 777 | 786 | ||
| 778 | /* Width and type of scroll bar areas for windows displaying | 787 | /* Width and type of scroll bar areas for windows displaying |
| 779 | this buffer. */ | 788 | this buffer. */ |
| 780 | Lisp_Object scroll_bar_width, vertical_scroll_bar_type; | 789 | Lisp_Object BUFFER_INTERNAL_FIELD (scroll_bar_width), BUFFER_INTERNAL_FIELD (vertical_scroll_bar_type); |
| 781 | 790 | ||
| 782 | /* Non-nil means indicate lines not displaying text (in a style | 791 | /* Non-nil means indicate lines not displaying text (in a style |
| 783 | like vi). */ | 792 | like vi). */ |
| 784 | Lisp_Object indicate_empty_lines; | 793 | Lisp_Object BUFFER_INTERNAL_FIELD (indicate_empty_lines); |
| 785 | 794 | ||
| 786 | /* Non-nil means indicate buffer boundaries and scrolling. */ | 795 | /* Non-nil means indicate buffer boundaries and scrolling. */ |
| 787 | Lisp_Object indicate_buffer_boundaries; | 796 | Lisp_Object BUFFER_INTERNAL_FIELD (indicate_buffer_boundaries); |
| 788 | 797 | ||
| 789 | /* Logical to physical fringe bitmap mappings. */ | 798 | /* Logical to physical fringe bitmap mappings. */ |
| 790 | Lisp_Object fringe_indicator_alist; | 799 | Lisp_Object BUFFER_INTERNAL_FIELD (fringe_indicator_alist); |
| 791 | 800 | ||
| 792 | /* Logical to physical cursor bitmap mappings. */ | 801 | /* Logical to physical cursor bitmap mappings. */ |
| 793 | Lisp_Object fringe_cursor_alist; | 802 | Lisp_Object BUFFER_INTERNAL_FIELD (fringe_cursor_alist); |
| 794 | 803 | ||
| 795 | /* Time stamp updated each time this buffer is displayed in a window. */ | 804 | /* Time stamp updated each time this buffer is displayed in a window. */ |
| 796 | Lisp_Object display_time; | 805 | Lisp_Object BUFFER_INTERNAL_FIELD (display_time); |
| 797 | 806 | ||
| 798 | /* If scrolling the display because point is below the bottom of a | 807 | /* If scrolling the display because point is below the bottom of a |
| 799 | window showing this buffer, try to choose a window start so | 808 | window showing this buffer, try to choose a window start so |
| 800 | that point ends up this number of lines from the top of the | 809 | that point ends up this number of lines from the top of the |
| 801 | window. Nil means that scrolling method isn't used. */ | 810 | window. Nil means that scrolling method isn't used. */ |
| 802 | Lisp_Object scroll_up_aggressively; | 811 | Lisp_Object BUFFER_INTERNAL_FIELD (scroll_up_aggressively); |
| 803 | 812 | ||
| 804 | /* If scrolling the display because point is above the top of a | 813 | /* If scrolling the display because point is above the top of a |
| 805 | window showing this buffer, try to choose a window start so | 814 | window showing this buffer, try to choose a window start so |
| 806 | that point ends up this number of lines from the bottom of the | 815 | that point ends up this number of lines from the bottom of the |
| 807 | window. Nil means that scrolling method isn't used. */ | 816 | window. Nil means that scrolling method isn't used. */ |
| 808 | Lisp_Object scroll_down_aggressively; | 817 | Lisp_Object BUFFER_INTERNAL_FIELD (scroll_down_aggressively); |
| 809 | 818 | ||
| 810 | /* Desired cursor type in this buffer. See the doc string of | 819 | /* Desired cursor type in this buffer. See the doc string of |
| 811 | per-buffer variable `cursor-type'. */ | 820 | per-buffer variable `cursor-type'. */ |
| 812 | Lisp_Object cursor_type; | 821 | Lisp_Object BUFFER_INTERNAL_FIELD (cursor_type); |
| 813 | 822 | ||
| 814 | /* An integer > 0 means put that number of pixels below text lines | 823 | /* An integer > 0 means put that number of pixels below text lines |
| 815 | in the display of this buffer. */ | 824 | in the display of this buffer. */ |
| 816 | Lisp_Object extra_line_spacing; | 825 | Lisp_Object BUFFER_INTERNAL_FIELD (extra_line_spacing); |
| 817 | 826 | ||
| 818 | /* *Cursor type to display in non-selected windows. | 827 | /* *Cursor type to display in non-selected windows. |
| 819 | t means to use hollow box cursor. | 828 | t means to use hollow box cursor. |
| 820 | See `cursor-type' for other values. */ | 829 | See `cursor-type' for other values. */ |
| 821 | Lisp_Object cursor_in_non_selected_windows; | 830 | Lisp_Object BUFFER_INTERNAL_FIELD (cursor_in_non_selected_windows); |
| 822 | }; | 831 | }; |
| 823 | 832 | ||
| 824 | 833 | ||
| @@ -942,7 +951,7 @@ extern int last_per_buffer_idx; | |||
| 942 | from the start of a buffer structure. */ | 951 | from the start of a buffer structure. */ |
| 943 | 952 | ||
| 944 | #define PER_BUFFER_VAR_OFFSET(VAR) \ | 953 | #define PER_BUFFER_VAR_OFFSET(VAR) \ |
| 945 | offsetof (struct buffer, VAR) | 954 | offsetof (struct buffer, BUFFER_INTERNAL_FIELD (VAR)) |
| 946 | 955 | ||
| 947 | /* Return the index of buffer-local variable VAR. Each per-buffer | 956 | /* Return the index of buffer-local variable VAR. Each per-buffer |
| 948 | variable has an index > 0 associated with it, except when it always | 957 | 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. */) | |||
| 1398 | CHECK_CHARACTER (TOP); | 1398 | CHECK_CHARACTER (TOP); |
| 1399 | AFTER_POTENTIAL_GC (); | 1399 | AFTER_POTENTIAL_GC (); |
| 1400 | c = XFASTINT (TOP); | 1400 | c = XFASTINT (TOP); |
| 1401 | if (NILP (current_buffer->enable_multibyte_characters)) | 1401 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 1402 | MAKE_CHAR_MULTIBYTE (c); | 1402 | MAKE_CHAR_MULTIBYTE (c); |
| 1403 | XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]); | 1403 | XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]); |
| 1404 | } | 1404 | } |
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 | |||
| 149 | check_mark (int for_region) | 149 | check_mark (int for_region) |
| 150 | { | 150 | { |
| 151 | Lisp_Object tem; | 151 | Lisp_Object tem; |
| 152 | tem = Fmarker_buffer (current_buffer->mark); | 152 | tem = Fmarker_buffer (B_ (current_buffer, mark)); |
| 153 | if (NILP (tem) || (XBUFFER (tem) != current_buffer)) | 153 | if (NILP (tem) || (XBUFFER (tem) != current_buffer)) |
| 154 | error (for_region ? "The mark is not set now, so there is no region" | 154 | error (for_region ? "The mark is not set now, so there is no region" |
| 155 | : "The mark is not set now"); | 155 | : "The mark is not set now"); |
| 156 | if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive) | 156 | if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive) |
| 157 | && NILP (current_buffer->mark_active)) | 157 | && NILP (B_ (current_buffer, mark_active))) |
| 158 | xsignal0 (Qmark_inactive); | 158 | xsignal0 (Qmark_inactive); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| @@ -385,7 +385,7 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 385 | else if (*string == '*') | 385 | else if (*string == '*') |
| 386 | { | 386 | { |
| 387 | string++; | 387 | string++; |
| 388 | if (!NILP (current_buffer->read_only)) | 388 | if (!NILP (B_ (current_buffer, read_only))) |
| 389 | { | 389 | { |
| 390 | if (!NILP (record_flag)) | 390 | if (!NILP (record_flag)) |
| 391 | { | 391 | { |
| @@ -543,7 +543,7 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 543 | 543 | ||
| 544 | case 'D': /* Directory name. */ | 544 | case 'D': /* Directory name. */ |
| 545 | args[i] = Fread_file_name (callint_message, Qnil, | 545 | args[i] = Fread_file_name (callint_message, Qnil, |
| 546 | current_buffer->directory, Qlambda, Qnil, | 546 | B_ (current_buffer, directory), Qlambda, Qnil, |
| 547 | Qfile_directory_p); | 547 | Qfile_directory_p); |
| 548 | break; | 548 | break; |
| 549 | 549 | ||
| @@ -661,7 +661,7 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 661 | case 'm': /* Value of mark. Does not do I/O. */ | 661 | case 'm': /* Value of mark. Does not do I/O. */ |
| 662 | check_mark (0); | 662 | check_mark (0); |
| 663 | /* visargs[i] = Qnil; */ | 663 | /* visargs[i] = Qnil; */ |
| 664 | args[i] = current_buffer->mark; | 664 | args[i] = B_ (current_buffer, mark); |
| 665 | varies[i] = 2; | 665 | varies[i] = 2; |
| 666 | break; | 666 | break; |
| 667 | 667 | ||
| @@ -717,11 +717,11 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 717 | check_mark (1); | 717 | check_mark (1); |
| 718 | set_marker_both (point_marker, Qnil, PT, PT_BYTE); | 718 | set_marker_both (point_marker, Qnil, PT, PT_BYTE); |
| 719 | /* visargs[i+1] = Qnil; */ | 719 | /* visargs[i+1] = Qnil; */ |
| 720 | foo = marker_position (current_buffer->mark); | 720 | foo = marker_position (B_ (current_buffer, mark)); |
| 721 | /* visargs[i] = Qnil; */ | 721 | /* visargs[i] = Qnil; */ |
| 722 | args[i] = PT < foo ? point_marker : current_buffer->mark; | 722 | args[i] = PT < foo ? point_marker : B_ (current_buffer, mark); |
| 723 | varies[i] = 3; | 723 | varies[i] = 3; |
| 724 | args[++i] = PT > foo ? point_marker : current_buffer->mark; | 724 | args[++i] = PT > foo ? point_marker : B_ (current_buffer, mark); |
| 725 | varies[i] = 4; | 725 | varies[i] = 4; |
| 726 | break; | 726 | break; |
| 727 | 727 | ||
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) */) | |||
| 265 | 265 | ||
| 266 | if (nargs >= 2 && ! NILP (args[1])) | 266 | if (nargs >= 2 && ! NILP (args[1])) |
| 267 | { | 267 | { |
| 268 | infile = Fexpand_file_name (args[1], current_buffer->directory); | 268 | infile = Fexpand_file_name (args[1], B_ (current_buffer, directory)); |
| 269 | CHECK_STRING (infile); | 269 | CHECK_STRING (infile); |
| 270 | } | 270 | } |
| 271 | else | 271 | else |
| @@ -322,7 +322,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 322 | { | 322 | { |
| 323 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 323 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 324 | 324 | ||
| 325 | current_dir = current_buffer->directory; | 325 | current_dir = B_ (current_buffer, directory); |
| 326 | 326 | ||
| 327 | GCPRO4 (infile, buffer, current_dir, error_file); | 327 | GCPRO4 (infile, buffer, current_dir, error_file); |
| 328 | 328 | ||
| @@ -336,7 +336,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 336 | 336 | ||
| 337 | if (NILP (Ffile_accessible_directory_p (current_dir))) | 337 | if (NILP (Ffile_accessible_directory_p (current_dir))) |
| 338 | report_file_error ("Setting current directory", | 338 | report_file_error ("Setting current directory", |
| 339 | Fcons (current_buffer->directory, Qnil)); | 339 | Fcons (B_ (current_buffer, directory), Qnil)); |
| 340 | 340 | ||
| 341 | if (STRING_MULTIBYTE (infile)) | 341 | if (STRING_MULTIBYTE (infile)) |
| 342 | infile = ENCODE_FILE (infile); | 342 | infile = ENCODE_FILE (infile); |
| @@ -663,7 +663,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 663 | /* In unibyte mode, character code conversion should not take | 663 | /* In unibyte mode, character code conversion should not take |
| 664 | place but EOL conversion should. So, setup raw-text or one | 664 | place but EOL conversion should. So, setup raw-text or one |
| 665 | of the subsidiary according to the information just setup. */ | 665 | of the subsidiary according to the information just setup. */ |
| 666 | if (NILP (current_buffer->enable_multibyte_characters) | 666 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 667 | && !NILP (val)) | 667 | && !NILP (val)) |
| 668 | val = raw_text_coding_system (val); | 668 | val = raw_text_coding_system (val); |
| 669 | setup_coding_system (val, &process_coding); | 669 | setup_coding_system (val, &process_coding); |
| @@ -713,7 +713,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 713 | 713 | ||
| 714 | if (!NILP (buffer)) | 714 | if (!NILP (buffer)) |
| 715 | { | 715 | { |
| 716 | if (NILP (current_buffer->enable_multibyte_characters) | 716 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 717 | && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) | 717 | && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) |
| 718 | insert_1_both (buf, nread, nread, 0, 1, 0); | 718 | insert_1_both (buf, nread, nread, 0, 1, 0); |
| 719 | else | 719 | else |
| @@ -926,7 +926,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 926 | /* Decide coding-system of the contents of the temporary file. */ | 926 | /* Decide coding-system of the contents of the temporary file. */ |
| 927 | if (!NILP (Vcoding_system_for_write)) | 927 | if (!NILP (Vcoding_system_for_write)) |
| 928 | val = Vcoding_system_for_write; | 928 | val = Vcoding_system_for_write; |
| 929 | else if (NILP (current_buffer->enable_multibyte_characters)) | 929 | else if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 930 | val = Qraw_text; | 930 | val = Qraw_text; |
| 931 | else | 931 | else |
| 932 | { | 932 | { |
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) | |||
| 39 | register int inword = flag == CASE_DOWN; | 39 | register int inword = flag == CASE_DOWN; |
| 40 | 40 | ||
| 41 | /* If the case table is flagged as modified, rescan it. */ | 41 | /* If the case table is flagged as modified, rescan it. */ |
| 42 | if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1])) | 42 | if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1])) |
| 43 | Fset_case_table (current_buffer->downcase_table); | 43 | Fset_case_table (B_ (current_buffer, downcase_table)); |
| 44 | 44 | ||
| 45 | if (INTEGERP (obj)) | 45 | if (INTEGERP (obj)) |
| 46 | { | 46 | { |
| 47 | int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | 47 | int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER |
| 48 | | CHAR_SHIFT | CHAR_CTL | CHAR_META); | 48 | | CHAR_SHIFT | CHAR_CTL | CHAR_META); |
| 49 | int flags = XINT (obj) & flagbits; | 49 | int flags = XINT (obj) & flagbits; |
| 50 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 50 | int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 51 | 51 | ||
| 52 | /* If the character has higher bits set | 52 | /* If the character has higher bits set |
| 53 | above the flags, return it unchanged. | 53 | above the flags, return it unchanged. |
| @@ -198,7 +198,7 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) | |||
| 198 | { | 198 | { |
| 199 | register int c; | 199 | register int c; |
| 200 | register int inword = flag == CASE_DOWN; | 200 | register int inword = flag == CASE_DOWN; |
| 201 | register int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 201 | register int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 202 | EMACS_INT start, end; | 202 | EMACS_INT start, end; |
| 203 | EMACS_INT start_byte, end_byte; | 203 | EMACS_INT start_byte, end_byte; |
| 204 | EMACS_INT first = -1, last; /* Position of first and last changes. */ | 204 | EMACS_INT first = -1, last; /* Position of first and last changes. */ |
| @@ -210,8 +210,8 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) | |||
| 210 | return; | 210 | return; |
| 211 | 211 | ||
| 212 | /* If the case table is flagged as modified, rescan it. */ | 212 | /* If the case table is flagged as modified, rescan it. */ |
| 213 | if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1])) | 213 | if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1])) |
| 214 | Fset_case_table (current_buffer->downcase_table); | 214 | Fset_case_table (B_ (current_buffer, downcase_table)); |
| 215 | 215 | ||
| 216 | validate_region (&b, &e); | 216 | validate_region (&b, &e); |
| 217 | start = XFASTINT (b); | 217 | start = XFASTINT (b); |
diff --git a/src/casetab.c b/src/casetab.c index 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, | |||
| 71 | doc: /* Return the case table of the current buffer. */) | 71 | doc: /* Return the case table of the current buffer. */) |
| 72 | (void) | 72 | (void) |
| 73 | { | 73 | { |
| 74 | return current_buffer->downcase_table; | 74 | return B_ (current_buffer, downcase_table); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | DEFUN ("standard-case-table", Fstandard_case_table, Sstandard_case_table, 0, 0, 0, | 77 | 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) | |||
| 160 | } | 160 | } |
| 161 | else | 161 | else |
| 162 | { | 162 | { |
| 163 | current_buffer->downcase_table = table; | 163 | B_ (current_buffer, downcase_table) = table; |
| 164 | current_buffer->upcase_table = up; | 164 | B_ (current_buffer, upcase_table) = up; |
| 165 | current_buffer->case_canon_table = canon; | 165 | B_ (current_buffer, case_canon_table) = canon; |
| 166 | current_buffer->case_eqv_table = eqv; | 166 | B_ (current_buffer, case_eqv_table) = eqv; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | return table; | 169 | return table; |
diff --git a/src/category.c b/src/category.c index 06046959b6f..bf8269ffd75 100644 --- a/src/category.c +++ b/src/category.c | |||
| @@ -190,7 +190,7 @@ Lisp_Object | |||
| 190 | check_category_table (Lisp_Object table) | 190 | check_category_table (Lisp_Object table) |
| 191 | { | 191 | { |
| 192 | if (NILP (table)) | 192 | if (NILP (table)) |
| 193 | return current_buffer->category_table; | 193 | return B_ (current_buffer, category_table); |
| 194 | CHECK_TYPE (!NILP (Fcategory_table_p (table)), Qcategory_table_p, table); | 194 | CHECK_TYPE (!NILP (Fcategory_table_p (table)), Qcategory_table_p, table); |
| 195 | return table; | 195 | return table; |
| 196 | } | 196 | } |
| @@ -200,7 +200,7 @@ DEFUN ("category-table", Fcategory_table, Scategory_table, 0, 0, 0, | |||
| 200 | This is the one specified by the current buffer. */) | 200 | This is the one specified by the current buffer. */) |
| 201 | (void) | 201 | (void) |
| 202 | { | 202 | { |
| 203 | return current_buffer->category_table; | 203 | return B_ (current_buffer, category_table); |
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | DEFUN ("standard-category-table", Fstandard_category_table, | 206 | DEFUN ("standard-category-table", Fstandard_category_table, |
| @@ -281,7 +281,7 @@ Return TABLE. */) | |||
| 281 | { | 281 | { |
| 282 | int idx; | 282 | int idx; |
| 283 | table = check_category_table (table); | 283 | table = check_category_table (table); |
| 284 | current_buffer->category_table = table; | 284 | B_ (current_buffer, category_table) = table; |
| 285 | /* Indicate that this buffer now has a specified category table. */ | 285 | /* Indicate that this buffer now has a specified category table. */ |
| 286 | idx = PER_BUFFER_VAR_IDX (category_table); | 286 | idx = PER_BUFFER_VAR_IDX (category_table); |
| 287 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); | 287 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); |
| @@ -292,7 +292,7 @@ Return TABLE. */) | |||
| 292 | Lisp_Object | 292 | Lisp_Object |
| 293 | char_category_set (int c) | 293 | char_category_set (int c) |
| 294 | { | 294 | { |
| 295 | return CHAR_TABLE_REF (current_buffer->category_table, c); | 295 | return CHAR_TABLE_REF (B_ (current_buffer, category_table), c); |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0, | 298 | 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; | |||
| 91 | 91 | ||
| 92 | /* The standard category table is stored where it will automatically | 92 | /* The standard category table is stored where it will automatically |
| 93 | be used in all new buffers. */ | 93 | be used in all new buffers. */ |
| 94 | #define Vstandard_category_table buffer_defaults.category_table | 94 | #define Vstandard_category_table B_ (&buffer_defaults, category_table) |
| 95 | 95 | ||
| 96 | /* Return the category set of character C in the current category table. */ | 96 | /* Return the category set of character C in the current category table. */ |
| 97 | #define CATEGORY_SET(c) char_category_set (c) | 97 | #define CATEGORY_SET(c) char_category_set (c) |
diff --git a/src/character.c b/src/character.c index 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) | |||
| 521 | { | 521 | { |
| 522 | /* current_buffer is null at early stages of Emacs initialization. */ | 522 | /* current_buffer is null at early stages of Emacs initialization. */ |
| 523 | if (current_buffer == 0 | 523 | if (current_buffer == 0 |
| 524 | || NILP (current_buffer->enable_multibyte_characters)) | 524 | || NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 525 | return nbytes; | 525 | return nbytes; |
| 526 | 526 | ||
| 527 | return multibyte_chars_in_text (ptr, nbytes); | 527 | return multibyte_chars_in_text (ptr, nbytes); |
| @@ -987,7 +987,7 @@ character is not ASCII nor 8-bit character, an error is signalled. */) | |||
| 987 | pos = XFASTINT (position); | 987 | pos = XFASTINT (position); |
| 988 | p = CHAR_POS_ADDR (pos); | 988 | p = CHAR_POS_ADDR (pos); |
| 989 | } | 989 | } |
| 990 | if (NILP (current_buffer->enable_multibyte_characters)) | 990 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 991 | return make_number (*p); | 991 | return make_number (*p); |
| 992 | } | 992 | } |
| 993 | else | 993 | else |
diff --git a/src/character.h b/src/character.h index 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/>. */ | |||
| 417 | do \ | 417 | do \ |
| 418 | { \ | 418 | { \ |
| 419 | CHARIDX++; \ | 419 | CHARIDX++; \ |
| 420 | if (!NILP (current_buffer->enable_multibyte_characters)) \ | 420 | if (!NILP (B_ (current_buffer, enable_multibyte_characters))) \ |
| 421 | { \ | 421 | { \ |
| 422 | unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \ | 422 | unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \ |
| 423 | int len; \ | 423 | int len; \ |
| @@ -484,7 +484,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 484 | do \ | 484 | do \ |
| 485 | { \ | 485 | { \ |
| 486 | (charpos)++; \ | 486 | (charpos)++; \ |
| 487 | if (NILP (current_buffer->enable_multibyte_characters)) \ | 487 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) \ |
| 488 | (bytepos)++; \ | 488 | (bytepos)++; \ |
| 489 | else \ | 489 | else \ |
| 490 | INC_POS ((bytepos)); \ | 490 | INC_POS ((bytepos)); \ |
| @@ -498,7 +498,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 498 | do \ | 498 | do \ |
| 499 | { \ | 499 | { \ |
| 500 | (charpos)--; \ | 500 | (charpos)--; \ |
| 501 | if (NILP (current_buffer->enable_multibyte_characters)) \ | 501 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) \ |
| 502 | (bytepos)--; \ | 502 | (bytepos)--; \ |
| 503 | else \ | 503 | else \ |
| 504 | DEC_POS ((bytepos)); \ | 504 | DEC_POS ((bytepos)); \ |
| @@ -561,11 +561,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 561 | #define ASCII_CHAR_WIDTH(c) \ | 561 | #define ASCII_CHAR_WIDTH(c) \ |
| 562 | (c < 0x20 \ | 562 | (c < 0x20 \ |
| 563 | ? (c == '\t' \ | 563 | ? (c == '\t' \ |
| 564 | ? XFASTINT (current_buffer->tab_width) \ | 564 | ? XFASTINT (B_ (current_buffer, tab_width)) \ |
| 565 | : (c == '\n' ? 0 : (NILP (current_buffer->ctl_arrow) ? 4 : 2))) \ | 565 | : (c == '\n' ? 0 : (NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2))) \ |
| 566 | : (c < 0x7f \ | 566 | : (c < 0x7f \ |
| 567 | ? 1 \ | 567 | ? 1 \ |
| 568 | : ((NILP (current_buffer->ctl_arrow) ? 4 : 2)))) | 568 | : ((NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2)))) |
| 569 | 569 | ||
| 570 | /* Return the width of character C. The width is measured by how many | 570 | /* Return the width of character C. The width is measured by how many |
| 571 | columns C will occupy on the screen when displayed in the current | 571 | columns C will occupy on the screen when displayed in the current |
diff --git a/src/charset.c b/src/charset.c index 229f2c2cdae..80e6a114197 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -1554,7 +1554,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) | |||
| 1554 | EMACS_INT from, from_byte, to, stop, stop_byte; | 1554 | EMACS_INT from, from_byte, to, stop, stop_byte; |
| 1555 | int i; | 1555 | int i; |
| 1556 | Lisp_Object val; | 1556 | Lisp_Object val; |
| 1557 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 1557 | int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 1558 | 1558 | ||
| 1559 | validate_region (&beg, &end); | 1559 | validate_region (&beg, &end); |
| 1560 | from = XFASTINT (beg); | 1560 | from = XFASTINT (beg); |
diff --git a/src/cmds.c b/src/cmds.c index 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 | |||
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | if (remove_boundary | 294 | if (remove_boundary |
| 295 | && CONSP (current_buffer->undo_list) | 295 | && CONSP (B_ (current_buffer, undo_list)) |
| 296 | && NILP (XCAR (current_buffer->undo_list))) | 296 | && NILP (XCAR (B_ (current_buffer, undo_list)))) |
| 297 | /* Remove the undo_boundary that was just pushed. */ | 297 | /* Remove the undo_boundary that was just pushed. */ |
| 298 | current_buffer->undo_list = XCDR (current_buffer->undo_list); | 298 | B_ (current_buffer, undo_list) = XCDR (B_ (current_buffer, undo_list)); |
| 299 | 299 | ||
| 300 | /* Barf if the key that invoked this was not a character. */ | 300 | /* Barf if the key that invoked this was not a character. */ |
| 301 | if (!CHARACTERP (last_command_event)) | 301 | if (!CHARACTERP (last_command_event)) |
| @@ -335,12 +335,12 @@ internal_self_insert (int c, EMACS_INT n) | |||
| 335 | EMACS_INT chars_to_delete = 0; | 335 | EMACS_INT chars_to_delete = 0; |
| 336 | EMACS_INT spaces_to_insert = 0; | 336 | EMACS_INT spaces_to_insert = 0; |
| 337 | 337 | ||
| 338 | overwrite = current_buffer->overwrite_mode; | 338 | overwrite = B_ (current_buffer, overwrite_mode); |
| 339 | if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) | 339 | if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) |
| 340 | hairy = 1; | 340 | hairy = 1; |
| 341 | 341 | ||
| 342 | /* At first, get multi-byte form of C in STR. */ | 342 | /* At first, get multi-byte form of C in STR. */ |
| 343 | if (!NILP (current_buffer->enable_multibyte_characters)) | 343 | if (!NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 344 | { | 344 | { |
| 345 | len = CHAR_STRING (c, str); | 345 | len = CHAR_STRING (c, str); |
| 346 | if (len == 1) | 346 | if (len == 1) |
| @@ -416,11 +416,11 @@ internal_self_insert (int c, EMACS_INT n) | |||
| 416 | 416 | ||
| 417 | synt = SYNTAX (c); | 417 | synt = SYNTAX (c); |
| 418 | 418 | ||
| 419 | if (!NILP (current_buffer->abbrev_mode) | 419 | if (!NILP (B_ (current_buffer, abbrev_mode)) |
| 420 | && synt != Sword | 420 | && synt != Sword |
| 421 | && NILP (current_buffer->read_only) | 421 | && NILP (B_ (current_buffer, read_only)) |
| 422 | && PT > BEGV | 422 | && PT > BEGV |
| 423 | && (SYNTAX (!NILP (current_buffer->enable_multibyte_characters) | 423 | && (SYNTAX (!NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 424 | ? XFASTINT (Fprevious_char ()) | 424 | ? XFASTINT (Fprevious_char ()) |
| 425 | : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) | 425 | : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) |
| 426 | == Sword)) | 426 | == Sword)) |
| @@ -448,7 +448,7 @@ internal_self_insert (int c, EMACS_INT n) | |||
| 448 | 448 | ||
| 449 | if (chars_to_delete) | 449 | if (chars_to_delete) |
| 450 | { | 450 | { |
| 451 | int mc = ((NILP (current_buffer->enable_multibyte_characters) | 451 | int mc = ((NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 452 | && SINGLE_BYTE_CHAR_P (c)) | 452 | && SINGLE_BYTE_CHAR_P (c)) |
| 453 | ? UNIBYTE_TO_CHAR (c) : c); | 453 | ? UNIBYTE_TO_CHAR (c) : c); |
| 454 | Lisp_Object string = Fmake_string (make_number (n), make_number (mc)); | 454 | Lisp_Object string = Fmake_string (make_number (n), make_number (mc)); |
| @@ -479,7 +479,7 @@ internal_self_insert (int c, EMACS_INT n) | |||
| 479 | if ((CHAR_TABLE_P (Vauto_fill_chars) | 479 | if ((CHAR_TABLE_P (Vauto_fill_chars) |
| 480 | ? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c)) | 480 | ? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c)) |
| 481 | : (c == ' ' || c == '\n')) | 481 | : (c == ' ' || c == '\n')) |
| 482 | && !NILP (current_buffer->auto_fill_function)) | 482 | && !NILP (B_ (current_buffer, auto_fill_function))) |
| 483 | { | 483 | { |
| 484 | Lisp_Object tem; | 484 | Lisp_Object tem; |
| 485 | 485 | ||
| @@ -488,7 +488,7 @@ internal_self_insert (int c, EMACS_INT n) | |||
| 488 | that. Must have the newline in place already so filling and | 488 | that. Must have the newline in place already so filling and |
| 489 | justification, if any, know where the end is going to be. */ | 489 | justification, if any, know where the end is going to be. */ |
| 490 | SET_PT_BOTH (PT - 1, PT_BYTE - 1); | 490 | SET_PT_BOTH (PT - 1, PT_BYTE - 1); |
| 491 | tem = call0 (current_buffer->auto_fill_function); | 491 | tem = call0 (B_ (current_buffer, auto_fill_function)); |
| 492 | /* Test PT < ZV in case the auto-fill-function is strange. */ | 492 | /* Test PT < ZV in case the auto-fill-function is strange. */ |
| 493 | if (c == '\n' && PT < ZV) | 493 | if (c == '\n' && PT < ZV) |
| 494 | SET_PT_BOTH (PT + 1, PT_BYTE + 1); | 494 | SET_PT_BOTH (PT + 1, PT_BYTE + 1); |
diff --git a/src/coding.c b/src/coding.c index a9f16de56f3..899cca6d5aa 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -7038,8 +7038,8 @@ decode_coding (struct coding_system *coding) | |||
| 7038 | set_buffer_internal (XBUFFER (coding->dst_object)); | 7038 | set_buffer_internal (XBUFFER (coding->dst_object)); |
| 7039 | if (GPT != PT) | 7039 | if (GPT != PT) |
| 7040 | move_gap_both (PT, PT_BYTE); | 7040 | move_gap_both (PT, PT_BYTE); |
| 7041 | undo_list = current_buffer->undo_list; | 7041 | undo_list = B_ (current_buffer, undo_list); |
| 7042 | current_buffer->undo_list = Qt; | 7042 | B_ (current_buffer, undo_list) = Qt; |
| 7043 | } | 7043 | } |
| 7044 | 7044 | ||
| 7045 | coding->consumed = coding->consumed_char = 0; | 7045 | coding->consumed = coding->consumed_char = 0; |
| @@ -7136,7 +7136,7 @@ decode_coding (struct coding_system *coding) | |||
| 7136 | decode_eol (coding); | 7136 | decode_eol (coding); |
| 7137 | if (BUFFERP (coding->dst_object)) | 7137 | if (BUFFERP (coding->dst_object)) |
| 7138 | { | 7138 | { |
| 7139 | current_buffer->undo_list = undo_list; | 7139 | B_ (current_buffer, undo_list) = undo_list; |
| 7140 | record_insert (coding->dst_pos, coding->produced_char); | 7140 | record_insert (coding->dst_pos, coding->produced_char); |
| 7141 | } | 7141 | } |
| 7142 | return coding->result; | 7142 | return coding->result; |
| @@ -7433,7 +7433,7 @@ encode_coding (struct coding_system *coding) | |||
| 7433 | { | 7433 | { |
| 7434 | set_buffer_internal (XBUFFER (coding->dst_object)); | 7434 | set_buffer_internal (XBUFFER (coding->dst_object)); |
| 7435 | coding->dst_multibyte | 7435 | coding->dst_multibyte |
| 7436 | = ! NILP (current_buffer->enable_multibyte_characters); | 7436 | = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 7437 | } | 7437 | } |
| 7438 | 7438 | ||
| 7439 | coding->consumed = coding->consumed_char = 0; | 7439 | coding->consumed = coding->consumed_char = 0; |
| @@ -7504,8 +7504,8 @@ make_conversion_work_buffer (int multibyte) | |||
| 7504 | doesn't compile new regexps. */ | 7504 | doesn't compile new regexps. */ |
| 7505 | Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt); | 7505 | Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt); |
| 7506 | Ferase_buffer (); | 7506 | Ferase_buffer (); |
| 7507 | current_buffer->undo_list = Qt; | 7507 | B_ (current_buffer, undo_list) = Qt; |
| 7508 | current_buffer->enable_multibyte_characters = multibyte ? Qt : Qnil; | 7508 | B_ (current_buffer, enable_multibyte_characters) = multibyte ? Qt : Qnil; |
| 7509 | set_buffer_internal (current); | 7509 | set_buffer_internal (current); |
| 7510 | return workbuf; | 7510 | return workbuf; |
| 7511 | } | 7511 | } |
| @@ -7562,7 +7562,7 @@ decode_coding_gap (struct coding_system *coding, | |||
| 7562 | coding->dst_object = coding->src_object; | 7562 | coding->dst_object = coding->src_object; |
| 7563 | coding->dst_pos = PT; | 7563 | coding->dst_pos = PT; |
| 7564 | coding->dst_pos_byte = PT_BYTE; | 7564 | coding->dst_pos_byte = PT_BYTE; |
| 7565 | coding->dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 7565 | coding->dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 7566 | 7566 | ||
| 7567 | if (CODING_REQUIRE_DETECTION (coding)) | 7567 | if (CODING_REQUIRE_DETECTION (coding)) |
| 7568 | detect_coding (coding); | 7568 | detect_coding (coding); |
| @@ -7728,7 +7728,7 @@ decode_coding_object (struct coding_system *coding, | |||
| 7728 | coding->dst_pos = BUF_PT (XBUFFER (dst_object)); | 7728 | coding->dst_pos = BUF_PT (XBUFFER (dst_object)); |
| 7729 | coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object)); | 7729 | coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object)); |
| 7730 | coding->dst_multibyte | 7730 | coding->dst_multibyte |
| 7731 | = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters); | 7731 | = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters)); |
| 7732 | } | 7732 | } |
| 7733 | else | 7733 | else |
| 7734 | { | 7734 | { |
| @@ -7798,7 +7798,7 @@ decode_coding_object (struct coding_system *coding, | |||
| 7798 | TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte); | 7798 | TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte); |
| 7799 | else if (saved_pt < from + chars) | 7799 | else if (saved_pt < from + chars) |
| 7800 | TEMP_SET_PT_BOTH (from, from_byte); | 7800 | TEMP_SET_PT_BOTH (from, from_byte); |
| 7801 | else if (! NILP (current_buffer->enable_multibyte_characters)) | 7801 | else if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 7802 | TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars), | 7802 | TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars), |
| 7803 | saved_pt_byte + (coding->produced - bytes)); | 7803 | saved_pt_byte + (coding->produced - bytes)); |
| 7804 | else | 7804 | else |
| @@ -7822,7 +7822,7 @@ decode_coding_object (struct coding_system *coding, | |||
| 7822 | { | 7822 | { |
| 7823 | tail->bytepos = from_byte + coding->produced; | 7823 | tail->bytepos = from_byte + coding->produced; |
| 7824 | tail->charpos | 7824 | tail->charpos |
| 7825 | = (NILP (current_buffer->enable_multibyte_characters) | 7825 | = (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 7826 | ? tail->bytepos : from + coding->produced_char); | 7826 | ? tail->bytepos : from + coding->produced_char); |
| 7827 | } | 7827 | } |
| 7828 | } | 7828 | } |
| @@ -7960,7 +7960,7 @@ encode_coding_object (struct coding_system *coding, | |||
| 7960 | set_buffer_temp (current); | 7960 | set_buffer_temp (current); |
| 7961 | } | 7961 | } |
| 7962 | coding->dst_multibyte | 7962 | coding->dst_multibyte |
| 7963 | = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters); | 7963 | = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters)); |
| 7964 | } | 7964 | } |
| 7965 | else if (EQ (dst_object, Qt)) | 7965 | else if (EQ (dst_object, Qt)) |
| 7966 | { | 7966 | { |
| @@ -8003,7 +8003,7 @@ encode_coding_object (struct coding_system *coding, | |||
| 8003 | TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte); | 8003 | TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte); |
| 8004 | else if (saved_pt < from + chars) | 8004 | else if (saved_pt < from + chars) |
| 8005 | TEMP_SET_PT_BOTH (from, from_byte); | 8005 | TEMP_SET_PT_BOTH (from, from_byte); |
| 8006 | else if (! NILP (current_buffer->enable_multibyte_characters)) | 8006 | else if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 8007 | TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars), | 8007 | TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars), |
| 8008 | saved_pt_byte + (coding->produced - bytes)); | 8008 | saved_pt_byte + (coding->produced - bytes)); |
| 8009 | else | 8009 | else |
| @@ -8027,7 +8027,7 @@ encode_coding_object (struct coding_system *coding, | |||
| 8027 | { | 8027 | { |
| 8028 | tail->bytepos = from_byte + coding->produced; | 8028 | tail->bytepos = from_byte + coding->produced; |
| 8029 | tail->charpos | 8029 | tail->charpos |
| 8030 | = (NILP (current_buffer->enable_multibyte_characters) | 8030 | = (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 8031 | ? tail->bytepos : from + coding->produced_char); | 8031 | ? tail->bytepos : from + coding->produced_char); |
| 8032 | } | 8032 | } |
| 8033 | } | 8033 | } |
| @@ -8481,8 +8481,8 @@ highest priority. */) | |||
| 8481 | return detect_coding_system (BYTE_POS_ADDR (from_byte), | 8481 | return detect_coding_system (BYTE_POS_ADDR (from_byte), |
| 8482 | to - from, to_byte - from_byte, | 8482 | to - from, to_byte - from_byte, |
| 8483 | !NILP (highest), | 8483 | !NILP (highest), |
| 8484 | !NILP (current_buffer | 8484 | !NILP (B_ (current_buffer |
| 8485 | ->enable_multibyte_characters), | 8485 | , enable_multibyte_characters)), |
| 8486 | Qnil); | 8486 | Qnil); |
| 8487 | } | 8487 | } |
| 8488 | 8488 | ||
| @@ -8564,7 +8564,7 @@ DEFUN ("find-coding-systems-region-internal", | |||
| 8564 | CHECK_NUMBER_COERCE_MARKER (end); | 8564 | CHECK_NUMBER_COERCE_MARKER (end); |
| 8565 | if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) | 8565 | if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) |
| 8566 | args_out_of_range (start, end); | 8566 | args_out_of_range (start, end); |
| 8567 | if (NILP (current_buffer->enable_multibyte_characters)) | 8567 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 8568 | return Qt; | 8568 | return Qt; |
| 8569 | start_byte = CHAR_TO_BYTE (XINT (start)); | 8569 | start_byte = CHAR_TO_BYTE (XINT (start)); |
| 8570 | end_byte = CHAR_TO_BYTE (XINT (end)); | 8570 | end_byte = CHAR_TO_BYTE (XINT (end)); |
| @@ -8698,7 +8698,7 @@ to the string. */) | |||
| 8698 | validate_region (&start, &end); | 8698 | validate_region (&start, &end); |
| 8699 | from = XINT (start); | 8699 | from = XINT (start); |
| 8700 | to = XINT (end); | 8700 | to = XINT (end); |
| 8701 | if (NILP (current_buffer->enable_multibyte_characters) | 8701 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 8702 | || (ascii_compatible | 8702 | || (ascii_compatible |
| 8703 | && (to - from) == (CHAR_TO_BYTE (to) - (CHAR_TO_BYTE (from))))) | 8703 | && (to - from) == (CHAR_TO_BYTE (to) - (CHAR_TO_BYTE (from))))) |
| 8704 | return Qnil; | 8704 | return Qnil; |
| @@ -8814,7 +8814,7 @@ is nil. */) | |||
| 8814 | CHECK_NUMBER_COERCE_MARKER (end); | 8814 | CHECK_NUMBER_COERCE_MARKER (end); |
| 8815 | if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) | 8815 | if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) |
| 8816 | args_out_of_range (start, end); | 8816 | args_out_of_range (start, end); |
| 8817 | if (NILP (current_buffer->enable_multibyte_characters)) | 8817 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 8818 | return Qnil; | 8818 | return Qnil; |
| 8819 | start_byte = CHAR_TO_BYTE (XINT (start)); | 8819 | start_byte = CHAR_TO_BYTE (XINT (start)); |
| 8820 | end_byte = CHAR_TO_BYTE (XINT (end)); | 8820 | end_byte = CHAR_TO_BYTE (XINT (end)); |
diff --git a/src/composite.c b/src/composite.c index 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 | |||
| 796 | 796 | ||
| 797 | if (NILP (string)) | 797 | if (NILP (string)) |
| 798 | { | 798 | { |
| 799 | if (NILP (current_buffer->enable_multibyte_characters)) | 799 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 800 | error ("Attempt to shape unibyte text"); | 800 | error ("Attempt to shape unibyte text"); |
| 801 | validate_region (&start, &end); | 801 | validate_region (&start, &end); |
| 802 | from = XFASTINT (start); | 802 | from = XFASTINT (start); |
| @@ -1028,7 +1028,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos, | |||
| 1028 | cmp_it->stop_pos = endpos = start; | 1028 | cmp_it->stop_pos = endpos = start; |
| 1029 | cmp_it->ch = -1; | 1029 | cmp_it->ch = -1; |
| 1030 | } | 1030 | } |
| 1031 | if (NILP (current_buffer->enable_multibyte_characters) | 1031 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 1032 | || NILP (Vauto_composition_mode)) | 1032 | || NILP (Vauto_composition_mode)) |
| 1033 | return; | 1033 | return; |
| 1034 | if (bytepos < 0) | 1034 | if (bytepos < 0) |
| @@ -1674,7 +1674,7 @@ composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt) | |||
| 1674 | return new_pt; | 1674 | return new_pt; |
| 1675 | } | 1675 | } |
| 1676 | 1676 | ||
| 1677 | if (NILP (current_buffer->enable_multibyte_characters) | 1677 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 1678 | || NILP (Vauto_composition_mode)) | 1678 | || NILP (Vauto_composition_mode)) |
| 1679 | return new_pt; | 1679 | return new_pt; |
| 1680 | 1680 | ||
| @@ -1851,7 +1851,7 @@ See `find-composition' for more details. */) | |||
| 1851 | 1851 | ||
| 1852 | if (!find_composition (from, to, &start, &end, &prop, string)) | 1852 | if (!find_composition (from, to, &start, &end, &prop, string)) |
| 1853 | { | 1853 | { |
| 1854 | if (!NILP (current_buffer->enable_multibyte_characters) | 1854 | if (!NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 1855 | && ! NILP (Vauto_composition_mode) | 1855 | && ! NILP (Vauto_composition_mode) |
| 1856 | && find_automatic_composition (from, to, &start, &end, &gstring, | 1856 | && find_automatic_composition (from, to, &start, &end, &gstring, |
| 1857 | string)) | 1857 | string)) |
diff --git a/src/data.c b/src/data.c index 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_ | |||
| 1009 | } | 1009 | } |
| 1010 | else | 1010 | else |
| 1011 | { | 1011 | { |
| 1012 | tem1 = assq_no_quit (var, current_buffer->local_var_alist); | 1012 | tem1 = assq_no_quit (var, B_ (current_buffer, local_var_alist)); |
| 1013 | XSETBUFFER (blv->where, current_buffer); | 1013 | XSETBUFFER (blv->where, current_buffer); |
| 1014 | } | 1014 | } |
| 1015 | } | 1015 | } |
| @@ -1178,7 +1178,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register | |||
| 1178 | tem1 = Fassq (symbol, | 1178 | tem1 = Fassq (symbol, |
| 1179 | (blv->frame_local | 1179 | (blv->frame_local |
| 1180 | ? XFRAME (where)->param_alist | 1180 | ? XFRAME (where)->param_alist |
| 1181 | : XBUFFER (where)->local_var_alist)); | 1181 | : B_ (XBUFFER (where), local_var_alist))); |
| 1182 | blv->where = where; | 1182 | blv->where = where; |
| 1183 | blv->found = 1; | 1183 | blv->found = 1; |
| 1184 | 1184 | ||
| @@ -1209,8 +1209,8 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register | |||
| 1209 | bindings, not for frame-local bindings. */ | 1209 | bindings, not for frame-local bindings. */ |
| 1210 | eassert (!blv->frame_local); | 1210 | eassert (!blv->frame_local); |
| 1211 | tem1 = Fcons (symbol, XCDR (blv->defcell)); | 1211 | tem1 = Fcons (symbol, XCDR (blv->defcell)); |
| 1212 | XBUFFER (where)->local_var_alist | 1212 | B_ (XBUFFER (where), local_var_alist) |
| 1213 | = Fcons (tem1, XBUFFER (where)->local_var_alist); | 1213 | = Fcons (tem1, B_ (XBUFFER (where), local_var_alist)); |
| 1214 | } | 1214 | } |
| 1215 | } | 1215 | } |
| 1216 | 1216 | ||
| @@ -1632,13 +1632,13 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1632 | if (let_shadows_global_binding_p (symbol)) | 1632 | if (let_shadows_global_binding_p (symbol)) |
| 1633 | message ("Making %s local to %s while let-bound!", | 1633 | message ("Making %s local to %s while let-bound!", |
| 1634 | SDATA (SYMBOL_NAME (variable)), | 1634 | SDATA (SYMBOL_NAME (variable)), |
| 1635 | SDATA (current_buffer->name)); | 1635 | SDATA (B_ (current_buffer, name))); |
| 1636 | } | 1636 | } |
| 1637 | } | 1637 | } |
| 1638 | 1638 | ||
| 1639 | /* Make sure this buffer has its own value of symbol. */ | 1639 | /* Make sure this buffer has its own value of symbol. */ |
| 1640 | XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ | 1640 | XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ |
| 1641 | tem = Fassq (variable, current_buffer->local_var_alist); | 1641 | tem = Fassq (variable, B_ (current_buffer, local_var_alist)); |
| 1642 | if (NILP (tem)) | 1642 | if (NILP (tem)) |
| 1643 | { | 1643 | { |
| 1644 | if (let_shadows_buffer_binding_p (sym)) | 1644 | if (let_shadows_buffer_binding_p (sym)) |
| @@ -1650,9 +1650,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1650 | default value. */ | 1650 | default value. */ |
| 1651 | find_symbol_value (variable); | 1651 | find_symbol_value (variable); |
| 1652 | 1652 | ||
| 1653 | current_buffer->local_var_alist | 1653 | B_ (current_buffer, local_var_alist) |
| 1654 | = Fcons (Fcons (variable, XCDR (blv->defcell)), | 1654 | = Fcons (Fcons (variable, XCDR (blv->defcell)), |
| 1655 | current_buffer->local_var_alist); | 1655 | B_ (current_buffer, local_var_alist)); |
| 1656 | 1656 | ||
| 1657 | /* Make sure symbol does not think it is set up for this buffer; | 1657 | /* Make sure symbol does not think it is set up for this buffer; |
| 1658 | force it to look once again for this buffer's value. */ | 1658 | force it to look once again for this buffer's value. */ |
| @@ -1718,10 +1718,10 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) | |||
| 1718 | 1718 | ||
| 1719 | /* Get rid of this buffer's alist element, if any. */ | 1719 | /* Get rid of this buffer's alist element, if any. */ |
| 1720 | XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ | 1720 | XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ |
| 1721 | tem = Fassq (variable, current_buffer->local_var_alist); | 1721 | tem = Fassq (variable, B_ (current_buffer, local_var_alist)); |
| 1722 | if (!NILP (tem)) | 1722 | if (!NILP (tem)) |
| 1723 | current_buffer->local_var_alist | 1723 | B_ (current_buffer, local_var_alist) |
| 1724 | = Fdelq (tem, current_buffer->local_var_alist); | 1724 | = Fdelq (tem, B_ (current_buffer, local_var_alist)); |
| 1725 | 1725 | ||
| 1726 | /* If the symbol is set up with the current buffer's binding | 1726 | /* If the symbol is set up with the current buffer's binding |
| 1727 | loaded, recompute its value. We have to do it now, or else | 1727 | loaded, recompute its value. We have to do it now, or else |
| @@ -1848,7 +1848,7 @@ BUFFER defaults to the current buffer. */) | |||
| 1848 | XSETBUFFER (tmp, buf); | 1848 | XSETBUFFER (tmp, buf); |
| 1849 | XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ | 1849 | XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ |
| 1850 | 1850 | ||
| 1851 | for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | 1851 | for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) |
| 1852 | { | 1852 | { |
| 1853 | elt = XCAR (tail); | 1853 | elt = XCAR (tail); |
| 1854 | if (EQ (variable, XCAR (elt))) | 1854 | if (EQ (variable, XCAR (elt))) |
diff --git a/src/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 | |||
| 1416 | && !(W)->pseudo_window_p \ | 1416 | && !(W)->pseudo_window_p \ |
| 1417 | && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ | 1417 | && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ |
| 1418 | && BUFFERP ((W)->buffer) \ | 1418 | && BUFFERP ((W)->buffer) \ |
| 1419 | && !NILP (XBUFFER ((W)->buffer)->mode_line_format) \ | 1419 | && !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format)) \ |
| 1420 | && WINDOW_TOTAL_LINES (W) > 1) | 1420 | && WINDOW_TOTAL_LINES (W) > 1) |
| 1421 | 1421 | ||
| 1422 | /* Value is non-zero if window W wants a header line. */ | 1422 | /* Value is non-zero if window W wants a header line. */ |
| @@ -1426,8 +1426,8 @@ struct glyph_string | |||
| 1426 | && !(W)->pseudo_window_p \ | 1426 | && !(W)->pseudo_window_p \ |
| 1427 | && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ | 1427 | && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ |
| 1428 | && BUFFERP ((W)->buffer) \ | 1428 | && BUFFERP ((W)->buffer) \ |
| 1429 | && !NILP (XBUFFER ((W)->buffer)->header_line_format) \ | 1429 | && !NILP (B_ (XBUFFER ((W)->buffer), header_line_format)) \ |
| 1430 | && WINDOW_TOTAL_LINES (W) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format)) | 1430 | && WINDOW_TOTAL_LINES (W) > 1 + !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format))) |
| 1431 | 1431 | ||
| 1432 | 1432 | ||
| 1433 | /* Return proper value to be used as baseline offset of font that has | 1433 | /* Return proper value to be used as baseline offset of font that has |
diff --git a/src/dispnew.c b/src/dispnew.c index 1aef70f1a5d..2aa3d9208b3 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6129,7 +6129,7 @@ pass nil for VARIABLE. */) | |||
| 6129 | { | 6129 | { |
| 6130 | buf = XCDR (XCAR (tail)); | 6130 | buf = XCDR (XCAR (tail)); |
| 6131 | /* Ignore buffers that aren't included in buffer lists. */ | 6131 | /* Ignore buffers that aren't included in buffer lists. */ |
| 6132 | if (SREF (XBUFFER (buf)->name, 0) == ' ') | 6132 | if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') |
| 6133 | continue; | 6133 | continue; |
| 6134 | if (vecp == end) | 6134 | if (vecp == end) |
| 6135 | goto changed; | 6135 | goto changed; |
| @@ -6137,7 +6137,7 @@ pass nil for VARIABLE. */) | |||
| 6137 | goto changed; | 6137 | goto changed; |
| 6138 | if (vecp == end) | 6138 | if (vecp == end) |
| 6139 | goto changed; | 6139 | goto changed; |
| 6140 | if (!EQ (*vecp++, XBUFFER (buf)->read_only)) | 6140 | if (!EQ (*vecp++, B_ (XBUFFER (buf), read_only))) |
| 6141 | goto changed; | 6141 | goto changed; |
| 6142 | if (vecp == end) | 6142 | if (vecp == end) |
| 6143 | goto changed; | 6143 | goto changed; |
| @@ -6184,10 +6184,10 @@ pass nil for VARIABLE. */) | |||
| 6184 | { | 6184 | { |
| 6185 | buf = XCDR (XCAR (tail)); | 6185 | buf = XCDR (XCAR (tail)); |
| 6186 | /* Ignore buffers that aren't included in buffer lists. */ | 6186 | /* Ignore buffers that aren't included in buffer lists. */ |
| 6187 | if (SREF (XBUFFER (buf)->name, 0) == ' ') | 6187 | if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') |
| 6188 | continue; | 6188 | continue; |
| 6189 | *vecp++ = buf; | 6189 | *vecp++ = buf; |
| 6190 | *vecp++ = XBUFFER (buf)->read_only; | 6190 | *vecp++ = B_ (XBUFFER (buf), read_only); |
| 6191 | *vecp++ = Fbuffer_modified_p (buf); | 6191 | *vecp++ = Fbuffer_modified_p (buf); |
| 6192 | } | 6192 | } |
| 6193 | /* Fill up the vector with lambdas (always at least one). */ | 6193 | /* Fill up the vector with lambdas (always at least one). */ |
diff --git a/src/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) | |||
| 306 | 306 | ||
| 307 | if (!NILP (Vtransient_mark_mode) | 307 | if (!NILP (Vtransient_mark_mode) |
| 308 | && NILP (Vmark_even_if_inactive) | 308 | && NILP (Vmark_even_if_inactive) |
| 309 | && NILP (current_buffer->mark_active)) | 309 | && NILP (B_ (current_buffer, mark_active))) |
| 310 | xsignal0 (Qmark_inactive); | 310 | xsignal0 (Qmark_inactive); |
| 311 | 311 | ||
| 312 | m = Fmarker_position (current_buffer->mark); | 312 | m = Fmarker_position (B_ (current_buffer, mark)); |
| 313 | if (NILP (m)) | 313 | if (NILP (m)) |
| 314 | error ("The mark is not set now, so there is no region"); | 314 | error ("The mark is not set now, so there is no region"); |
| 315 | 315 | ||
| @@ -338,7 +338,7 @@ Watch out! Moving this marker changes the mark position. | |||
| 338 | If you set the marker not to point anywhere, the buffer will have no mark. */) | 338 | If you set the marker not to point anywhere, the buffer will have no mark. */) |
| 339 | (void) | 339 | (void) |
| 340 | { | 340 | { |
| 341 | return current_buffer->mark; | 341 | return B_ (current_buffer, mark); |
| 342 | } | 342 | } |
| 343 | 343 | ||
| 344 | 344 | ||
| @@ -866,9 +866,9 @@ save_excursion_save (void) | |||
| 866 | == current_buffer); | 866 | == current_buffer); |
| 867 | 867 | ||
| 868 | return Fcons (Fpoint_marker (), | 868 | return Fcons (Fpoint_marker (), |
| 869 | Fcons (Fcopy_marker (current_buffer->mark, Qnil), | 869 | Fcons (Fcopy_marker (B_ (current_buffer, mark), Qnil), |
| 870 | Fcons (visible ? Qt : Qnil, | 870 | Fcons (visible ? Qt : Qnil, |
| 871 | Fcons (current_buffer->mark_active, | 871 | Fcons (B_ (current_buffer, mark_active), |
| 872 | selected_window)))); | 872 | selected_window)))); |
| 873 | } | 873 | } |
| 874 | 874 | ||
| @@ -900,8 +900,8 @@ save_excursion_restore (Lisp_Object info) | |||
| 900 | /* Mark marker. */ | 900 | /* Mark marker. */ |
| 901 | info = XCDR (info); | 901 | info = XCDR (info); |
| 902 | tem = XCAR (info); | 902 | tem = XCAR (info); |
| 903 | omark = Fmarker_position (current_buffer->mark); | 903 | omark = Fmarker_position (B_ (current_buffer, mark)); |
| 904 | Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ()); | 904 | Fset_marker (B_ (current_buffer, mark), tem, Fcurrent_buffer ()); |
| 905 | nmark = Fmarker_position (tem); | 905 | nmark = Fmarker_position (tem); |
| 906 | unchain_marker (XMARKER (tem)); | 906 | unchain_marker (XMARKER (tem)); |
| 907 | 907 | ||
| @@ -922,14 +922,14 @@ save_excursion_restore (Lisp_Object info) | |||
| 922 | /* Mark active */ | 922 | /* Mark active */ |
| 923 | info = XCDR (info); | 923 | info = XCDR (info); |
| 924 | tem = XCAR (info); | 924 | tem = XCAR (info); |
| 925 | tem1 = current_buffer->mark_active; | 925 | tem1 = B_ (current_buffer, mark_active); |
| 926 | current_buffer->mark_active = tem; | 926 | B_ (current_buffer, mark_active) = tem; |
| 927 | 927 | ||
| 928 | if (!NILP (Vrun_hooks)) | 928 | if (!NILP (Vrun_hooks)) |
| 929 | { | 929 | { |
| 930 | /* If mark is active now, and either was not active | 930 | /* If mark is active now, and either was not active |
| 931 | or was at a different place, run the activate hook. */ | 931 | or was at a different place, run the activate hook. */ |
| 932 | if (! NILP (current_buffer->mark_active)) | 932 | if (! NILP (B_ (current_buffer, mark_active))) |
| 933 | { | 933 | { |
| 934 | if (! EQ (omark, nmark)) | 934 | if (! EQ (omark, nmark)) |
| 935 | call1 (Vrun_hooks, intern ("activate-mark-hook")); | 935 | call1 (Vrun_hooks, intern ("activate-mark-hook")); |
| @@ -1114,7 +1114,7 @@ At the beginning of the buffer or accessible region, return 0. */) | |||
| 1114 | Lisp_Object temp; | 1114 | Lisp_Object temp; |
| 1115 | if (PT <= BEGV) | 1115 | if (PT <= BEGV) |
| 1116 | XSETFASTINT (temp, 0); | 1116 | XSETFASTINT (temp, 0); |
| 1117 | else if (!NILP (current_buffer->enable_multibyte_characters)) | 1117 | else if (!NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 1118 | { | 1118 | { |
| 1119 | EMACS_INT pos = PT_BYTE; | 1119 | EMACS_INT pos = PT_BYTE; |
| 1120 | DEC_POS (pos); | 1120 | DEC_POS (pos); |
| @@ -1228,7 +1228,7 @@ If POS is out of range, the value is nil. */) | |||
| 1228 | pos_byte = CHAR_TO_BYTE (XINT (pos)); | 1228 | pos_byte = CHAR_TO_BYTE (XINT (pos)); |
| 1229 | } | 1229 | } |
| 1230 | 1230 | ||
| 1231 | if (!NILP (current_buffer->enable_multibyte_characters)) | 1231 | if (!NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 1232 | { | 1232 | { |
| 1233 | DEC_POS (pos_byte); | 1233 | DEC_POS (pos_byte); |
| 1234 | XSETFASTINT (val, FETCH_CHAR (pos_byte)); | 1234 | XSETFASTINT (val, FETCH_CHAR (pos_byte)); |
| @@ -2135,7 +2135,7 @@ general_insert_function (void (*insert_func) | |||
| 2135 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 2135 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 2136 | int len; | 2136 | int len; |
| 2137 | 2137 | ||
| 2138 | if (!NILP (current_buffer->enable_multibyte_characters)) | 2138 | if (!NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 2139 | len = CHAR_STRING (XFASTINT (val), str); | 2139 | len = CHAR_STRING (XFASTINT (val), str); |
| 2140 | else | 2140 | else |
| 2141 | { | 2141 | { |
| @@ -2267,7 +2267,7 @@ from adjoining text, if those properties are sticky. */) | |||
| 2267 | CHECK_NUMBER (character); | 2267 | CHECK_NUMBER (character); |
| 2268 | CHECK_NUMBER (count); | 2268 | CHECK_NUMBER (count); |
| 2269 | 2269 | ||
| 2270 | if (!NILP (current_buffer->enable_multibyte_characters)) | 2270 | if (!NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 2271 | len = CHAR_STRING (XFASTINT (character), str); | 2271 | len = CHAR_STRING (XFASTINT (character), str); |
| 2272 | else | 2272 | else |
| 2273 | str[0] = XFASTINT (character), len = 1; | 2273 | str[0] = XFASTINT (character), len = 1; |
| @@ -2316,7 +2316,7 @@ from adjoining text, if those properties are sticky. */) | |||
| 2316 | if (XINT (byte) < 0 || XINT (byte) > 255) | 2316 | if (XINT (byte) < 0 || XINT (byte) > 255) |
| 2317 | args_out_of_range_3 (byte, make_number (0), make_number (255)); | 2317 | args_out_of_range_3 (byte, make_number (0), make_number (255)); |
| 2318 | if (XINT (byte) >= 128 | 2318 | if (XINT (byte) >= 128 |
| 2319 | && ! NILP (current_buffer->enable_multibyte_characters)) | 2319 | && ! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 2320 | XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte))); | 2320 | XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte))); |
| 2321 | return Finsert_char (byte, count, inherit); | 2321 | return Finsert_char (byte, count, inherit); |
| 2322 | } | 2322 | } |
| @@ -2370,7 +2370,7 @@ make_buffer_string_both (EMACS_INT start, EMACS_INT start_byte, | |||
| 2370 | if (start < GPT && GPT < end) | 2370 | if (start < GPT && GPT < end) |
| 2371 | move_gap (start); | 2371 | move_gap (start); |
| 2372 | 2372 | ||
| 2373 | if (! NILP (current_buffer->enable_multibyte_characters)) | 2373 | if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 2374 | result = make_uninit_multibyte_string (end - start, end_byte - start_byte); | 2374 | result = make_uninit_multibyte_string (end - start, end_byte - start_byte); |
| 2375 | else | 2375 | else |
| 2376 | result = make_uninit_string (end - start); | 2376 | result = make_uninit_string (end - start); |
| @@ -2485,7 +2485,7 @@ They default to the values of (point-min) and (point-max) in BUFFER. */) | |||
| 2485 | if (NILP (buf)) | 2485 | if (NILP (buf)) |
| 2486 | nsberror (buffer); | 2486 | nsberror (buffer); |
| 2487 | bp = XBUFFER (buf); | 2487 | bp = XBUFFER (buf); |
| 2488 | if (NILP (bp->name)) | 2488 | if (NILP (B_ (bp, name))) |
| 2489 | error ("Selecting deleted buffer"); | 2489 | error ("Selecting deleted buffer"); |
| 2490 | 2490 | ||
| 2491 | if (NILP (start)) | 2491 | if (NILP (start)) |
| @@ -2533,8 +2533,8 @@ determines whether case is significant or ignored. */) | |||
| 2533 | register EMACS_INT begp1, endp1, begp2, endp2, temp; | 2533 | register EMACS_INT begp1, endp1, begp2, endp2, temp; |
| 2534 | register struct buffer *bp1, *bp2; | 2534 | register struct buffer *bp1, *bp2; |
| 2535 | register Lisp_Object trt | 2535 | register Lisp_Object trt |
| 2536 | = (!NILP (current_buffer->case_fold_search) | 2536 | = (!NILP (B_ (current_buffer, case_fold_search)) |
| 2537 | ? current_buffer->case_canon_table : Qnil); | 2537 | ? B_ (current_buffer, case_canon_table) : Qnil); |
| 2538 | EMACS_INT chars = 0; | 2538 | EMACS_INT chars = 0; |
| 2539 | EMACS_INT i1, i2, i1_byte, i2_byte; | 2539 | EMACS_INT i1, i2, i1_byte, i2_byte; |
| 2540 | 2540 | ||
| @@ -2549,7 +2549,7 @@ determines whether case is significant or ignored. */) | |||
| 2549 | if (NILP (buf1)) | 2549 | if (NILP (buf1)) |
| 2550 | nsberror (buffer1); | 2550 | nsberror (buffer1); |
| 2551 | bp1 = XBUFFER (buf1); | 2551 | bp1 = XBUFFER (buf1); |
| 2552 | if (NILP (bp1->name)) | 2552 | if (NILP (B_ (bp1, name))) |
| 2553 | error ("Selecting deleted buffer"); | 2553 | error ("Selecting deleted buffer"); |
| 2554 | } | 2554 | } |
| 2555 | 2555 | ||
| @@ -2587,7 +2587,7 @@ determines whether case is significant or ignored. */) | |||
| 2587 | if (NILP (buf2)) | 2587 | if (NILP (buf2)) |
| 2588 | nsberror (buffer2); | 2588 | nsberror (buffer2); |
| 2589 | bp2 = XBUFFER (buf2); | 2589 | bp2 = XBUFFER (buf2); |
| 2590 | if (NILP (bp2->name)) | 2590 | if (NILP (B_ (bp2, name))) |
| 2591 | error ("Selecting deleted buffer"); | 2591 | error ("Selecting deleted buffer"); |
| 2592 | } | 2592 | } |
| 2593 | 2593 | ||
| @@ -2627,7 +2627,7 @@ determines whether case is significant or ignored. */) | |||
| 2627 | 2627 | ||
| 2628 | QUIT; | 2628 | QUIT; |
| 2629 | 2629 | ||
| 2630 | if (! NILP (bp1->enable_multibyte_characters)) | 2630 | if (! NILP (B_ (bp1, enable_multibyte_characters))) |
| 2631 | { | 2631 | { |
| 2632 | c1 = BUF_FETCH_MULTIBYTE_CHAR (bp1, i1_byte); | 2632 | c1 = BUF_FETCH_MULTIBYTE_CHAR (bp1, i1_byte); |
| 2633 | BUF_INC_POS (bp1, i1_byte); | 2633 | BUF_INC_POS (bp1, i1_byte); |
| @@ -2640,7 +2640,7 @@ determines whether case is significant or ignored. */) | |||
| 2640 | i1++; | 2640 | i1++; |
| 2641 | } | 2641 | } |
| 2642 | 2642 | ||
| 2643 | if (! NILP (bp2->enable_multibyte_characters)) | 2643 | if (! NILP (B_ (bp2, enable_multibyte_characters))) |
| 2644 | { | 2644 | { |
| 2645 | c2 = BUF_FETCH_MULTIBYTE_CHAR (bp2, i2_byte); | 2645 | c2 = BUF_FETCH_MULTIBYTE_CHAR (bp2, i2_byte); |
| 2646 | BUF_INC_POS (bp2, i2_byte); | 2646 | BUF_INC_POS (bp2, i2_byte); |
| @@ -2680,13 +2680,13 @@ determines whether case is significant or ignored. */) | |||
| 2680 | static Lisp_Object | 2680 | static Lisp_Object |
| 2681 | subst_char_in_region_unwind (Lisp_Object arg) | 2681 | subst_char_in_region_unwind (Lisp_Object arg) |
| 2682 | { | 2682 | { |
| 2683 | return current_buffer->undo_list = arg; | 2683 | return B_ (current_buffer, undo_list) = arg; |
| 2684 | } | 2684 | } |
| 2685 | 2685 | ||
| 2686 | static Lisp_Object | 2686 | static Lisp_Object |
| 2687 | subst_char_in_region_unwind_1 (Lisp_Object arg) | 2687 | subst_char_in_region_unwind_1 (Lisp_Object arg) |
| 2688 | { | 2688 | { |
| 2689 | return current_buffer->filename = arg; | 2689 | return B_ (current_buffer, filename) = arg; |
| 2690 | } | 2690 | } |
| 2691 | 2691 | ||
| 2692 | DEFUN ("subst-char-in-region", Fsubst_char_in_region, | 2692 | DEFUN ("subst-char-in-region", Fsubst_char_in_region, |
| @@ -2712,7 +2712,7 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2712 | #define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER) | 2712 | #define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER) |
| 2713 | int maybe_byte_combining = COMBINING_NO; | 2713 | int maybe_byte_combining = COMBINING_NO; |
| 2714 | EMACS_INT last_changed = 0; | 2714 | EMACS_INT last_changed = 0; |
| 2715 | int multibyte_p = !NILP (current_buffer->enable_multibyte_characters); | 2715 | int multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 2716 | 2716 | ||
| 2717 | restart: | 2717 | restart: |
| 2718 | 2718 | ||
| @@ -2756,12 +2756,12 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2756 | if (!changed && !NILP (noundo)) | 2756 | if (!changed && !NILP (noundo)) |
| 2757 | { | 2757 | { |
| 2758 | record_unwind_protect (subst_char_in_region_unwind, | 2758 | record_unwind_protect (subst_char_in_region_unwind, |
| 2759 | current_buffer->undo_list); | 2759 | B_ (current_buffer, undo_list)); |
| 2760 | current_buffer->undo_list = Qt; | 2760 | B_ (current_buffer, undo_list) = Qt; |
| 2761 | /* Don't do file-locking. */ | 2761 | /* Don't do file-locking. */ |
| 2762 | record_unwind_protect (subst_char_in_region_unwind_1, | 2762 | record_unwind_protect (subst_char_in_region_unwind_1, |
| 2763 | current_buffer->filename); | 2763 | B_ (current_buffer, filename)); |
| 2764 | current_buffer->filename = Qnil; | 2764 | B_ (current_buffer, filename) = Qnil; |
| 2765 | } | 2765 | } |
| 2766 | 2766 | ||
| 2767 | if (pos_byte < GPT_BYTE) | 2767 | if (pos_byte < GPT_BYTE) |
| @@ -2824,7 +2824,7 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2824 | 2824 | ||
| 2825 | struct gcpro gcpro1; | 2825 | struct gcpro gcpro1; |
| 2826 | 2826 | ||
| 2827 | tem = current_buffer->undo_list; | 2827 | tem = B_ (current_buffer, undo_list); |
| 2828 | GCPRO1 (tem); | 2828 | GCPRO1 (tem); |
| 2829 | 2829 | ||
| 2830 | /* Make a multibyte string containing this single character. */ | 2830 | /* Make a multibyte string containing this single character. */ |
| @@ -2843,7 +2843,7 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2843 | INC_POS (pos_byte_next); | 2843 | INC_POS (pos_byte_next); |
| 2844 | 2844 | ||
| 2845 | if (! NILP (noundo)) | 2845 | if (! NILP (noundo)) |
| 2846 | current_buffer->undo_list = tem; | 2846 | B_ (current_buffer, undo_list) = tem; |
| 2847 | 2847 | ||
| 2848 | UNGCPRO; | 2848 | UNGCPRO; |
| 2849 | } | 2849 | } |
| @@ -2945,7 +2945,7 @@ It returns the number of characters changed. */) | |||
| 2945 | int cnt; /* Number of changes made. */ | 2945 | int cnt; /* Number of changes made. */ |
| 2946 | EMACS_INT size; /* Size of translate table. */ | 2946 | EMACS_INT size; /* Size of translate table. */ |
| 2947 | EMACS_INT pos, pos_byte, end_pos; | 2947 | EMACS_INT pos, pos_byte, end_pos; |
| 2948 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 2948 | int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 2949 | int string_multibyte; | 2949 | int string_multibyte; |
| 2950 | Lisp_Object val; | 2950 | Lisp_Object val; |
| 2951 | 2951 | ||
| @@ -3206,7 +3206,7 @@ save_restriction_restore (Lisp_Object data) | |||
| 3206 | ? XMARKER (XCAR (data))->buffer | 3206 | ? XMARKER (XCAR (data))->buffer |
| 3207 | : XBUFFER (data)); | 3207 | : XBUFFER (data)); |
| 3208 | 3208 | ||
| 3209 | if (buf && buf != current_buffer && !NILP (buf->pt_marker)) | 3209 | if (buf && buf != current_buffer && !NILP (B_ (buf, pt_marker))) |
| 3210 | { /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as | 3210 | { /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as |
| 3211 | is the case if it is or has an indirect buffer), then make | 3211 | is the case if it is or has an indirect buffer), then make |
| 3212 | sure it is current before we update BEGV, so | 3212 | sure it is current before we update BEGV, so |
| @@ -4136,20 +4136,20 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */) | |||
| 4136 | 4136 | ||
| 4137 | if (XINT (c1) == XINT (c2)) | 4137 | if (XINT (c1) == XINT (c2)) |
| 4138 | return Qt; | 4138 | return Qt; |
| 4139 | if (NILP (current_buffer->case_fold_search)) | 4139 | if (NILP (B_ (current_buffer, case_fold_search))) |
| 4140 | return Qnil; | 4140 | return Qnil; |
| 4141 | 4141 | ||
| 4142 | /* Do these in separate statements, | 4142 | /* Do these in separate statements, |
| 4143 | then compare the variables. | 4143 | then compare the variables. |
| 4144 | because of the way DOWNCASE uses temp variables. */ | 4144 | because of the way DOWNCASE uses temp variables. */ |
| 4145 | i1 = XFASTINT (c1); | 4145 | i1 = XFASTINT (c1); |
| 4146 | if (NILP (current_buffer->enable_multibyte_characters) | 4146 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 4147 | && ! ASCII_CHAR_P (i1)) | 4147 | && ! ASCII_CHAR_P (i1)) |
| 4148 | { | 4148 | { |
| 4149 | MAKE_CHAR_MULTIBYTE (i1); | 4149 | MAKE_CHAR_MULTIBYTE (i1); |
| 4150 | } | 4150 | } |
| 4151 | i2 = XFASTINT (c2); | 4151 | i2 = XFASTINT (c2); |
| 4152 | if (NILP (current_buffer->enable_multibyte_characters) | 4152 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 4153 | && ! ASCII_CHAR_P (i2)) | 4153 | && ! ASCII_CHAR_P (i2)) |
| 4154 | { | 4154 | { |
| 4155 | MAKE_CHAR_MULTIBYTE (i2); | 4155 | MAKE_CHAR_MULTIBYTE (i2); |
diff --git a/src/fileio.c b/src/fileio.c index 429fce9f5a0..afef7888b78 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -770,7 +770,7 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 770 | 770 | ||
| 771 | /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */ | 771 | /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */ |
| 772 | if (NILP (default_directory)) | 772 | if (NILP (default_directory)) |
| 773 | default_directory = current_buffer->directory; | 773 | default_directory = B_ (current_buffer, directory); |
| 774 | if (! STRINGP (default_directory)) | 774 | if (! STRINGP (default_directory)) |
| 775 | { | 775 | { |
| 776 | #ifdef DOS_NT | 776 | #ifdef DOS_NT |
| @@ -2669,7 +2669,7 @@ See `file-symlink-p' to distinguish symlinks. */) | |||
| 2669 | struct stat st; | 2669 | struct stat st; |
| 2670 | Lisp_Object handler; | 2670 | Lisp_Object handler; |
| 2671 | 2671 | ||
| 2672 | absname = expand_and_dir_to_file (filename, current_buffer->directory); | 2672 | absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); |
| 2673 | 2673 | ||
| 2674 | /* If the file name has special constructs in it, | 2674 | /* If the file name has special constructs in it, |
| 2675 | call the corresponding file handler. */ | 2675 | call the corresponding file handler. */ |
| @@ -2722,7 +2722,7 @@ See `file-symlink-p' to distinguish symlinks. */) | |||
| 2722 | struct stat st; | 2722 | struct stat st; |
| 2723 | Lisp_Object handler; | 2723 | Lisp_Object handler; |
| 2724 | 2724 | ||
| 2725 | absname = expand_and_dir_to_file (filename, current_buffer->directory); | 2725 | absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); |
| 2726 | 2726 | ||
| 2727 | /* If the file name has special constructs in it, | 2727 | /* If the file name has special constructs in it, |
| 2728 | call the corresponding file handler. */ | 2728 | call the corresponding file handler. */ |
| @@ -2769,7 +2769,7 @@ if file does not exist, is not accessible, or SELinux is disabled */) | |||
| 2769 | context_t context; | 2769 | context_t context; |
| 2770 | #endif | 2770 | #endif |
| 2771 | 2771 | ||
| 2772 | absname = expand_and_dir_to_file (filename, current_buffer->directory); | 2772 | absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); |
| 2773 | 2773 | ||
| 2774 | /* If the file name has special constructs in it, | 2774 | /* If the file name has special constructs in it, |
| 2775 | call the corresponding file handler. */ | 2775 | call the corresponding file handler. */ |
| @@ -2827,7 +2827,7 @@ is disabled. */) | |||
| 2827 | context_t parsed_con; | 2827 | context_t parsed_con; |
| 2828 | #endif | 2828 | #endif |
| 2829 | 2829 | ||
| 2830 | absname = Fexpand_file_name (filename, current_buffer->directory); | 2830 | absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); |
| 2831 | 2831 | ||
| 2832 | /* If the file name has special constructs in it, | 2832 | /* If the file name has special constructs in it, |
| 2833 | call the corresponding file handler. */ | 2833 | call the corresponding file handler. */ |
| @@ -2894,7 +2894,7 @@ Return nil, if file does not exist or is not accessible. */) | |||
| 2894 | struct stat st; | 2894 | struct stat st; |
| 2895 | Lisp_Object handler; | 2895 | Lisp_Object handler; |
| 2896 | 2896 | ||
| 2897 | absname = expand_and_dir_to_file (filename, current_buffer->directory); | 2897 | absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); |
| 2898 | 2898 | ||
| 2899 | /* If the file name has special constructs in it, | 2899 | /* If the file name has special constructs in it, |
| 2900 | call the corresponding file handler. */ | 2900 | call the corresponding file handler. */ |
| @@ -2923,7 +2923,7 @@ symbolic notation, like the `chmod' command from GNU Coreutils. */) | |||
| 2923 | Lisp_Object absname, encoded_absname; | 2923 | Lisp_Object absname, encoded_absname; |
| 2924 | Lisp_Object handler; | 2924 | Lisp_Object handler; |
| 2925 | 2925 | ||
| 2926 | absname = Fexpand_file_name (filename, current_buffer->directory); | 2926 | absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); |
| 2927 | CHECK_NUMBER (mode); | 2927 | CHECK_NUMBER (mode); |
| 2928 | 2928 | ||
| 2929 | /* If the file name has special constructs in it, | 2929 | /* If the file name has special constructs in it, |
| @@ -2985,7 +2985,7 @@ Use the current time if TIME is nil. TIME is in the format of | |||
| 2985 | if (! lisp_time_argument (time, &sec, &usec)) | 2985 | if (! lisp_time_argument (time, &sec, &usec)) |
| 2986 | error ("Invalid time specification"); | 2986 | error ("Invalid time specification"); |
| 2987 | 2987 | ||
| 2988 | absname = Fexpand_file_name (filename, current_buffer->directory); | 2988 | absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); |
| 2989 | 2989 | ||
| 2990 | /* If the file name has special constructs in it, | 2990 | /* If the file name has special constructs in it, |
| 2991 | call the corresponding file handler. */ | 2991 | call the corresponding file handler. */ |
| @@ -3047,8 +3047,8 @@ otherwise, if FILE2 does not exist, the answer is t. */) | |||
| 3047 | 3047 | ||
| 3048 | absname1 = Qnil; | 3048 | absname1 = Qnil; |
| 3049 | GCPRO2 (absname1, file2); | 3049 | GCPRO2 (absname1, file2); |
| 3050 | absname1 = expand_and_dir_to_file (file1, current_buffer->directory); | 3050 | absname1 = expand_and_dir_to_file (file1, B_ (current_buffer, directory)); |
| 3051 | absname2 = expand_and_dir_to_file (file2, current_buffer->directory); | 3051 | absname2 = expand_and_dir_to_file (file2, B_ (current_buffer, directory)); |
| 3052 | UNGCPRO; | 3052 | UNGCPRO; |
| 3053 | 3053 | ||
| 3054 | /* If the file name has special constructs in it, | 3054 | /* If the file name has special constructs in it, |
| @@ -3116,8 +3116,8 @@ decide_coding_unwind (Lisp_Object unwind_data) | |||
| 3116 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); | 3116 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); |
| 3117 | 3117 | ||
| 3118 | /* Now we are safe to change the buffer's multibyteness directly. */ | 3118 | /* Now we are safe to change the buffer's multibyteness directly. */ |
| 3119 | current_buffer->enable_multibyte_characters = multibyte; | 3119 | B_ (current_buffer, enable_multibyte_characters) = multibyte; |
| 3120 | current_buffer->undo_list = undo_list; | 3120 | B_ (current_buffer, undo_list) = undo_list; |
| 3121 | 3121 | ||
| 3122 | return Qnil; | 3122 | return Qnil; |
| 3123 | } | 3123 | } |
| @@ -3212,7 +3212,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3212 | if (current_buffer->base_buffer && ! NILP (visit)) | 3212 | if (current_buffer->base_buffer && ! NILP (visit)) |
| 3213 | error ("Cannot do file visiting in an indirect buffer"); | 3213 | error ("Cannot do file visiting in an indirect buffer"); |
| 3214 | 3214 | ||
| 3215 | if (!NILP (current_buffer->read_only)) | 3215 | if (!NILP (B_ (current_buffer, read_only))) |
| 3216 | Fbarf_if_buffer_read_only (); | 3216 | Fbarf_if_buffer_read_only (); |
| 3217 | 3217 | ||
| 3218 | val = Qnil; | 3218 | val = Qnil; |
| @@ -3403,16 +3403,16 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3403 | buf = XBUFFER (buffer); | 3403 | buf = XBUFFER (buffer); |
| 3404 | 3404 | ||
| 3405 | delete_all_overlays (buf); | 3405 | delete_all_overlays (buf); |
| 3406 | buf->directory = current_buffer->directory; | 3406 | B_ (buf, directory) = B_ (current_buffer, directory); |
| 3407 | buf->read_only = Qnil; | 3407 | B_ (buf, read_only) = Qnil; |
| 3408 | buf->filename = Qnil; | 3408 | B_ (buf, filename) = Qnil; |
| 3409 | buf->undo_list = Qt; | 3409 | B_ (buf, undo_list) = Qt; |
| 3410 | eassert (buf->overlays_before == NULL); | 3410 | eassert (buf->overlays_before == NULL); |
| 3411 | eassert (buf->overlays_after == NULL); | 3411 | eassert (buf->overlays_after == NULL); |
| 3412 | 3412 | ||
| 3413 | set_buffer_internal (buf); | 3413 | set_buffer_internal (buf); |
| 3414 | Ferase_buffer (); | 3414 | Ferase_buffer (); |
| 3415 | buf->enable_multibyte_characters = Qnil; | 3415 | B_ (buf, enable_multibyte_characters) = Qnil; |
| 3416 | 3416 | ||
| 3417 | insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0); | 3417 | insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0); |
| 3418 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); | 3418 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); |
| @@ -3450,7 +3450,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3450 | else | 3450 | else |
| 3451 | CHECK_CODING_SYSTEM (coding_system); | 3451 | CHECK_CODING_SYSTEM (coding_system); |
| 3452 | 3452 | ||
| 3453 | if (NILP (current_buffer->enable_multibyte_characters)) | 3453 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 3454 | /* We must suppress all character code conversion except for | 3454 | /* We must suppress all character code conversion except for |
| 3455 | end-of-line conversion. */ | 3455 | end-of-line conversion. */ |
| 3456 | coding_system = raw_text_coding_system (coding_system); | 3456 | coding_system = raw_text_coding_system (coding_system); |
| @@ -3598,7 +3598,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3598 | we cannot use this method; giveup and try the other. */ | 3598 | we cannot use this method; giveup and try the other. */ |
| 3599 | if (same_at_end > same_at_start | 3599 | if (same_at_end > same_at_start |
| 3600 | && FETCH_BYTE (same_at_end - 1) >= 0200 | 3600 | && FETCH_BYTE (same_at_end - 1) >= 0200 |
| 3601 | && ! NILP (current_buffer->enable_multibyte_characters) | 3601 | && ! NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 3602 | && (CODING_MAY_REQUIRE_DECODING (&coding))) | 3602 | && (CODING_MAY_REQUIRE_DECODING (&coding))) |
| 3603 | giveup_match_end = 1; | 3603 | giveup_match_end = 1; |
| 3604 | break; | 3604 | break; |
| @@ -3617,14 +3617,14 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3617 | 3617 | ||
| 3618 | /* Extend the start of non-matching text area to multibyte | 3618 | /* Extend the start of non-matching text area to multibyte |
| 3619 | character boundary. */ | 3619 | character boundary. */ |
| 3620 | if (! NILP (current_buffer->enable_multibyte_characters)) | 3620 | if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 3621 | while (same_at_start > BEGV_BYTE | 3621 | while (same_at_start > BEGV_BYTE |
| 3622 | && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start))) | 3622 | && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start))) |
| 3623 | same_at_start--; | 3623 | same_at_start--; |
| 3624 | 3624 | ||
| 3625 | /* Extend the end of non-matching text area to multibyte | 3625 | /* Extend the end of non-matching text area to multibyte |
| 3626 | character boundary. */ | 3626 | character boundary. */ |
| 3627 | if (! NILP (current_buffer->enable_multibyte_characters)) | 3627 | if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 3628 | while (same_at_end < ZV_BYTE | 3628 | while (same_at_end < ZV_BYTE |
| 3629 | && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end))) | 3629 | && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end))) |
| 3630 | same_at_end++; | 3630 | same_at_end++; |
| @@ -3673,7 +3673,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3673 | unsigned char *decoded; | 3673 | unsigned char *decoded; |
| 3674 | EMACS_INT temp; | 3674 | EMACS_INT temp; |
| 3675 | int this_count = SPECPDL_INDEX (); | 3675 | int this_count = SPECPDL_INDEX (); |
| 3676 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 3676 | int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 3677 | Lisp_Object conversion_buffer; | 3677 | Lisp_Object conversion_buffer; |
| 3678 | 3678 | ||
| 3679 | conversion_buffer = code_conversion_save (1, multibyte); | 3679 | conversion_buffer = code_conversion_save (1, multibyte); |
| @@ -3778,7 +3778,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3778 | 3778 | ||
| 3779 | /* Extend the start of non-matching text area to the previous | 3779 | /* Extend the start of non-matching text area to the previous |
| 3780 | multibyte character boundary. */ | 3780 | multibyte character boundary. */ |
| 3781 | if (! NILP (current_buffer->enable_multibyte_characters)) | 3781 | if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 3782 | while (same_at_start > BEGV_BYTE | 3782 | while (same_at_start > BEGV_BYTE |
| 3783 | && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start))) | 3783 | && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start))) |
| 3784 | same_at_start--; | 3784 | same_at_start--; |
| @@ -3795,7 +3795,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3795 | 3795 | ||
| 3796 | /* Extend the end of non-matching text area to the next | 3796 | /* Extend the end of non-matching text area to the next |
| 3797 | multibyte character boundary. */ | 3797 | multibyte character boundary. */ |
| 3798 | if (! NILP (current_buffer->enable_multibyte_characters)) | 3798 | if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 3799 | while (same_at_end < ZV_BYTE | 3799 | while (same_at_end < ZV_BYTE |
| 3800 | && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end))) | 3800 | && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end))) |
| 3801 | same_at_end++; | 3801 | same_at_end++; |
| @@ -3870,9 +3870,9 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3870 | if (NILP (visit) && inserted > 0) | 3870 | if (NILP (visit) && inserted > 0) |
| 3871 | { | 3871 | { |
| 3872 | #ifdef CLASH_DETECTION | 3872 | #ifdef CLASH_DETECTION |
| 3873 | if (!NILP (current_buffer->file_truename) | 3873 | if (!NILP (B_ (current_buffer, file_truename)) |
| 3874 | /* Make binding buffer-file-name to nil effective. */ | 3874 | /* Make binding buffer-file-name to nil effective. */ |
| 3875 | && !NILP (current_buffer->filename) | 3875 | && !NILP (B_ (current_buffer, filename)) |
| 3876 | && SAVE_MODIFF >= MODIFF) | 3876 | && SAVE_MODIFF >= MODIFF) |
| 3877 | we_locked_file = 1; | 3877 | we_locked_file = 1; |
| 3878 | #endif /* CLASH_DETECTION */ | 3878 | #endif /* CLASH_DETECTION */ |
| @@ -3977,7 +3977,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 3977 | { | 3977 | { |
| 3978 | #ifdef CLASH_DETECTION | 3978 | #ifdef CLASH_DETECTION |
| 3979 | if (we_locked_file) | 3979 | if (we_locked_file) |
| 3980 | unlock_file (current_buffer->file_truename); | 3980 | unlock_file (B_ (current_buffer, file_truename)); |
| 3981 | #endif | 3981 | #endif |
| 3982 | Vdeactivate_mark = old_Vdeactivate_mark; | 3982 | Vdeactivate_mark = old_Vdeactivate_mark; |
| 3983 | } | 3983 | } |
| @@ -4028,11 +4028,11 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4028 | Lisp_Object unwind_data; | 4028 | Lisp_Object unwind_data; |
| 4029 | int count = SPECPDL_INDEX (); | 4029 | int count = SPECPDL_INDEX (); |
| 4030 | 4030 | ||
| 4031 | unwind_data = Fcons (current_buffer->enable_multibyte_characters, | 4031 | unwind_data = Fcons (B_ (current_buffer, enable_multibyte_characters), |
| 4032 | Fcons (current_buffer->undo_list, | 4032 | Fcons (B_ (current_buffer, undo_list), |
| 4033 | Fcurrent_buffer ())); | 4033 | Fcurrent_buffer ())); |
| 4034 | current_buffer->enable_multibyte_characters = Qnil; | 4034 | B_ (current_buffer, enable_multibyte_characters) = Qnil; |
| 4035 | current_buffer->undo_list = Qt; | 4035 | B_ (current_buffer, undo_list) = Qt; |
| 4036 | record_unwind_protect (decide_coding_unwind, unwind_data); | 4036 | record_unwind_protect (decide_coding_unwind, unwind_data); |
| 4037 | 4037 | ||
| 4038 | if (inserted > 0 && ! NILP (Vset_auto_coding_function)) | 4038 | if (inserted > 0 && ! NILP (Vset_auto_coding_function)) |
| @@ -4062,7 +4062,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4062 | else | 4062 | else |
| 4063 | CHECK_CODING_SYSTEM (coding_system); | 4063 | CHECK_CODING_SYSTEM (coding_system); |
| 4064 | 4064 | ||
| 4065 | if (NILP (current_buffer->enable_multibyte_characters)) | 4065 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 4066 | /* We must suppress all character code conversion except for | 4066 | /* We must suppress all character code conversion except for |
| 4067 | end-of-line conversion. */ | 4067 | end-of-line conversion. */ |
| 4068 | coding_system = raw_text_coding_system (coding_system); | 4068 | coding_system = raw_text_coding_system (coding_system); |
| @@ -4080,10 +4080,10 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4080 | && NILP (replace)) | 4080 | && NILP (replace)) |
| 4081 | /* Visiting a file with these coding system makes the buffer | 4081 | /* Visiting a file with these coding system makes the buffer |
| 4082 | unibyte. */ | 4082 | unibyte. */ |
| 4083 | current_buffer->enable_multibyte_characters = Qnil; | 4083 | B_ (current_buffer, enable_multibyte_characters) = Qnil; |
| 4084 | } | 4084 | } |
| 4085 | 4085 | ||
| 4086 | coding.dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 4086 | coding.dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 4087 | if (CODING_MAY_REQUIRE_DECODING (&coding) | 4087 | if (CODING_MAY_REQUIRE_DECODING (&coding) |
| 4088 | && (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding))) | 4088 | && (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding))) |
| 4089 | { | 4089 | { |
| @@ -4124,24 +4124,24 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4124 | 4124 | ||
| 4125 | if (!NILP (visit)) | 4125 | if (!NILP (visit)) |
| 4126 | { | 4126 | { |
| 4127 | if (!EQ (current_buffer->undo_list, Qt) && !nochange) | 4127 | if (!EQ (B_ (current_buffer, undo_list), Qt) && !nochange) |
| 4128 | current_buffer->undo_list = Qnil; | 4128 | B_ (current_buffer, undo_list) = Qnil; |
| 4129 | 4129 | ||
| 4130 | if (NILP (handler)) | 4130 | if (NILP (handler)) |
| 4131 | { | 4131 | { |
| 4132 | current_buffer->modtime = st.st_mtime; | 4132 | current_buffer->modtime = st.st_mtime; |
| 4133 | current_buffer->modtime_size = st.st_size; | 4133 | current_buffer->modtime_size = st.st_size; |
| 4134 | current_buffer->filename = orig_filename; | 4134 | B_ (current_buffer, filename) = orig_filename; |
| 4135 | } | 4135 | } |
| 4136 | 4136 | ||
| 4137 | SAVE_MODIFF = MODIFF; | 4137 | SAVE_MODIFF = MODIFF; |
| 4138 | BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; | 4138 | BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; |
| 4139 | XSETFASTINT (current_buffer->save_length, Z - BEG); | 4139 | XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); |
| 4140 | #ifdef CLASH_DETECTION | 4140 | #ifdef CLASH_DETECTION |
| 4141 | if (NILP (handler)) | 4141 | if (NILP (handler)) |
| 4142 | { | 4142 | { |
| 4143 | if (!NILP (current_buffer->file_truename)) | 4143 | if (!NILP (B_ (current_buffer, file_truename))) |
| 4144 | unlock_file (current_buffer->file_truename); | 4144 | unlock_file (B_ (current_buffer, file_truename)); |
| 4145 | unlock_file (filename); | 4145 | unlock_file (filename); |
| 4146 | } | 4146 | } |
| 4147 | #endif /* CLASH_DETECTION */ | 4147 | #endif /* CLASH_DETECTION */ |
| @@ -4174,8 +4174,8 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4174 | specbind (Qinhibit_modification_hooks, Qt); | 4174 | specbind (Qinhibit_modification_hooks, Qt); |
| 4175 | 4175 | ||
| 4176 | /* Save old undo list and don't record undo for decoding. */ | 4176 | /* Save old undo list and don't record undo for decoding. */ |
| 4177 | old_undo = current_buffer->undo_list; | 4177 | old_undo = B_ (current_buffer, undo_list); |
| 4178 | current_buffer->undo_list = Qt; | 4178 | B_ (current_buffer, undo_list) = Qt; |
| 4179 | 4179 | ||
| 4180 | if (NILP (replace)) | 4180 | if (NILP (replace)) |
| 4181 | { | 4181 | { |
| @@ -4263,7 +4263,7 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4263 | 4263 | ||
| 4264 | if (NILP (visit)) | 4264 | if (NILP (visit)) |
| 4265 | { | 4265 | { |
| 4266 | current_buffer->undo_list = old_undo; | 4266 | B_ (current_buffer, undo_list) = old_undo; |
| 4267 | if (CONSP (old_undo) && inserted != old_inserted) | 4267 | if (CONSP (old_undo) && inserted != old_inserted) |
| 4268 | { | 4268 | { |
| 4269 | /* Adjust the last undo record for the size change during | 4269 | /* 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. */) | |||
| 4278 | else | 4278 | else |
| 4279 | /* If undo_list was Qt before, keep it that way. | 4279 | /* If undo_list was Qt before, keep it that way. |
| 4280 | Otherwise start with an empty undo_list. */ | 4280 | Otherwise start with an empty undo_list. */ |
| 4281 | current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil; | 4281 | B_ (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil; |
| 4282 | 4282 | ||
| 4283 | unbind_to (count, Qnil); | 4283 | unbind_to (count, Qnil); |
| 4284 | } | 4284 | } |
| @@ -4332,8 +4332,8 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file | |||
| 4332 | Lisp_Object eol_parent = Qnil; | 4332 | Lisp_Object eol_parent = Qnil; |
| 4333 | 4333 | ||
| 4334 | if (auto_saving | 4334 | if (auto_saving |
| 4335 | && NILP (Fstring_equal (current_buffer->filename, | 4335 | && NILP (Fstring_equal (B_ (current_buffer, filename), |
| 4336 | current_buffer->auto_save_file_name))) | 4336 | B_ (current_buffer, auto_save_file_name)))) |
| 4337 | { | 4337 | { |
| 4338 | val = Qutf_8_emacs; | 4338 | val = Qutf_8_emacs; |
| 4339 | eol_parent = Qunix; | 4339 | eol_parent = Qunix; |
| @@ -4362,12 +4362,12 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file | |||
| 4362 | int using_default_coding = 0; | 4362 | int using_default_coding = 0; |
| 4363 | int force_raw_text = 0; | 4363 | int force_raw_text = 0; |
| 4364 | 4364 | ||
| 4365 | val = current_buffer->buffer_file_coding_system; | 4365 | val = B_ (current_buffer, buffer_file_coding_system); |
| 4366 | if (NILP (val) | 4366 | if (NILP (val) |
| 4367 | || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil))) | 4367 | || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil))) |
| 4368 | { | 4368 | { |
| 4369 | val = Qnil; | 4369 | val = Qnil; |
| 4370 | if (NILP (current_buffer->enable_multibyte_characters)) | 4370 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 4371 | force_raw_text = 1; | 4371 | force_raw_text = 1; |
| 4372 | } | 4372 | } |
| 4373 | 4373 | ||
| @@ -4388,7 +4388,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file | |||
| 4388 | { | 4388 | { |
| 4389 | /* If we still have not decided a coding system, use the | 4389 | /* If we still have not decided a coding system, use the |
| 4390 | default value of buffer-file-coding-system. */ | 4390 | default value of buffer-file-coding-system. */ |
| 4391 | val = current_buffer->buffer_file_coding_system; | 4391 | val = B_ (current_buffer, buffer_file_coding_system); |
| 4392 | using_default_coding = 1; | 4392 | using_default_coding = 1; |
| 4393 | } | 4393 | } |
| 4394 | 4394 | ||
| @@ -4412,9 +4412,9 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file | |||
| 4412 | format, we use that of | 4412 | format, we use that of |
| 4413 | `default-buffer-file-coding-system'. */ | 4413 | `default-buffer-file-coding-system'. */ |
| 4414 | if (! using_default_coding | 4414 | if (! using_default_coding |
| 4415 | && ! NILP (buffer_defaults.buffer_file_coding_system)) | 4415 | && ! NILP (B_ (&buffer_defaults, buffer_file_coding_system))) |
| 4416 | val = (coding_inherit_eol_type | 4416 | val = (coding_inherit_eol_type |
| 4417 | (val, buffer_defaults.buffer_file_coding_system)); | 4417 | (val, B_ (&buffer_defaults, buffer_file_coding_system))); |
| 4418 | 4418 | ||
| 4419 | /* If we decide not to encode text, use `raw-text' or one of its | 4419 | /* If we decide not to encode text, use `raw-text' or one of its |
| 4420 | subsidiaries. */ | 4420 | subsidiaries. */ |
| @@ -4425,7 +4425,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file | |||
| 4425 | val = coding_inherit_eol_type (val, eol_parent); | 4425 | val = coding_inherit_eol_type (val, eol_parent); |
| 4426 | setup_coding_system (val, coding); | 4426 | setup_coding_system (val, coding); |
| 4427 | 4427 | ||
| 4428 | if (!STRINGP (start) && !NILP (current_buffer->selective_display)) | 4428 | if (!STRINGP (start) && !NILP (B_ (current_buffer, selective_display))) |
| 4429 | coding->mode |= CODING_MODE_SELECTIVE_DISPLAY; | 4429 | coding->mode |= CODING_MODE_SELECTIVE_DISPLAY; |
| 4430 | return val; | 4430 | return val; |
| 4431 | } | 4431 | } |
| @@ -4529,8 +4529,8 @@ This calls `write-region-annotate-functions' at the start, and | |||
| 4529 | if (visiting) | 4529 | if (visiting) |
| 4530 | { | 4530 | { |
| 4531 | SAVE_MODIFF = MODIFF; | 4531 | SAVE_MODIFF = MODIFF; |
| 4532 | XSETFASTINT (current_buffer->save_length, Z - BEG); | 4532 | XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); |
| 4533 | current_buffer->filename = visit_file; | 4533 | B_ (current_buffer, filename) = visit_file; |
| 4534 | } | 4534 | } |
| 4535 | UNGCPRO; | 4535 | UNGCPRO; |
| 4536 | return val; | 4536 | return val; |
| @@ -4743,15 +4743,15 @@ This calls `write-region-annotate-functions' at the start, and | |||
| 4743 | if (visiting) | 4743 | if (visiting) |
| 4744 | { | 4744 | { |
| 4745 | SAVE_MODIFF = MODIFF; | 4745 | SAVE_MODIFF = MODIFF; |
| 4746 | XSETFASTINT (current_buffer->save_length, Z - BEG); | 4746 | XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); |
| 4747 | current_buffer->filename = visit_file; | 4747 | B_ (current_buffer, filename) = visit_file; |
| 4748 | update_mode_lines++; | 4748 | update_mode_lines++; |
| 4749 | } | 4749 | } |
| 4750 | else if (quietly) | 4750 | else if (quietly) |
| 4751 | { | 4751 | { |
| 4752 | if (auto_saving | 4752 | if (auto_saving |
| 4753 | && ! NILP (Fstring_equal (current_buffer->filename, | 4753 | && ! NILP (Fstring_equal (B_ (current_buffer, filename), |
| 4754 | current_buffer->auto_save_file_name))) | 4754 | B_ (current_buffer, auto_save_file_name)))) |
| 4755 | SAVE_MODIFF = MODIFF; | 4755 | SAVE_MODIFF = MODIFF; |
| 4756 | 4756 | ||
| 4757 | return Qnil; | 4757 | return Qnil; |
| @@ -4833,10 +4833,10 @@ build_annotations (Lisp_Object start, Lisp_Object end) | |||
| 4833 | } | 4833 | } |
| 4834 | 4834 | ||
| 4835 | /* Now do the same for annotation functions implied by the file-format */ | 4835 | /* Now do the same for annotation functions implied by the file-format */ |
| 4836 | if (auto_saving && (!EQ (current_buffer->auto_save_file_format, Qt))) | 4836 | if (auto_saving && (!EQ (B_ (current_buffer, auto_save_file_format), Qt))) |
| 4837 | p = current_buffer->auto_save_file_format; | 4837 | p = B_ (current_buffer, auto_save_file_format); |
| 4838 | else | 4838 | else |
| 4839 | p = current_buffer->file_format; | 4839 | p = B_ (current_buffer, file_format); |
| 4840 | for (i = 0; CONSP (p); p = XCDR (p), ++i) | 4840 | for (i = 0; CONSP (p); p = XCDR (p), ++i) |
| 4841 | { | 4841 | { |
| 4842 | struct buffer *given_buffer = current_buffer; | 4842 | struct buffer *given_buffer = current_buffer; |
| @@ -5015,17 +5015,17 @@ See Info node `(elisp)Modification Time' for more details. */) | |||
| 5015 | b = XBUFFER (buf); | 5015 | b = XBUFFER (buf); |
| 5016 | } | 5016 | } |
| 5017 | 5017 | ||
| 5018 | if (!STRINGP (b->filename)) return Qt; | 5018 | if (!STRINGP (B_ (b, filename))) return Qt; |
| 5019 | if (b->modtime == 0) return Qt; | 5019 | if (b->modtime == 0) return Qt; |
| 5020 | 5020 | ||
| 5021 | /* If the file name has special constructs in it, | 5021 | /* If the file name has special constructs in it, |
| 5022 | call the corresponding file handler. */ | 5022 | call the corresponding file handler. */ |
| 5023 | handler = Ffind_file_name_handler (b->filename, | 5023 | handler = Ffind_file_name_handler (B_ (b, filename), |
| 5024 | Qverify_visited_file_modtime); | 5024 | Qverify_visited_file_modtime); |
| 5025 | if (!NILP (handler)) | 5025 | if (!NILP (handler)) |
| 5026 | return call2 (handler, Qverify_visited_file_modtime, buf); | 5026 | return call2 (handler, Qverify_visited_file_modtime, buf); |
| 5027 | 5027 | ||
| 5028 | filename = ENCODE_FILE (b->filename); | 5028 | filename = ENCODE_FILE (B_ (b, filename)); |
| 5029 | 5029 | ||
| 5030 | if (stat (SSDATA (filename), &st) < 0) | 5030 | if (stat (SSDATA (filename), &st) < 0) |
| 5031 | { | 5031 | { |
| @@ -5093,7 +5093,7 @@ An argument specifies the modification time value to use | |||
| 5093 | struct stat st; | 5093 | struct stat st; |
| 5094 | Lisp_Object handler; | 5094 | Lisp_Object handler; |
| 5095 | 5095 | ||
| 5096 | filename = Fexpand_file_name (current_buffer->filename, Qnil); | 5096 | filename = Fexpand_file_name (B_ (current_buffer, filename), Qnil); |
| 5097 | 5097 | ||
| 5098 | /* If the file name has special constructs in it, | 5098 | /* If the file name has special constructs in it, |
| 5099 | call the corresponding file handler. */ | 5099 | call the corresponding file handler. */ |
| @@ -5128,7 +5128,7 @@ auto_save_error (Lisp_Object error) | |||
| 5128 | ring_bell (XFRAME (selected_frame)); | 5128 | ring_bell (XFRAME (selected_frame)); |
| 5129 | 5129 | ||
| 5130 | args[0] = build_string ("Auto-saving %s: %s"); | 5130 | args[0] = build_string ("Auto-saving %s: %s"); |
| 5131 | args[1] = current_buffer->name; | 5131 | args[1] = B_ (current_buffer, name); |
| 5132 | args[2] = Ferror_message_string (error); | 5132 | args[2] = Ferror_message_string (error); |
| 5133 | msg = Fformat (3, args); | 5133 | msg = Fformat (3, args); |
| 5134 | GCPRO1 (msg); | 5134 | GCPRO1 (msg); |
| @@ -5159,19 +5159,19 @@ auto_save_1 (void) | |||
| 5159 | auto_save_mode_bits = 0666; | 5159 | auto_save_mode_bits = 0666; |
| 5160 | 5160 | ||
| 5161 | /* Get visited file's mode to become the auto save file's mode. */ | 5161 | /* Get visited file's mode to become the auto save file's mode. */ |
| 5162 | if (! NILP (current_buffer->filename)) | 5162 | if (! NILP (B_ (current_buffer, filename))) |
| 5163 | { | 5163 | { |
| 5164 | if (stat (SSDATA (current_buffer->filename), &st) >= 0) | 5164 | if (stat (SSDATA (B_ (current_buffer, filename)), &st) >= 0) |
| 5165 | /* But make sure we can overwrite it later! */ | 5165 | /* But make sure we can overwrite it later! */ |
| 5166 | auto_save_mode_bits = st.st_mode | 0600; | 5166 | auto_save_mode_bits = st.st_mode | 0600; |
| 5167 | else if ((modes = Ffile_modes (current_buffer->filename), | 5167 | else if ((modes = Ffile_modes (B_ (current_buffer, filename)), |
| 5168 | INTEGERP (modes))) | 5168 | INTEGERP (modes))) |
| 5169 | /* Remote files don't cooperate with stat. */ | 5169 | /* Remote files don't cooperate with stat. */ |
| 5170 | auto_save_mode_bits = XINT (modes) | 0600; | 5170 | auto_save_mode_bits = XINT (modes) | 0600; |
| 5171 | } | 5171 | } |
| 5172 | 5172 | ||
| 5173 | return | 5173 | return |
| 5174 | Fwrite_region (Qnil, Qnil, current_buffer->auto_save_file_name, Qnil, | 5174 | Fwrite_region (Qnil, Qnil, B_ (current_buffer, auto_save_file_name), Qnil, |
| 5175 | NILP (Vauto_save_visited_file_name) ? Qlambda : Qt, | 5175 | NILP (Vauto_save_visited_file_name) ? Qlambda : Qt, |
| 5176 | Qnil, Qnil); | 5176 | Qnil, Qnil); |
| 5177 | } | 5177 | } |
| @@ -5312,18 +5312,18 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5312 | /* Record all the buffers that have auto save mode | 5312 | /* Record all the buffers that have auto save mode |
| 5313 | in the special file that lists them. For each of these buffers, | 5313 | in the special file that lists them. For each of these buffers, |
| 5314 | Record visited name (if any) and auto save name. */ | 5314 | Record visited name (if any) and auto save name. */ |
| 5315 | if (STRINGP (b->auto_save_file_name) | 5315 | if (STRINGP (B_ (b, auto_save_file_name)) |
| 5316 | && stream != NULL && do_handled_files == 0) | 5316 | && stream != NULL && do_handled_files == 0) |
| 5317 | { | 5317 | { |
| 5318 | BLOCK_INPUT; | 5318 | BLOCK_INPUT; |
| 5319 | if (!NILP (b->filename)) | 5319 | if (!NILP (B_ (b, filename))) |
| 5320 | { | 5320 | { |
| 5321 | fwrite (SDATA (b->filename), 1, | 5321 | fwrite (SDATA (B_ (b, filename)), 1, |
| 5322 | SBYTES (b->filename), stream); | 5322 | SBYTES (B_ (b, filename)), stream); |
| 5323 | } | 5323 | } |
| 5324 | putc ('\n', stream); | 5324 | putc ('\n', stream); |
| 5325 | fwrite (SDATA (b->auto_save_file_name), 1, | 5325 | fwrite (SDATA (B_ (b, auto_save_file_name)), 1, |
| 5326 | SBYTES (b->auto_save_file_name), stream); | 5326 | SBYTES (B_ (b, auto_save_file_name)), stream); |
| 5327 | putc ('\n', stream); | 5327 | putc ('\n', stream); |
| 5328 | UNBLOCK_INPUT; | 5328 | UNBLOCK_INPUT; |
| 5329 | } | 5329 | } |
| @@ -5340,13 +5340,13 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5340 | /* Check for auto save enabled | 5340 | /* Check for auto save enabled |
| 5341 | and file changed since last auto save | 5341 | and file changed since last auto save |
| 5342 | and file changed since last real save. */ | 5342 | and file changed since last real save. */ |
| 5343 | if (STRINGP (b->auto_save_file_name) | 5343 | if (STRINGP (B_ (b, auto_save_file_name)) |
| 5344 | && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) | 5344 | && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) |
| 5345 | && BUF_AUTOSAVE_MODIFF (b) < BUF_MODIFF (b) | 5345 | && BUF_AUTOSAVE_MODIFF (b) < BUF_MODIFF (b) |
| 5346 | /* -1 means we've turned off autosaving for a while--see below. */ | 5346 | /* -1 means we've turned off autosaving for a while--see below. */ |
| 5347 | && XINT (b->save_length) >= 0 | 5347 | && XINT (B_ (b, save_length)) >= 0 |
| 5348 | && (do_handled_files | 5348 | && (do_handled_files |
| 5349 | || NILP (Ffind_file_name_handler (b->auto_save_file_name, | 5349 | || NILP (Ffind_file_name_handler (B_ (b, auto_save_file_name), |
| 5350 | Qwrite_region)))) | 5350 | Qwrite_region)))) |
| 5351 | { | 5351 | { |
| 5352 | EMACS_TIME before_time, after_time; | 5352 | EMACS_TIME before_time, after_time; |
| @@ -5360,23 +5360,23 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5360 | 5360 | ||
| 5361 | set_buffer_internal (b); | 5361 | set_buffer_internal (b); |
| 5362 | if (NILP (Vauto_save_include_big_deletions) | 5362 | if (NILP (Vauto_save_include_big_deletions) |
| 5363 | && (XFASTINT (b->save_length) * 10 | 5363 | && (XFASTINT (B_ (b, save_length)) * 10 |
| 5364 | > (BUF_Z (b) - BUF_BEG (b)) * 13) | 5364 | > (BUF_Z (b) - BUF_BEG (b)) * 13) |
| 5365 | /* A short file is likely to change a large fraction; | 5365 | /* A short file is likely to change a large fraction; |
| 5366 | spare the user annoying messages. */ | 5366 | spare the user annoying messages. */ |
| 5367 | && XFASTINT (b->save_length) > 5000 | 5367 | && XFASTINT (B_ (b, save_length)) > 5000 |
| 5368 | /* These messages are frequent and annoying for `*mail*'. */ | 5368 | /* These messages are frequent and annoying for `*mail*'. */ |
| 5369 | && !EQ (b->filename, Qnil) | 5369 | && !EQ (B_ (b, filename), Qnil) |
| 5370 | && NILP (no_message)) | 5370 | && NILP (no_message)) |
| 5371 | { | 5371 | { |
| 5372 | /* It has shrunk too much; turn off auto-saving here. */ | 5372 | /* It has shrunk too much; turn off auto-saving here. */ |
| 5373 | minibuffer_auto_raise = orig_minibuffer_auto_raise; | 5373 | minibuffer_auto_raise = orig_minibuffer_auto_raise; |
| 5374 | message_with_string ("Buffer %s has shrunk a lot; auto save disabled in that buffer until next real save", | 5374 | message_with_string ("Buffer %s has shrunk a lot; auto save disabled in that buffer until next real save", |
| 5375 | b->name, 1); | 5375 | B_ (b, name), 1); |
| 5376 | minibuffer_auto_raise = 0; | 5376 | minibuffer_auto_raise = 0; |
| 5377 | /* Turn off auto-saving until there's a real save, | 5377 | /* Turn off auto-saving until there's a real save, |
| 5378 | and prevent any more warnings. */ | 5378 | and prevent any more warnings. */ |
| 5379 | XSETINT (b->save_length, -1); | 5379 | XSETINT (B_ (b, save_length), -1); |
| 5380 | Fsleep_for (make_number (1), Qnil); | 5380 | Fsleep_for (make_number (1), Qnil); |
| 5381 | continue; | 5381 | continue; |
| 5382 | } | 5382 | } |
| @@ -5385,7 +5385,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5385 | internal_condition_case (auto_save_1, Qt, auto_save_error); | 5385 | internal_condition_case (auto_save_1, Qt, auto_save_error); |
| 5386 | auto_saved++; | 5386 | auto_saved++; |
| 5387 | BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b); | 5387 | BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b); |
| 5388 | XSETFASTINT (current_buffer->save_length, Z - BEG); | 5388 | XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); |
| 5389 | set_buffer_internal (old); | 5389 | set_buffer_internal (old); |
| 5390 | 5390 | ||
| 5391 | EMACS_GET_TIME (after_time); | 5391 | EMACS_GET_TIME (after_time); |
| @@ -5432,7 +5432,7 @@ No auto-save file will be written until the buffer changes again. */) | |||
| 5432 | /* FIXME: This should not be called in indirect buffers, since | 5432 | /* FIXME: This should not be called in indirect buffers, since |
| 5433 | they're not autosaved. */ | 5433 | they're not autosaved. */ |
| 5434 | BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; | 5434 | BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; |
| 5435 | XSETFASTINT (current_buffer->save_length, Z - BEG); | 5435 | XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); |
| 5436 | current_buffer->auto_save_failure_time = -1; | 5436 | current_buffer->auto_save_failure_time = -1; |
| 5437 | return Qnil; | 5437 | return Qnil; |
| 5438 | } | 5438 | } |
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) | |||
| 637 | for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) | 637 | for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) |
| 638 | { | 638 | { |
| 639 | b = XBUFFER (XCDR (XCAR (tail))); | 639 | b = XBUFFER (XCDR (XCAR (tail))); |
| 640 | if (STRINGP (b->file_truename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) | 640 | if (STRINGP (B_ (b, file_truename)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) |
| 641 | { | 641 | { |
| 642 | unlock_file(b->file_truename); | 642 | unlock_file(B_ (b, file_truename)); |
| 643 | } | 643 | } |
| 644 | } | 644 | } |
| 645 | } | 645 | } |
| @@ -652,7 +652,7 @@ or else nothing is done if current buffer isn't visiting a file. */) | |||
| 652 | (Lisp_Object file) | 652 | (Lisp_Object file) |
| 653 | { | 653 | { |
| 654 | if (NILP (file)) | 654 | if (NILP (file)) |
| 655 | file = current_buffer->file_truename; | 655 | file = B_ (current_buffer, file_truename); |
| 656 | else | 656 | else |
| 657 | CHECK_STRING (file); | 657 | CHECK_STRING (file); |
| 658 | if (SAVE_MODIFF < MODIFF | 658 | if (SAVE_MODIFF < MODIFF |
| @@ -669,8 +669,8 @@ should not be locked in that case. */) | |||
| 669 | (void) | 669 | (void) |
| 670 | { | 670 | { |
| 671 | if (SAVE_MODIFF < MODIFF | 671 | if (SAVE_MODIFF < MODIFF |
| 672 | && STRINGP (current_buffer->file_truename)) | 672 | && STRINGP (B_ (current_buffer, file_truename))) |
| 673 | unlock_file (current_buffer->file_truename); | 673 | unlock_file (B_ (current_buffer, file_truename)); |
| 674 | return Qnil; | 674 | return Qnil; |
| 675 | } | 675 | } |
| 676 | 676 | ||
| @@ -680,8 +680,8 @@ void | |||
| 680 | unlock_buffer (struct buffer *buffer) | 680 | unlock_buffer (struct buffer *buffer) |
| 681 | { | 681 | { |
| 682 | if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer) | 682 | if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer) |
| 683 | && STRINGP (buffer->file_truename)) | 683 | && STRINGP (B_ (buffer, file_truename))) |
| 684 | unlock_file (buffer->file_truename); | 684 | unlock_file (B_ (buffer, file_truename)); |
| 685 | } | 685 | } |
| 686 | 686 | ||
| 687 | DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0, | 687 | DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0, |
| @@ -2984,7 +2984,7 @@ into shorter lines. */) | |||
| 2984 | SAFE_ALLOCA (encoded, char *, allength); | 2984 | SAFE_ALLOCA (encoded, char *, allength); |
| 2985 | encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg), | 2985 | encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg), |
| 2986 | encoded, length, NILP (no_line_break), | 2986 | encoded, length, NILP (no_line_break), |
| 2987 | !NILP (current_buffer->enable_multibyte_characters)); | 2987 | !NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 2988 | if (encoded_length > allength) | 2988 | if (encoded_length > allength) |
| 2989 | abort (); | 2989 | abort (); |
| 2990 | 2990 | ||
| @@ -3166,7 +3166,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */ | |||
| 3166 | EMACS_INT old_pos = PT; | 3166 | EMACS_INT old_pos = PT; |
| 3167 | EMACS_INT decoded_length; | 3167 | EMACS_INT decoded_length; |
| 3168 | EMACS_INT inserted_chars; | 3168 | EMACS_INT inserted_chars; |
| 3169 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 3169 | int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 3170 | USE_SAFE_ALLOCA; | 3170 | USE_SAFE_ALLOCA; |
| 3171 | 3171 | ||
| 3172 | validate_region (&beg, &end); | 3172 | validate_region (&beg, &end); |
| @@ -4684,12 +4684,12 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 4684 | { | 4684 | { |
| 4685 | int force_raw_text = 0; | 4685 | int force_raw_text = 0; |
| 4686 | 4686 | ||
| 4687 | coding_system = XBUFFER (object)->buffer_file_coding_system; | 4687 | coding_system = B_ (XBUFFER (object), buffer_file_coding_system); |
| 4688 | if (NILP (coding_system) | 4688 | if (NILP (coding_system) |
| 4689 | || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil))) | 4689 | || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil))) |
| 4690 | { | 4690 | { |
| 4691 | coding_system = Qnil; | 4691 | coding_system = Qnil; |
| 4692 | if (NILP (current_buffer->enable_multibyte_characters)) | 4692 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 4693 | force_raw_text = 1; | 4693 | force_raw_text = 1; |
| 4694 | } | 4694 | } |
| 4695 | 4695 | ||
| @@ -4706,11 +4706,11 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 4706 | } | 4706 | } |
| 4707 | 4707 | ||
| 4708 | if (NILP (coding_system) | 4708 | if (NILP (coding_system) |
| 4709 | && !NILP (XBUFFER (object)->buffer_file_coding_system)) | 4709 | && !NILP (B_ (XBUFFER (object), buffer_file_coding_system))) |
| 4710 | { | 4710 | { |
| 4711 | /* If we still have not decided a coding system, use the | 4711 | /* If we still have not decided a coding system, use the |
| 4712 | default value of buffer-file-coding-system. */ | 4712 | default value of buffer-file-coding-system. */ |
| 4713 | coding_system = XBUFFER (object)->buffer_file_coding_system; | 4713 | coding_system = B_ (XBUFFER (object), buffer_file_coding_system); |
| 4714 | } | 4714 | } |
| 4715 | 4715 | ||
| 4716 | if (!force_raw_text | 4716 | if (!force_raw_text |
diff --git a/src/font.c b/src/font.c index 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, | |||
| 3637 | Lisp_Object font_object; | 3637 | Lisp_Object font_object; |
| 3638 | 3638 | ||
| 3639 | multibyte = (NILP (string) | 3639 | multibyte = (NILP (string) |
| 3640 | ? ! NILP (current_buffer->enable_multibyte_characters) | 3640 | ? ! NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 3641 | : STRING_MULTIBYTE (string)); | 3641 | : STRING_MULTIBYTE (string)); |
| 3642 | if (c < 0) | 3642 | if (c < 0) |
| 3643 | { | 3643 | { |
diff --git a/src/frame.c b/src/frame.c index 20bad4cb8c5..ac223ac4da0 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1817,7 +1817,7 @@ make_frame_visible_1 (Lisp_Object window) | |||
| 1817 | w = XWINDOW (window); | 1817 | w = XWINDOW (window); |
| 1818 | 1818 | ||
| 1819 | if (!NILP (w->buffer)) | 1819 | if (!NILP (w->buffer)) |
| 1820 | XBUFFER (w->buffer)->display_time = Fcurrent_time (); | 1820 | B_ (XBUFFER (w->buffer), display_time) = Fcurrent_time (); |
| 1821 | 1821 | ||
| 1822 | if (!NILP (w->vchild)) | 1822 | if (!NILP (w->vchild)) |
| 1823 | make_frame_visible_1 (w->vchild); | 1823 | make_frame_visible_1 (w->vchild); |
diff --git a/src/fringe.c b/src/fringe.c index 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) | |||
| 660 | { | 660 | { |
| 661 | Lisp_Object cmap, bm = Qnil; | 661 | Lisp_Object cmap, bm = Qnil; |
| 662 | 662 | ||
| 663 | if ((cmap = XBUFFER (w->buffer)->fringe_cursor_alist), !NILP (cmap)) | 663 | if ((cmap = B_ (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap)) |
| 664 | { | 664 | { |
| 665 | bm = Fassq (cursor, cmap); | 665 | bm = Fassq (cursor, cmap); |
| 666 | if (CONSP (bm)) | 666 | if (CONSP (bm)) |
| @@ -670,9 +670,9 @@ get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor) | |||
| 670 | return lookup_fringe_bitmap (bm); | 670 | return lookup_fringe_bitmap (bm); |
| 671 | } | 671 | } |
| 672 | } | 672 | } |
| 673 | if (EQ (cmap, buffer_defaults.fringe_cursor_alist)) | 673 | if (EQ (cmap, B_ (&buffer_defaults, fringe_cursor_alist))) |
| 674 | return NO_FRINGE_BITMAP; | 674 | return NO_FRINGE_BITMAP; |
| 675 | bm = Fassq (cursor, buffer_defaults.fringe_cursor_alist); | 675 | bm = Fassq (cursor, B_ (&buffer_defaults, fringe_cursor_alist)); |
| 676 | if (!CONSP (bm) || ((bm = XCDR (bm)), NILP (bm))) | 676 | if (!CONSP (bm) || ((bm = XCDR (bm)), NILP (bm))) |
| 677 | return NO_FRINGE_BITMAP; | 677 | return NO_FRINGE_BITMAP; |
| 678 | return lookup_fringe_bitmap (bm); | 678 | return lookup_fringe_bitmap (bm); |
| @@ -697,7 +697,7 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in | |||
| 697 | If partial, lookup partial bitmap in default value if not found here. | 697 | If partial, lookup partial bitmap in default value if not found here. |
| 698 | If not partial, or no partial spec is present, use non-partial bitmap. */ | 698 | If not partial, or no partial spec is present, use non-partial bitmap. */ |
| 699 | 699 | ||
| 700 | if ((cmap = XBUFFER (w->buffer)->fringe_indicator_alist), !NILP (cmap)) | 700 | if ((cmap = B_ (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap)) |
| 701 | { | 701 | { |
| 702 | bm1 = Fassq (bitmap, cmap); | 702 | bm1 = Fassq (bitmap, cmap); |
| 703 | if (CONSP (bm1)) | 703 | if (CONSP (bm1)) |
| @@ -731,10 +731,10 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in | |||
| 731 | } | 731 | } |
| 732 | } | 732 | } |
| 733 | 733 | ||
| 734 | if (!EQ (cmap, buffer_defaults.fringe_indicator_alist) | 734 | if (!EQ (cmap, B_ (&buffer_defaults, fringe_indicator_alist)) |
| 735 | && !NILP (buffer_defaults.fringe_indicator_alist)) | 735 | && !NILP (B_ (&buffer_defaults, fringe_indicator_alist))) |
| 736 | { | 736 | { |
| 737 | bm2 = Fassq (bitmap, buffer_defaults.fringe_indicator_alist); | 737 | bm2 = Fassq (bitmap, B_ (&buffer_defaults, fringe_indicator_alist)); |
| 738 | if (CONSP (bm2)) | 738 | if (CONSP (bm2)) |
| 739 | { | 739 | { |
| 740 | if ((bm2 = XCDR (bm2)), !NILP (bm2)) | 740 | if ((bm2 = XCDR (bm2)), !NILP (bm2)) |
| @@ -919,7 +919,7 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 919 | return 0; | 919 | return 0; |
| 920 | 920 | ||
| 921 | if (!MINI_WINDOW_P (w) | 921 | if (!MINI_WINDOW_P (w) |
| 922 | && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind))) | 922 | && (ind = B_ (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind))) |
| 923 | { | 923 | { |
| 924 | if (EQ (ind, Qleft) || EQ (ind, Qright)) | 924 | if (EQ (ind, Qleft) || EQ (ind, Qright)) |
| 925 | boundary_top = boundary_bot = arrow_top = arrow_bot = ind; | 925 | boundary_top = boundary_bot = arrow_top = arrow_bot = ind; |
| @@ -988,7 +988,7 @@ update_window_fringes (struct window *w, int keep_current_p) | |||
| 988 | } | 988 | } |
| 989 | } | 989 | } |
| 990 | 990 | ||
| 991 | empty_pos = XBUFFER (w->buffer)->indicate_empty_lines; | 991 | empty_pos = B_ (XBUFFER (w->buffer), indicate_empty_lines); |
| 992 | if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) | 992 | if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) |
| 993 | empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft; | 993 | empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft; |
| 994 | 994 | ||
diff --git a/src/indent.c b/src/indent.c index 84ce140c5ba..b0195b3dec8 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -70,7 +70,7 @@ buffer_display_table (void) | |||
| 70 | { | 70 | { |
| 71 | Lisp_Object thisbuf; | 71 | Lisp_Object thisbuf; |
| 72 | 72 | ||
| 73 | thisbuf = current_buffer->display_table; | 73 | thisbuf = B_ (current_buffer, display_table); |
| 74 | if (DISP_TABLE_P (thisbuf)) | 74 | if (DISP_TABLE_P (thisbuf)) |
| 75 | return XCHAR_TABLE (thisbuf); | 75 | return XCHAR_TABLE (thisbuf); |
| 76 | if (DISP_TABLE_P (Vstandard_display_table)) | 76 | if (DISP_TABLE_P (Vstandard_display_table)) |
| @@ -140,9 +140,9 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab) | |||
| 140 | int i; | 140 | int i; |
| 141 | struct Lisp_Vector *widthtab; | 141 | struct Lisp_Vector *widthtab; |
| 142 | 142 | ||
| 143 | if (!VECTORP (buf->width_table)) | 143 | if (!VECTORP (B_ (buf, width_table))) |
| 144 | buf->width_table = Fmake_vector (make_number (256), make_number (0)); | 144 | B_ (buf, width_table) = Fmake_vector (make_number (256), make_number (0)); |
| 145 | widthtab = XVECTOR (buf->width_table); | 145 | widthtab = XVECTOR (B_ (buf, width_table)); |
| 146 | if (widthtab->size != 256) | 146 | if (widthtab->size != 256) |
| 147 | abort (); | 147 | abort (); |
| 148 | 148 | ||
| @@ -156,17 +156,17 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab) | |||
| 156 | static void | 156 | static void |
| 157 | width_run_cache_on_off (void) | 157 | width_run_cache_on_off (void) |
| 158 | { | 158 | { |
| 159 | if (NILP (current_buffer->cache_long_line_scans) | 159 | if (NILP (B_ (current_buffer, cache_long_line_scans)) |
| 160 | /* And, for the moment, this feature doesn't work on multibyte | 160 | /* And, for the moment, this feature doesn't work on multibyte |
| 161 | characters. */ | 161 | characters. */ |
| 162 | || !NILP (current_buffer->enable_multibyte_characters)) | 162 | || !NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 163 | { | 163 | { |
| 164 | /* It should be off. */ | 164 | /* It should be off. */ |
| 165 | if (current_buffer->width_run_cache) | 165 | if (current_buffer->width_run_cache) |
| 166 | { | 166 | { |
| 167 | free_region_cache (current_buffer->width_run_cache); | 167 | free_region_cache (current_buffer->width_run_cache); |
| 168 | current_buffer->width_run_cache = 0; | 168 | current_buffer->width_run_cache = 0; |
| 169 | current_buffer->width_table = Qnil; | 169 | B_ (current_buffer, width_table) = Qnil; |
| 170 | } | 170 | } |
| 171 | } | 171 | } |
| 172 | else | 172 | else |
| @@ -329,8 +329,8 @@ current_column (void) | |||
| 329 | register int tab_seen; | 329 | register int tab_seen; |
| 330 | int post_tab; | 330 | int post_tab; |
| 331 | register int c; | 331 | register int c; |
| 332 | register int tab_width = XINT (current_buffer->tab_width); | 332 | register int tab_width = XINT (B_ (current_buffer, tab_width)); |
| 333 | int ctl_arrow = !NILP (current_buffer->ctl_arrow); | 333 | int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); |
| 334 | register struct Lisp_Char_Table *dp = buffer_display_table (); | 334 | register struct Lisp_Char_Table *dp = buffer_display_table (); |
| 335 | 335 | ||
| 336 | if (PT == last_known_column_point | 336 | if (PT == last_known_column_point |
| @@ -417,7 +417,7 @@ current_column (void) | |||
| 417 | col++; | 417 | col++; |
| 418 | else if (c == '\n' | 418 | else if (c == '\n' |
| 419 | || (c == '\r' | 419 | || (c == '\r' |
| 420 | && EQ (current_buffer->selective_display, Qt))) | 420 | && EQ (B_ (current_buffer, selective_display), Qt))) |
| 421 | { | 421 | { |
| 422 | ptr++; | 422 | ptr++; |
| 423 | goto start_of_line_found; | 423 | goto start_of_line_found; |
| @@ -512,10 +512,10 @@ check_display_width (EMACS_INT pos, EMACS_INT col, EMACS_INT *endpos) | |||
| 512 | static void | 512 | static void |
| 513 | scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) | 513 | scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) |
| 514 | { | 514 | { |
| 515 | register EMACS_INT tab_width = XINT (current_buffer->tab_width); | 515 | register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width)); |
| 516 | register int ctl_arrow = !NILP (current_buffer->ctl_arrow); | 516 | register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); |
| 517 | register struct Lisp_Char_Table *dp = buffer_display_table (); | 517 | register struct Lisp_Char_Table *dp = buffer_display_table (); |
| 518 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 518 | int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 519 | struct composition_it cmp_it; | 519 | struct composition_it cmp_it; |
| 520 | Lisp_Object window; | 520 | Lisp_Object window; |
| 521 | struct window *w; | 521 | struct window *w; |
| @@ -637,7 +637,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) | |||
| 637 | 637 | ||
| 638 | if (c == '\n') | 638 | if (c == '\n') |
| 639 | goto endloop; | 639 | goto endloop; |
| 640 | if (c == '\r' && EQ (current_buffer->selective_display, Qt)) | 640 | if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt)) |
| 641 | goto endloop; | 641 | goto endloop; |
| 642 | if (c == '\t') | 642 | if (c == '\t') |
| 643 | { | 643 | { |
| @@ -655,7 +655,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) | |||
| 655 | 655 | ||
| 656 | if (c == '\n') | 656 | if (c == '\n') |
| 657 | goto endloop; | 657 | goto endloop; |
| 658 | if (c == '\r' && EQ (current_buffer->selective_display, Qt)) | 658 | if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt)) |
| 659 | goto endloop; | 659 | goto endloop; |
| 660 | if (c == '\t') | 660 | if (c == '\t') |
| 661 | { | 661 | { |
| @@ -809,7 +809,7 @@ The return value is COLUMN. */) | |||
| 809 | { | 809 | { |
| 810 | int mincol; | 810 | int mincol; |
| 811 | register int fromcol; | 811 | register int fromcol; |
| 812 | register int tab_width = XINT (current_buffer->tab_width); | 812 | register int tab_width = XINT (B_ (current_buffer, tab_width)); |
| 813 | 813 | ||
| 814 | CHECK_NUMBER (column); | 814 | CHECK_NUMBER (column); |
| 815 | if (NILP (minimum)) | 815 | if (NILP (minimum)) |
| @@ -872,7 +872,7 @@ static double | |||
| 872 | position_indentation (register int pos_byte) | 872 | position_indentation (register int pos_byte) |
| 873 | { | 873 | { |
| 874 | register EMACS_INT column = 0; | 874 | register EMACS_INT column = 0; |
| 875 | register EMACS_INT tab_width = XINT (current_buffer->tab_width); | 875 | register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width)); |
| 876 | register unsigned char *p; | 876 | register unsigned char *p; |
| 877 | register unsigned char *stop; | 877 | register unsigned char *stop; |
| 878 | unsigned char *start; | 878 | unsigned char *start; |
| @@ -924,7 +924,7 @@ position_indentation (register int pos_byte) | |||
| 924 | switch (*p++) | 924 | switch (*p++) |
| 925 | { | 925 | { |
| 926 | case 0240: | 926 | case 0240: |
| 927 | if (! NILP (current_buffer->enable_multibyte_characters)) | 927 | if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 928 | return column; | 928 | return column; |
| 929 | case ' ': | 929 | case ' ': |
| 930 | column++; | 930 | column++; |
| @@ -934,7 +934,7 @@ position_indentation (register int pos_byte) | |||
| 934 | break; | 934 | break; |
| 935 | default: | 935 | default: |
| 936 | if (ASCII_BYTE_P (p[-1]) | 936 | if (ASCII_BYTE_P (p[-1]) |
| 937 | || NILP (current_buffer->enable_multibyte_characters)) | 937 | || NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 938 | return column; | 938 | return column; |
| 939 | { | 939 | { |
| 940 | int c; | 940 | int c; |
| @@ -1123,13 +1123,13 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_ | |||
| 1123 | register EMACS_INT pos; | 1123 | register EMACS_INT pos; |
| 1124 | EMACS_INT pos_byte; | 1124 | EMACS_INT pos_byte; |
| 1125 | register int c = 0; | 1125 | register int c = 0; |
| 1126 | register EMACS_INT tab_width = XFASTINT (current_buffer->tab_width); | 1126 | register EMACS_INT tab_width = XFASTINT (B_ (current_buffer, tab_width)); |
| 1127 | register int ctl_arrow = !NILP (current_buffer->ctl_arrow); | 1127 | register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); |
| 1128 | register struct Lisp_Char_Table *dp = window_display_table (win); | 1128 | register struct Lisp_Char_Table *dp = window_display_table (win); |
| 1129 | int selective | 1129 | int selective |
| 1130 | = (INTEGERP (current_buffer->selective_display) | 1130 | = (INTEGERP (B_ (current_buffer, selective_display)) |
| 1131 | ? XINT (current_buffer->selective_display) | 1131 | ? XINT (B_ (current_buffer, selective_display)) |
| 1132 | : !NILP (current_buffer->selective_display) ? -1 : 0); | 1132 | : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0); |
| 1133 | int selective_rlen | 1133 | int selective_rlen |
| 1134 | = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp)) | 1134 | = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp)) |
| 1135 | ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); | 1135 | ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); |
| @@ -1151,7 +1151,7 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_ | |||
| 1151 | EMACS_INT next_width_run = from; | 1151 | EMACS_INT next_width_run = from; |
| 1152 | Lisp_Object window; | 1152 | Lisp_Object window; |
| 1153 | 1153 | ||
| 1154 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 1154 | int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 1155 | /* If previous char scanned was a wide character, | 1155 | /* If previous char scanned was a wide character, |
| 1156 | this is the column where it ended. Otherwise, this is 0. */ | 1156 | this is the column where it ended. Otherwise, this is 0. */ |
| 1157 | EMACS_INT wide_column_end_hpos = 0; | 1157 | EMACS_INT wide_column_end_hpos = 0; |
| @@ -1170,8 +1170,8 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_ | |||
| 1170 | 1170 | ||
| 1171 | width_run_cache_on_off (); | 1171 | width_run_cache_on_off (); |
| 1172 | if (dp == buffer_display_table ()) | 1172 | if (dp == buffer_display_table ()) |
| 1173 | width_table = (VECTORP (current_buffer->width_table) | 1173 | width_table = (VECTORP (B_ (current_buffer, width_table)) |
| 1174 | ? XVECTOR (current_buffer->width_table)->contents | 1174 | ? XVECTOR (B_ (current_buffer, width_table))->contents |
| 1175 | : 0); | 1175 | : 0); |
| 1176 | else | 1176 | else |
| 1177 | /* If the window has its own display table, we can't use the width | 1177 | /* If the window has its own display table, we can't use the width |
| @@ -1337,7 +1337,7 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_ | |||
| 1337 | } | 1337 | } |
| 1338 | 1338 | ||
| 1339 | if (hscroll || truncate | 1339 | if (hscroll || truncate |
| 1340 | || !NILP (current_buffer->truncate_lines)) | 1340 | || !NILP (B_ (current_buffer, truncate_lines))) |
| 1341 | { | 1341 | { |
| 1342 | /* Truncating: skip to newline, unless we are already past | 1342 | /* Truncating: skip to newline, unless we are already past |
| 1343 | TO (we need to go back below). */ | 1343 | TO (we need to go back below). */ |
| @@ -1838,9 +1838,9 @@ vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w) | |||
| 1838 | EMACS_INT from_byte; | 1838 | EMACS_INT from_byte; |
| 1839 | EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0; | 1839 | EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0; |
| 1840 | int selective | 1840 | int selective |
| 1841 | = (INTEGERP (current_buffer->selective_display) | 1841 | = (INTEGERP (B_ (current_buffer, selective_display)) |
| 1842 | ? XINT (current_buffer->selective_display) | 1842 | ? XINT (B_ (current_buffer, selective_display)) |
| 1843 | : !NILP (current_buffer->selective_display) ? -1 : 0); | 1843 | : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0); |
| 1844 | Lisp_Object window; | 1844 | Lisp_Object window; |
| 1845 | EMACS_INT start_hpos = 0; | 1845 | EMACS_INT start_hpos = 0; |
| 1846 | int did_motion; | 1846 | int did_motion; |
diff --git a/src/insdel.c b/src/insdel.c index db76f770dad..e127ea555fb 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -78,7 +78,7 @@ void | |||
| 78 | check_markers (void) | 78 | check_markers (void) |
| 79 | { | 79 | { |
| 80 | register struct Lisp_Marker *tail; | 80 | register struct Lisp_Marker *tail; |
| 81 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 81 | int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 82 | 82 | ||
| 83 | for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) | 83 | for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) |
| 84 | { | 84 | { |
| @@ -703,7 +703,7 @@ insert_char (int c) | |||
| 703 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 703 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 704 | int len; | 704 | int len; |
| 705 | 705 | ||
| 706 | if (! NILP (current_buffer->enable_multibyte_characters)) | 706 | if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 707 | len = CHAR_STRING (c, str); | 707 | len = CHAR_STRING (c, str); |
| 708 | else | 708 | else |
| 709 | { | 709 | { |
| @@ -891,7 +891,7 @@ insert_1_both (const char *string, | |||
| 891 | if (nchars == 0) | 891 | if (nchars == 0) |
| 892 | return; | 892 | return; |
| 893 | 893 | ||
| 894 | if (NILP (current_buffer->enable_multibyte_characters)) | 894 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 895 | nchars = nbytes; | 895 | nchars = nbytes; |
| 896 | 896 | ||
| 897 | if (prepare) | 897 | if (prepare) |
| @@ -1011,7 +1011,7 @@ insert_from_string_1 (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte, | |||
| 1011 | /* Make OUTGOING_NBYTES describe the text | 1011 | /* Make OUTGOING_NBYTES describe the text |
| 1012 | as it will be inserted in this buffer. */ | 1012 | as it will be inserted in this buffer. */ |
| 1013 | 1013 | ||
| 1014 | if (NILP (current_buffer->enable_multibyte_characters)) | 1014 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 1015 | outgoing_nbytes = nchars; | 1015 | outgoing_nbytes = nchars; |
| 1016 | else if (! STRING_MULTIBYTE (string)) | 1016 | else if (! STRING_MULTIBYTE (string)) |
| 1017 | outgoing_nbytes | 1017 | outgoing_nbytes |
| @@ -1034,7 +1034,7 @@ insert_from_string_1 (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte, | |||
| 1034 | between single-byte and multibyte. */ | 1034 | between single-byte and multibyte. */ |
| 1035 | copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes, | 1035 | copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes, |
| 1036 | STRING_MULTIBYTE (string), | 1036 | STRING_MULTIBYTE (string), |
| 1037 | ! NILP (current_buffer->enable_multibyte_characters)); | 1037 | ! NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 1038 | 1038 | ||
| 1039 | #ifdef BYTE_COMBINING_DEBUG | 1039 | #ifdef BYTE_COMBINING_DEBUG |
| 1040 | /* We have copied text into the gap, but we have not altered | 1040 | /* We have copied text into the gap, but we have not altered |
| @@ -1094,7 +1094,7 @@ insert_from_string_1 (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte, | |||
| 1094 | void | 1094 | void |
| 1095 | insert_from_gap (EMACS_INT nchars, EMACS_INT nbytes) | 1095 | insert_from_gap (EMACS_INT nchars, EMACS_INT nbytes) |
| 1096 | { | 1096 | { |
| 1097 | if (NILP (current_buffer->enable_multibyte_characters)) | 1097 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 1098 | nchars = nbytes; | 1098 | nchars = nbytes; |
| 1099 | 1099 | ||
| 1100 | record_insert (GPT, nchars); | 1100 | record_insert (GPT, nchars); |
| @@ -1162,9 +1162,9 @@ insert_from_buffer_1 (struct buffer *buf, | |||
| 1162 | /* Make OUTGOING_NBYTES describe the text | 1162 | /* Make OUTGOING_NBYTES describe the text |
| 1163 | as it will be inserted in this buffer. */ | 1163 | as it will be inserted in this buffer. */ |
| 1164 | 1164 | ||
| 1165 | if (NILP (current_buffer->enable_multibyte_characters)) | 1165 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 1166 | outgoing_nbytes = nchars; | 1166 | outgoing_nbytes = nchars; |
| 1167 | else if (NILP (buf->enable_multibyte_characters)) | 1167 | else if (NILP (B_ (buf, enable_multibyte_characters))) |
| 1168 | { | 1168 | { |
| 1169 | EMACS_INT outgoing_before_gap = 0; | 1169 | EMACS_INT outgoing_before_gap = 0; |
| 1170 | EMACS_INT outgoing_after_gap = 0; | 1170 | EMACS_INT outgoing_after_gap = 0; |
| @@ -1215,8 +1215,8 @@ insert_from_buffer_1 (struct buffer *buf, | |||
| 1215 | chunk_expanded | 1215 | chunk_expanded |
| 1216 | = copy_text (BUF_BYTE_ADDRESS (buf, from_byte), | 1216 | = copy_text (BUF_BYTE_ADDRESS (buf, from_byte), |
| 1217 | GPT_ADDR, chunk, | 1217 | GPT_ADDR, chunk, |
| 1218 | ! NILP (buf->enable_multibyte_characters), | 1218 | ! NILP (B_ (buf, enable_multibyte_characters)), |
| 1219 | ! NILP (current_buffer->enable_multibyte_characters)); | 1219 | ! NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 1220 | } | 1220 | } |
| 1221 | else | 1221 | else |
| 1222 | chunk_expanded = chunk = 0; | 1222 | chunk_expanded = chunk = 0; |
| @@ -1224,8 +1224,8 @@ insert_from_buffer_1 (struct buffer *buf, | |||
| 1224 | if (chunk < incoming_nbytes) | 1224 | if (chunk < incoming_nbytes) |
| 1225 | copy_text (BUF_BYTE_ADDRESS (buf, from_byte + chunk), | 1225 | copy_text (BUF_BYTE_ADDRESS (buf, from_byte + chunk), |
| 1226 | GPT_ADDR + chunk_expanded, incoming_nbytes - chunk, | 1226 | GPT_ADDR + chunk_expanded, incoming_nbytes - chunk, |
| 1227 | ! NILP (buf->enable_multibyte_characters), | 1227 | ! NILP (B_ (buf, enable_multibyte_characters)), |
| 1228 | ! NILP (current_buffer->enable_multibyte_characters)); | 1228 | ! NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 1229 | 1229 | ||
| 1230 | #ifdef BYTE_COMBINING_DEBUG | 1230 | #ifdef BYTE_COMBINING_DEBUG |
| 1231 | /* We have copied text into the gap, but we have not altered | 1231 | /* We have copied text into the gap, but we have not altered |
| @@ -1320,7 +1320,7 @@ adjust_after_replace (EMACS_INT from, EMACS_INT from_byte, | |||
| 1320 | adjust_markers_for_insert (from, from_byte, | 1320 | adjust_markers_for_insert (from, from_byte, |
| 1321 | from + len, from_byte + len_byte, 0); | 1321 | from + len, from_byte + len_byte, 0); |
| 1322 | 1322 | ||
| 1323 | if (! EQ (current_buffer->undo_list, Qt)) | 1323 | if (! EQ (B_ (current_buffer, undo_list), Qt)) |
| 1324 | { | 1324 | { |
| 1325 | if (nchars_del > 0) | 1325 | if (nchars_del > 0) |
| 1326 | record_delete (from, prev_text); | 1326 | record_delete (from, prev_text); |
| @@ -1481,7 +1481,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new, | |||
| 1481 | /* Make OUTGOING_INSBYTES describe the text | 1481 | /* Make OUTGOING_INSBYTES describe the text |
| 1482 | as it will be inserted in this buffer. */ | 1482 | as it will be inserted in this buffer. */ |
| 1483 | 1483 | ||
| 1484 | if (NILP (current_buffer->enable_multibyte_characters)) | 1484 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 1485 | outgoing_insbytes = inschars; | 1485 | outgoing_insbytes = inschars; |
| 1486 | else if (! STRING_MULTIBYTE (new)) | 1486 | else if (! STRING_MULTIBYTE (new)) |
| 1487 | outgoing_insbytes | 1487 | outgoing_insbytes |
| @@ -1503,7 +1503,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new, | |||
| 1503 | /* Even if we don't record for undo, we must keep the original text | 1503 | /* Even if we don't record for undo, we must keep the original text |
| 1504 | because we may have to recover it because of inappropriate byte | 1504 | because we may have to recover it because of inappropriate byte |
| 1505 | combining. */ | 1505 | combining. */ |
| 1506 | if (! EQ (current_buffer->undo_list, Qt)) | 1506 | if (! EQ (B_ (current_buffer, undo_list), Qt)) |
| 1507 | deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); | 1507 | deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); |
| 1508 | 1508 | ||
| 1509 | GAP_SIZE += nbytes_del; | 1509 | GAP_SIZE += nbytes_del; |
| @@ -1530,7 +1530,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new, | |||
| 1530 | between single-byte and multibyte. */ | 1530 | between single-byte and multibyte. */ |
| 1531 | copy_text (SDATA (new), GPT_ADDR, insbytes, | 1531 | copy_text (SDATA (new), GPT_ADDR, insbytes, |
| 1532 | STRING_MULTIBYTE (new), | 1532 | STRING_MULTIBYTE (new), |
| 1533 | ! NILP (current_buffer->enable_multibyte_characters)); | 1533 | ! NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 1534 | 1534 | ||
| 1535 | #ifdef BYTE_COMBINING_DEBUG | 1535 | #ifdef BYTE_COMBINING_DEBUG |
| 1536 | /* We have copied text into the gap, but we have not marked | 1536 | /* We have copied text into the gap, but we have not marked |
| @@ -1543,7 +1543,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new, | |||
| 1543 | abort (); | 1543 | abort (); |
| 1544 | #endif | 1544 | #endif |
| 1545 | 1545 | ||
| 1546 | if (! EQ (current_buffer->undo_list, Qt)) | 1546 | if (! EQ (B_ (current_buffer, undo_list), Qt)) |
| 1547 | { | 1547 | { |
| 1548 | /* Record the insertion first, so that when we undo, | 1548 | /* Record the insertion first, so that when we undo, |
| 1549 | the deletion will be undone first. Thus, undo | 1549 | the deletion will be undone first. Thus, undo |
| @@ -1886,7 +1886,7 @@ del_range_2 (EMACS_INT from, EMACS_INT from_byte, | |||
| 1886 | abort (); | 1886 | abort (); |
| 1887 | #endif | 1887 | #endif |
| 1888 | 1888 | ||
| 1889 | if (ret_string || ! EQ (current_buffer->undo_list, Qt)) | 1889 | if (ret_string || ! EQ (B_ (current_buffer, undo_list), Qt)) |
| 1890 | deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); | 1890 | deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); |
| 1891 | else | 1891 | else |
| 1892 | deletion = Qnil; | 1892 | deletion = Qnil; |
| @@ -1897,7 +1897,7 @@ del_range_2 (EMACS_INT from, EMACS_INT from_byte, | |||
| 1897 | so that undo handles this after reinserting the text. */ | 1897 | so that undo handles this after reinserting the text. */ |
| 1898 | adjust_markers_for_delete (from, from_byte, to, to_byte); | 1898 | adjust_markers_for_delete (from, from_byte, to, to_byte); |
| 1899 | 1899 | ||
| 1900 | if (! EQ (current_buffer->undo_list, Qt)) | 1900 | if (! EQ (B_ (current_buffer, undo_list), Qt)) |
| 1901 | record_delete (from, deletion); | 1901 | record_delete (from, deletion); |
| 1902 | MODIFF++; | 1902 | MODIFF++; |
| 1903 | CHARS_MODIFF = MODIFF; | 1903 | CHARS_MODIFF = MODIFF; |
| @@ -1968,7 +1968,7 @@ modify_region (struct buffer *buffer, EMACS_INT start, EMACS_INT end, | |||
| 1968 | if (! preserve_chars_modiff) | 1968 | if (! preserve_chars_modiff) |
| 1969 | CHARS_MODIFF = MODIFF; | 1969 | CHARS_MODIFF = MODIFF; |
| 1970 | 1970 | ||
| 1971 | buffer->point_before_scroll = Qnil; | 1971 | B_ (buffer, point_before_scroll) = Qnil; |
| 1972 | 1972 | ||
| 1973 | if (buffer != old_buffer) | 1973 | if (buffer != old_buffer) |
| 1974 | set_buffer_internal (old_buffer); | 1974 | set_buffer_internal (old_buffer); |
| @@ -1990,7 +1990,7 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end, | |||
| 1990 | { | 1990 | { |
| 1991 | struct buffer *base_buffer; | 1991 | struct buffer *base_buffer; |
| 1992 | 1992 | ||
| 1993 | if (!NILP (current_buffer->read_only)) | 1993 | if (!NILP (B_ (current_buffer, read_only))) |
| 1994 | Fbarf_if_buffer_read_only (); | 1994 | Fbarf_if_buffer_read_only (); |
| 1995 | 1995 | ||
| 1996 | /* Let redisplay consider other windows than selected_window | 1996 | /* Let redisplay consider other windows than selected_window |
| @@ -2022,11 +2022,11 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end, | |||
| 2022 | base_buffer = current_buffer; | 2022 | base_buffer = current_buffer; |
| 2023 | 2023 | ||
| 2024 | #ifdef CLASH_DETECTION | 2024 | #ifdef CLASH_DETECTION |
| 2025 | if (!NILP (base_buffer->file_truename) | 2025 | if (!NILP (B_ (base_buffer, file_truename)) |
| 2026 | /* Make binding buffer-file-name to nil effective. */ | 2026 | /* Make binding buffer-file-name to nil effective. */ |
| 2027 | && !NILP (base_buffer->filename) | 2027 | && !NILP (B_ (base_buffer, filename)) |
| 2028 | && SAVE_MODIFF >= MODIFF) | 2028 | && SAVE_MODIFF >= MODIFF) |
| 2029 | lock_file (base_buffer->file_truename); | 2029 | lock_file (B_ (base_buffer, file_truename)); |
| 2030 | #else | 2030 | #else |
| 2031 | /* At least warn if this file has changed on disk since it was visited. */ | 2031 | /* At least warn if this file has changed on disk since it was visited. */ |
| 2032 | if (!NILP (base_buffer->filename) | 2032 | if (!NILP (base_buffer->filename) |
| @@ -2038,16 +2038,16 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end, | |||
| 2038 | #endif /* not CLASH_DETECTION */ | 2038 | #endif /* not CLASH_DETECTION */ |
| 2039 | 2039 | ||
| 2040 | /* If `select-active-regions' is non-nil, save the region text. */ | 2040 | /* If `select-active-regions' is non-nil, save the region text. */ |
| 2041 | if (!NILP (current_buffer->mark_active) | 2041 | if (!NILP (B_ (current_buffer, mark_active)) |
| 2042 | && !inhibit_modification_hooks | 2042 | && !inhibit_modification_hooks |
| 2043 | && XMARKER (current_buffer->mark)->buffer | 2043 | && XMARKER (B_ (current_buffer, mark))->buffer |
| 2044 | && NILP (Vsaved_region_selection) | 2044 | && NILP (Vsaved_region_selection) |
| 2045 | && (EQ (Vselect_active_regions, Qonly) | 2045 | && (EQ (Vselect_active_regions, Qonly) |
| 2046 | ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) | 2046 | ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) |
| 2047 | : (!NILP (Vselect_active_regions) | 2047 | : (!NILP (Vselect_active_regions) |
| 2048 | && !NILP (Vtransient_mark_mode)))) | 2048 | && !NILP (Vtransient_mark_mode)))) |
| 2049 | { | 2049 | { |
| 2050 | EMACS_INT b = XMARKER (current_buffer->mark)->charpos; | 2050 | EMACS_INT b = XMARKER (B_ (current_buffer, mark))->charpos; |
| 2051 | EMACS_INT e = PT; | 2051 | EMACS_INT e = PT; |
| 2052 | if (b < e) | 2052 | if (b < e) |
| 2053 | Vsaved_region_selection = make_buffer_string (b, e, 0); | 2053 | Vsaved_region_selection = make_buffer_string (b, e, 0); |
| @@ -2290,7 +2290,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute, | |||
| 2290 | non-nil, and insertion calls a file handler (e.g. through | 2290 | non-nil, and insertion calls a file handler (e.g. through |
| 2291 | lock_file) which scribbles into a temp file -- cyd */ | 2291 | lock_file) which scribbles into a temp file -- cyd */ |
| 2292 | if (!BUFFERP (combine_after_change_buffer) | 2292 | if (!BUFFERP (combine_after_change_buffer) |
| 2293 | || NILP (XBUFFER (combine_after_change_buffer)->name)) | 2293 | || NILP (B_ (XBUFFER (combine_after_change_buffer), name))) |
| 2294 | { | 2294 | { |
| 2295 | combine_after_change_list = Qnil; | 2295 | combine_after_change_list = Qnil; |
| 2296 | return Qnil; | 2296 | return Qnil; |
diff --git a/src/intervals.c b/src/intervals.c index ad46c17d588..de5faf6ce75 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -1978,7 +1978,7 @@ set_point_both (EMACS_INT charpos, EMACS_INT bytepos) | |||
| 1978 | int have_overlays; | 1978 | int have_overlays; |
| 1979 | EMACS_INT original_position; | 1979 | EMACS_INT original_position; |
| 1980 | 1980 | ||
| 1981 | current_buffer->point_before_scroll = Qnil; | 1981 | B_ (current_buffer, point_before_scroll) = Qnil; |
| 1982 | 1982 | ||
| 1983 | if (charpos == PT) | 1983 | if (charpos == PT) |
| 1984 | return; | 1984 | return; |
| @@ -2342,7 +2342,7 @@ get_local_map (register EMACS_INT position, register struct buffer *buffer, | |||
| 2342 | if (EQ (type, Qkeymap)) | 2342 | if (EQ (type, Qkeymap)) |
| 2343 | return Qnil; | 2343 | return Qnil; |
| 2344 | else | 2344 | else |
| 2345 | return buffer->keymap; | 2345 | return B_ (buffer, keymap); |
| 2346 | } | 2346 | } |
| 2347 | 2347 | ||
| 2348 | /* Produce an interval tree reflecting the intervals in | 2348 | /* Produce an interval tree reflecting the intervals in |
diff --git a/src/intervals.h b/src/intervals.h index 0762c9d8dc3..3c46c50db79 100644 --- a/src/intervals.h +++ b/src/intervals.h | |||
| @@ -236,9 +236,9 @@ struct interval | |||
| 236 | and 2 if it is invisible but with an ellipsis. */ | 236 | and 2 if it is invisible but with an ellipsis. */ |
| 237 | 237 | ||
| 238 | #define TEXT_PROP_MEANS_INVISIBLE(prop) \ | 238 | #define TEXT_PROP_MEANS_INVISIBLE(prop) \ |
| 239 | (EQ (current_buffer->invisibility_spec, Qt) \ | 239 | (EQ (B_ (current_buffer, invisibility_spec), Qt) \ |
| 240 | ? !NILP (prop) \ | 240 | ? !NILP (prop) \ |
| 241 | : invisible_p (prop, current_buffer->invisibility_spec)) | 241 | : invisible_p (prop, B_ (current_buffer, invisibility_spec))) |
| 242 | 242 | ||
| 243 | /* Declared in alloc.c */ | 243 | /* Declared in alloc.c */ |
| 244 | 244 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index 71d6456e57c..339d32a838a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1577,7 +1577,7 @@ command_loop_1 (void) | |||
| 1577 | this_single_command_key_start = 0; | 1577 | this_single_command_key_start = 0; |
| 1578 | } | 1578 | } |
| 1579 | 1579 | ||
| 1580 | if (!NILP (current_buffer->mark_active) | 1580 | if (!NILP (B_ (current_buffer, mark_active)) |
| 1581 | && !NILP (Vrun_hooks)) | 1581 | && !NILP (Vrun_hooks)) |
| 1582 | { | 1582 | { |
| 1583 | /* In Emacs 22, setting transient-mark-mode to `only' was a | 1583 | /* In Emacs 22, setting transient-mark-mode to `only' was a |
| @@ -1599,7 +1599,7 @@ command_loop_1 (void) | |||
| 1599 | if (!NILP (Fwindow_system (Qnil)) | 1599 | if (!NILP (Fwindow_system (Qnil)) |
| 1600 | /* Even if mark_active is non-nil, the actual buffer | 1600 | /* Even if mark_active is non-nil, the actual buffer |
| 1601 | marker may not have been set yet (Bug#7044). */ | 1601 | marker may not have been set yet (Bug#7044). */ |
| 1602 | && XMARKER (current_buffer->mark)->buffer | 1602 | && XMARKER (B_ (current_buffer, mark))->buffer |
| 1603 | && (EQ (Vselect_active_regions, Qonly) | 1603 | && (EQ (Vselect_active_regions, Qonly) |
| 1604 | ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) | 1604 | ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) |
| 1605 | : (!NILP (Vselect_active_regions) | 1605 | : (!NILP (Vselect_active_regions) |
| @@ -1607,7 +1607,7 @@ command_loop_1 (void) | |||
| 1607 | && !EQ (Vthis_command, Qhandle_switch_frame)) | 1607 | && !EQ (Vthis_command, Qhandle_switch_frame)) |
| 1608 | { | 1608 | { |
| 1609 | EMACS_INT beg = | 1609 | EMACS_INT beg = |
| 1610 | XINT (Fmarker_position (current_buffer->mark)); | 1610 | XINT (Fmarker_position (B_ (current_buffer, mark))); |
| 1611 | EMACS_INT end = PT; | 1611 | EMACS_INT end = PT; |
| 1612 | if (beg < end) | 1612 | if (beg < end) |
| 1613 | call2 (Qx_set_selection, QPRIMARY, | 1613 | call2 (Qx_set_selection, QPRIMARY, |
| @@ -8608,7 +8608,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps) | |||
| 8608 | 8608 | ||
| 8609 | /* Prompt with that and read response. */ | 8609 | /* Prompt with that and read response. */ |
| 8610 | message2_nolog (menu, strlen (menu), | 8610 | message2_nolog (menu, strlen (menu), |
| 8611 | ! NILP (current_buffer->enable_multibyte_characters)); | 8611 | ! NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 8612 | 8612 | ||
| 8613 | /* Make believe its not a keyboard macro in case the help char | 8613 | /* Make believe its not a keyboard macro in case the help char |
| 8614 | is pressed. Help characters are not recorded because menu prompting | 8614 | is pressed. Help characters are not recorded because menu prompting |
| @@ -9870,7 +9870,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9870 | /* Treat uppercase keys as shifted. */ | 9870 | /* Treat uppercase keys as shifted. */ |
| 9871 | || (INTEGERP (key) | 9871 | || (INTEGERP (key) |
| 9872 | && (KEY_TO_CHAR (key) | 9872 | && (KEY_TO_CHAR (key) |
| 9873 | < XCHAR_TABLE (current_buffer->downcase_table)->size) | 9873 | < XCHAR_TABLE (B_ (current_buffer, downcase_table))->size) |
| 9874 | && UPPERCASEP (KEY_TO_CHAR (key)))) | 9874 | && UPPERCASEP (KEY_TO_CHAR (key)))) |
| 9875 | { | 9875 | { |
| 9876 | Lisp_Object new_key | 9876 | Lisp_Object new_key |
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. */) | |||
| 1883 | (Lisp_Object keys, Lisp_Object accept_default) | 1883 | (Lisp_Object keys, Lisp_Object accept_default) |
| 1884 | { | 1884 | { |
| 1885 | register Lisp_Object map; | 1885 | register Lisp_Object map; |
| 1886 | map = current_buffer->keymap; | 1886 | map = B_ (current_buffer, keymap); |
| 1887 | if (NILP (map)) | 1887 | if (NILP (map)) |
| 1888 | return Qnil; | 1888 | return Qnil; |
| 1889 | return Flookup_key (map, keys, accept_default); | 1889 | return Flookup_key (map, keys, accept_default); |
| @@ -1988,7 +1988,7 @@ If KEYMAP is nil, that means no local keymap. */) | |||
| 1988 | if (!NILP (keymap)) | 1988 | if (!NILP (keymap)) |
| 1989 | keymap = get_keymap (keymap, 1, 1); | 1989 | keymap = get_keymap (keymap, 1, 1); |
| 1990 | 1990 | ||
| 1991 | current_buffer->keymap = keymap; | 1991 | B_ (current_buffer, keymap) = keymap; |
| 1992 | 1992 | ||
| 1993 | return Qnil; | 1993 | return Qnil; |
| 1994 | } | 1994 | } |
| @@ -1998,7 +1998,7 @@ DEFUN ("current-local-map", Fcurrent_local_map, Scurrent_local_map, 0, 0, 0, | |||
| 1998 | Normally the local keymap is set by the major mode with `use-local-map'. */) | 1998 | Normally the local keymap is set by the major mode with `use-local-map'. */) |
| 1999 | (void) | 1999 | (void) |
| 2000 | { | 2000 | { |
| 2001 | return current_buffer->keymap; | 2001 | return B_ (current_buffer, keymap); |
| 2002 | } | 2002 | } |
| 2003 | 2003 | ||
| 2004 | DEFUN ("current-global-map", Fcurrent_global_map, Scurrent_global_map, 0, 0, 0, | 2004 | 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 | |||
| 2379 | *p++ = 'C'; | 2379 | *p++ = 'C'; |
| 2380 | } | 2380 | } |
| 2381 | else if (c < 128 | 2381 | else if (c < 128 |
| 2382 | || (NILP (current_buffer->enable_multibyte_characters) | 2382 | || (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 2383 | && SINGLE_BYTE_CHAR_P (c) | 2383 | && SINGLE_BYTE_CHAR_P (c) |
| 2384 | && !force_multibyte)) | 2384 | && !force_multibyte)) |
| 2385 | { | 2385 | { |
| @@ -2388,7 +2388,7 @@ push_key_description (register unsigned int c, register char *p, int force_multi | |||
| 2388 | else | 2388 | else |
| 2389 | { | 2389 | { |
| 2390 | /* Now we are sure that C is a valid character code. */ | 2390 | /* Now we are sure that C is a valid character code. */ |
| 2391 | if (NILP (current_buffer->enable_multibyte_characters) | 2391 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 2392 | && ! force_multibyte) | 2392 | && ! force_multibyte) |
| 2393 | *p++ = multibyte_char_to_unibyte (c, Qnil); | 2393 | *p++ = multibyte_char_to_unibyte (c, Qnil); |
| 2394 | else | 2394 | else |
| @@ -3048,7 +3048,7 @@ You type Translation\n\ | |||
| 3048 | XBUFFER (buffer), Qlocal_map); | 3048 | XBUFFER (buffer), Qlocal_map); |
| 3049 | if (!NILP (start1)) | 3049 | if (!NILP (start1)) |
| 3050 | { | 3050 | { |
| 3051 | if (EQ (start1, XBUFFER (buffer)->keymap)) | 3051 | if (EQ (start1, B_ (XBUFFER (buffer), keymap))) |
| 3052 | describe_map_tree (start1, 1, shadow, prefix, | 3052 | describe_map_tree (start1, 1, shadow, prefix, |
| 3053 | "\f\nMajor Mode Bindings", nomenu, 0, 0, 0); | 3053 | "\f\nMajor Mode Bindings", nomenu, 0, 0, 0); |
| 3054 | else | 3054 | else |
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); | |||
| 1882 | #define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \ | 1882 | #define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \ |
| 1883 | do { \ | 1883 | do { \ |
| 1884 | static struct Lisp_Objfwd o_fwd; \ | 1884 | static struct Lisp_Objfwd o_fwd; \ |
| 1885 | defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname); \ | 1885 | defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname ## _); \ |
| 1886 | } while (0) | 1886 | } while (0) |
| 1887 | 1887 | ||
| 1888 | #define DEFVAR_KBOARD(lname, vname, doc) \ | 1888 | #define DEFVAR_KBOARD(lname, vname, doc) \ |
| @@ -2047,11 +2047,11 @@ extern Lisp_Object case_temp2; | |||
| 2047 | 2047 | ||
| 2048 | /* Current buffer's map from characters to lower-case characters. */ | 2048 | /* Current buffer's map from characters to lower-case characters. */ |
| 2049 | 2049 | ||
| 2050 | #define DOWNCASE_TABLE current_buffer->downcase_table | 2050 | #define DOWNCASE_TABLE B_ (current_buffer, downcase_table) |
| 2051 | 2051 | ||
| 2052 | /* Current buffer's map from characters to upper-case characters. */ | 2052 | /* Current buffer's map from characters to upper-case characters. */ |
| 2053 | 2053 | ||
| 2054 | #define UPCASE_TABLE current_buffer->upcase_table | 2054 | #define UPCASE_TABLE B_ (current_buffer, upcase_table) |
| 2055 | 2055 | ||
| 2056 | /* Downcase a character, or make no change if that cannot be done. */ | 2056 | /* Downcase a character, or make no change if that cannot be done. */ |
| 2057 | 2057 | ||
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) | |||
| 210 | if (pt_byte >= BUF_ZV_BYTE (inbuffer)) | 210 | if (pt_byte >= BUF_ZV_BYTE (inbuffer)) |
| 211 | return -1; | 211 | return -1; |
| 212 | 212 | ||
| 213 | if (! NILP (inbuffer->enable_multibyte_characters)) | 213 | if (! NILP (B_ (inbuffer, enable_multibyte_characters))) |
| 214 | { | 214 | { |
| 215 | /* Fetch the character code from the buffer. */ | 215 | /* Fetch the character code from the buffer. */ |
| 216 | unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, pt_byte); | 216 | unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, pt_byte); |
| @@ -239,7 +239,7 @@ readchar (Lisp_Object readcharfun, int *multibyte) | |||
| 239 | if (bytepos >= BUF_ZV_BYTE (inbuffer)) | 239 | if (bytepos >= BUF_ZV_BYTE (inbuffer)) |
| 240 | return -1; | 240 | return -1; |
| 241 | 241 | ||
| 242 | if (! NILP (inbuffer->enable_multibyte_characters)) | 242 | if (! NILP (B_ (inbuffer, enable_multibyte_characters))) |
| 243 | { | 243 | { |
| 244 | /* Fetch the character code from the buffer. */ | 244 | /* Fetch the character code from the buffer. */ |
| 245 | unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, bytepos); | 245 | unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, bytepos); |
| @@ -371,7 +371,7 @@ unreadchar (Lisp_Object readcharfun, int c) | |||
| 371 | EMACS_INT bytepos = BUF_PT_BYTE (b); | 371 | EMACS_INT bytepos = BUF_PT_BYTE (b); |
| 372 | 372 | ||
| 373 | BUF_PT (b)--; | 373 | BUF_PT (b)--; |
| 374 | if (! NILP (b->enable_multibyte_characters)) | 374 | if (! NILP (B_ (b, enable_multibyte_characters))) |
| 375 | BUF_DEC_POS (b, bytepos); | 375 | BUF_DEC_POS (b, bytepos); |
| 376 | else | 376 | else |
| 377 | bytepos--; | 377 | bytepos--; |
| @@ -384,7 +384,7 @@ unreadchar (Lisp_Object readcharfun, int c) | |||
| 384 | EMACS_INT bytepos = XMARKER (readcharfun)->bytepos; | 384 | EMACS_INT bytepos = XMARKER (readcharfun)->bytepos; |
| 385 | 385 | ||
| 386 | XMARKER (readcharfun)->charpos--; | 386 | XMARKER (readcharfun)->charpos--; |
| 387 | if (! NILP (b->enable_multibyte_characters)) | 387 | if (! NILP (B_ (b, enable_multibyte_characters))) |
| 388 | BUF_DEC_POS (b, bytepos); | 388 | BUF_DEC_POS (b, bytepos); |
| 389 | else | 389 | else |
| 390 | bytepos--; | 390 | bytepos--; |
| @@ -1322,7 +1322,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto | |||
| 1322 | /* Of course, this could conceivably lose if luser sets | 1322 | /* Of course, this could conceivably lose if luser sets |
| 1323 | default-directory to be something non-absolute... */ | 1323 | default-directory to be something non-absolute... */ |
| 1324 | { | 1324 | { |
| 1325 | filename = Fexpand_file_name (filename, current_buffer->directory); | 1325 | filename = Fexpand_file_name (filename, B_ (current_buffer, directory)); |
| 1326 | if (!complete_filename_p (filename)) | 1326 | if (!complete_filename_p (filename)) |
| 1327 | /* Give up on this path element! */ | 1327 | /* Give up on this path element! */ |
| 1328 | continue; | 1328 | continue; |
| @@ -1581,7 +1581,7 @@ readevalloop (Lisp_Object readcharfun, | |||
| 1581 | { | 1581 | { |
| 1582 | int count1 = SPECPDL_INDEX (); | 1582 | int count1 = SPECPDL_INDEX (); |
| 1583 | 1583 | ||
| 1584 | if (b != 0 && NILP (b->name)) | 1584 | if (b != 0 && NILP (B_ (b, name))) |
| 1585 | error ("Reading from killed buffer"); | 1585 | error ("Reading from killed buffer"); |
| 1586 | 1586 | ||
| 1587 | if (!NILP (start)) | 1587 | if (!NILP (start)) |
| @@ -1721,7 +1721,7 @@ This function preserves the position of point. */) | |||
| 1721 | tem = printflag; | 1721 | tem = printflag; |
| 1722 | 1722 | ||
| 1723 | if (NILP (filename)) | 1723 | if (NILP (filename)) |
| 1724 | filename = XBUFFER (buf)->filename; | 1724 | filename = B_ (XBUFFER (buf), filename); |
| 1725 | 1725 | ||
| 1726 | specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); | 1726 | specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); |
| 1727 | specbind (Qstandard_output, tem); | 1727 | specbind (Qstandard_output, tem); |
| @@ -1761,7 +1761,7 @@ This function does not move point. */) | |||
| 1761 | specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list)); | 1761 | specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list)); |
| 1762 | 1762 | ||
| 1763 | /* readevalloop calls functions which check the type of start and end. */ | 1763 | /* readevalloop calls functions which check the type of start and end. */ |
| 1764 | readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval, | 1764 | readevalloop (cbuf, 0, B_ (XBUFFER (cbuf), filename), Feval, |
| 1765 | !NILP (printflag), Qnil, read_function, | 1765 | !NILP (printflag), Qnil, read_function, |
| 1766 | start, end); | 1766 | start, end); |
| 1767 | 1767 | ||
diff --git a/src/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. */) | |||
| 439 | does not preserve the buffer from being GC'd (it's weak), so | 439 | does not preserve the buffer from being GC'd (it's weak), so |
| 440 | markers have to be unlinked from their buffer as soon as the buffer | 440 | markers have to be unlinked from their buffer as soon as the buffer |
| 441 | is killed. */ | 441 | is killed. */ |
| 442 | eassert (!NILP (XBUFFER (buf)->name)); | 442 | eassert (!NILP (B_ (XBUFFER (buf), name))); |
| 443 | return buf; | 443 | return buf; |
| 444 | } | 444 | } |
| 445 | return Qnil; | 445 | return Qnil; |
| @@ -488,7 +488,7 @@ Returns MARKER. */) | |||
| 488 | CHECK_BUFFER (buffer); | 488 | CHECK_BUFFER (buffer); |
| 489 | b = XBUFFER (buffer); | 489 | b = XBUFFER (buffer); |
| 490 | /* If buffer is dead, set marker to point nowhere. */ | 490 | /* If buffer is dead, set marker to point nowhere. */ |
| 491 | if (EQ (b->name, Qnil)) | 491 | if (EQ (B_ (b, name), Qnil)) |
| 492 | { | 492 | { |
| 493 | unchain_marker (m); | 493 | unchain_marker (m); |
| 494 | return marker; | 494 | return marker; |
| @@ -563,7 +563,7 @@ set_marker_restricted (Lisp_Object marker, Lisp_Object pos, Lisp_Object buffer) | |||
| 563 | CHECK_BUFFER (buffer); | 563 | CHECK_BUFFER (buffer); |
| 564 | b = XBUFFER (buffer); | 564 | b = XBUFFER (buffer); |
| 565 | /* If buffer is dead, set marker to point nowhere. */ | 565 | /* If buffer is dead, set marker to point nowhere. */ |
| 566 | if (EQ (b->name, Qnil)) | 566 | if (EQ (B_ (b, name), Qnil)) |
| 567 | { | 567 | { |
| 568 | unchain_marker (m); | 568 | unchain_marker (m); |
| 569 | return marker; | 569 | return marker; |
| @@ -628,7 +628,7 @@ set_marker_both (Lisp_Object marker, Lisp_Object buffer, EMACS_INT charpos, EMAC | |||
| 628 | CHECK_BUFFER (buffer); | 628 | CHECK_BUFFER (buffer); |
| 629 | b = XBUFFER (buffer); | 629 | b = XBUFFER (buffer); |
| 630 | /* If buffer is dead, set marker to point nowhere. */ | 630 | /* If buffer is dead, set marker to point nowhere. */ |
| 631 | if (EQ (b->name, Qnil)) | 631 | if (EQ (B_ (b, name), Qnil)) |
| 632 | { | 632 | { |
| 633 | unchain_marker (m); | 633 | unchain_marker (m); |
| 634 | return marker; | 634 | return marker; |
| @@ -676,7 +676,7 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, EMACS_INT ch | |||
| 676 | CHECK_BUFFER (buffer); | 676 | CHECK_BUFFER (buffer); |
| 677 | b = XBUFFER (buffer); | 677 | b = XBUFFER (buffer); |
| 678 | /* If buffer is dead, set marker to point nowhere. */ | 678 | /* If buffer is dead, set marker to point nowhere. */ |
| 679 | if (EQ (b->name, Qnil)) | 679 | if (EQ (B_ (b, name), Qnil)) |
| 680 | { | 680 | { |
| 681 | unchain_marker (m); | 681 | unchain_marker (m); |
| 682 | return marker; | 682 | return marker; |
| @@ -731,7 +731,7 @@ unchain_marker (register struct Lisp_Marker *marker) | |||
| 731 | if (b == 0) | 731 | if (b == 0) |
| 732 | return; | 732 | return; |
| 733 | 733 | ||
| 734 | if (EQ (b->name, Qnil)) | 734 | if (EQ (B_ (b, name), Qnil)) |
| 735 | abort (); | 735 | abort (); |
| 736 | 736 | ||
| 737 | marker->buffer = 0; | 737 | marker->buffer = 0; |
diff --git a/src/minibuf.c b/src/minibuf.c index 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, | |||
| 415 | CHECK_STRING (initial); | 415 | CHECK_STRING (initial); |
| 416 | } | 416 | } |
| 417 | val = Qnil; | 417 | val = Qnil; |
| 418 | ambient_dir = current_buffer->directory; | 418 | ambient_dir = B_ (current_buffer, directory); |
| 419 | input_method = Qnil; | 419 | input_method = Qnil; |
| 420 | enable_multibyte = Qnil; | 420 | enable_multibyte = Qnil; |
| 421 | 421 | ||
| @@ -525,7 +525,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 525 | /* `current-input-method' is buffer local. So, remember it in | 525 | /* `current-input-method' is buffer local. So, remember it in |
| 526 | INPUT_METHOD before changing the current buffer. */ | 526 | INPUT_METHOD before changing the current buffer. */ |
| 527 | input_method = Fsymbol_value (Qcurrent_input_method); | 527 | input_method = Fsymbol_value (Qcurrent_input_method); |
| 528 | enable_multibyte = current_buffer->enable_multibyte_characters; | 528 | enable_multibyte = B_ (current_buffer, enable_multibyte_characters); |
| 529 | } | 529 | } |
| 530 | 530 | ||
| 531 | /* Switch to the minibuffer. */ | 531 | /* Switch to the minibuffer. */ |
| @@ -535,7 +535,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 535 | 535 | ||
| 536 | /* If appropriate, copy enable-multibyte-characters into the minibuffer. */ | 536 | /* If appropriate, copy enable-multibyte-characters into the minibuffer. */ |
| 537 | if (inherit_input_method) | 537 | if (inherit_input_method) |
| 538 | current_buffer->enable_multibyte_characters = enable_multibyte; | 538 | B_ (current_buffer, enable_multibyte_characters) = enable_multibyte; |
| 539 | 539 | ||
| 540 | /* The current buffer's default directory is usually the right thing | 540 | /* The current buffer's default directory is usually the right thing |
| 541 | for our minibuffer here. However, if you're typing a command at | 541 | for our minibuffer here. However, if you're typing a command at |
| @@ -546,7 +546,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 546 | you think of something better to do? Find another buffer with a | 546 | you think of something better to do? Find another buffer with a |
| 547 | better directory, and use that one instead. */ | 547 | better directory, and use that one instead. */ |
| 548 | if (STRINGP (ambient_dir)) | 548 | if (STRINGP (ambient_dir)) |
| 549 | current_buffer->directory = ambient_dir; | 549 | B_ (current_buffer, directory) = ambient_dir; |
| 550 | else | 550 | else |
| 551 | { | 551 | { |
| 552 | Lisp_Object buf_list; | 552 | Lisp_Object buf_list; |
| @@ -558,9 +558,9 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 558 | Lisp_Object other_buf; | 558 | Lisp_Object other_buf; |
| 559 | 559 | ||
| 560 | other_buf = XCDR (XCAR (buf_list)); | 560 | other_buf = XCDR (XCAR (buf_list)); |
| 561 | if (STRINGP (XBUFFER (other_buf)->directory)) | 561 | if (STRINGP (B_ (XBUFFER (other_buf), directory))) |
| 562 | { | 562 | { |
| 563 | current_buffer->directory = XBUFFER (other_buf)->directory; | 563 | B_ (current_buffer, directory) = B_ (XBUFFER (other_buf), directory); |
| 564 | break; | 564 | break; |
| 565 | } | 565 | } |
| 566 | } | 566 | } |
| @@ -603,7 +603,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 603 | specbind (Qinhibit_modification_hooks, Qt); | 603 | specbind (Qinhibit_modification_hooks, Qt); |
| 604 | Ferase_buffer (); | 604 | Ferase_buffer (); |
| 605 | 605 | ||
| 606 | if (!NILP (current_buffer->enable_multibyte_characters) | 606 | if (!NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 607 | && ! STRING_MULTIBYTE (minibuf_prompt)) | 607 | && ! STRING_MULTIBYTE (minibuf_prompt)) |
| 608 | minibuf_prompt = Fstring_make_multibyte (minibuf_prompt); | 608 | minibuf_prompt = Fstring_make_multibyte (minibuf_prompt); |
| 609 | 609 | ||
| @@ -633,7 +633,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 633 | } | 633 | } |
| 634 | 634 | ||
| 635 | clear_message (1, 1); | 635 | clear_message (1, 1); |
| 636 | current_buffer->keymap = map; | 636 | B_ (current_buffer, keymap) = map; |
| 637 | 637 | ||
| 638 | /* Turn on an input method stored in INPUT_METHOD if any. */ | 638 | /* Turn on an input method stored in INPUT_METHOD if any. */ |
| 639 | if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method))) | 639 | if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method))) |
| @@ -647,7 +647,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 647 | call1 (Vrun_hooks, Qminibuffer_setup_hook); | 647 | call1 (Vrun_hooks, Qminibuffer_setup_hook); |
| 648 | 648 | ||
| 649 | /* Don't allow the user to undo past this point. */ | 649 | /* Don't allow the user to undo past this point. */ |
| 650 | current_buffer->undo_list = Qnil; | 650 | B_ (current_buffer, undo_list) = Qnil; |
| 651 | 651 | ||
| 652 | recursive_edit_1 (); | 652 | recursive_edit_1 (); |
| 653 | 653 | ||
| @@ -764,7 +764,7 @@ get_minibuffer (int depth) | |||
| 764 | Vminibuffer_list = nconc2 (Vminibuffer_list, tail); | 764 | Vminibuffer_list = nconc2 (Vminibuffer_list, tail); |
| 765 | } | 765 | } |
| 766 | buf = Fcar (tail); | 766 | buf = Fcar (tail); |
| 767 | if (NILP (buf) || NILP (XBUFFER (buf)->name)) | 767 | if (NILP (buf) || NILP (B_ (XBUFFER (buf), name))) |
| 768 | { | 768 | { |
| 769 | sprintf (name, " *Minibuf-%d*", depth); | 769 | sprintf (name, " *Minibuf-%d*", depth); |
| 770 | buf = Fget_buffer_create (build_string (name)); | 770 | buf = Fget_buffer_create (build_string (name)); |
| @@ -1096,7 +1096,7 @@ function, instead of the usual behavior. */) | |||
| 1096 | int count = SPECPDL_INDEX (); | 1096 | int count = SPECPDL_INDEX (); |
| 1097 | 1097 | ||
| 1098 | if (BUFFERP (def)) | 1098 | if (BUFFERP (def)) |
| 1099 | def = XBUFFER (def)->name; | 1099 | def = B_ (XBUFFER (def), name); |
| 1100 | 1100 | ||
| 1101 | specbind (Qcompletion_ignore_case, | 1101 | specbind (Qcompletion_ignore_case, |
| 1102 | read_buffer_completion_ignore_case ? Qt : Qnil); | 1102 | read_buffer_completion_ignore_case ? Qt : Qnil); |
diff --git a/src/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; | |||
| 111 | EMACS_INT old_point_byte = -1, start_point_byte = -1; \ | 111 | EMACS_INT old_point_byte = -1, start_point_byte = -1; \ |
| 112 | int specpdl_count = SPECPDL_INDEX (); \ | 112 | int specpdl_count = SPECPDL_INDEX (); \ |
| 113 | int free_print_buffer = 0; \ | 113 | int free_print_buffer = 0; \ |
| 114 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); \ | 114 | int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); \ |
| 115 | Lisp_Object original | 115 | Lisp_Object original |
| 116 | 116 | ||
| 117 | #define PRINTPREPARE \ | 117 | #define PRINTPREPARE \ |
| @@ -144,10 +144,10 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1; | |||
| 144 | if (NILP (printcharfun)) \ | 144 | if (NILP (printcharfun)) \ |
| 145 | { \ | 145 | { \ |
| 146 | Lisp_Object string; \ | 146 | Lisp_Object string; \ |
| 147 | if (NILP (current_buffer->enable_multibyte_characters) \ | 147 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) \ |
| 148 | && ! print_escape_multibyte) \ | 148 | && ! print_escape_multibyte) \ |
| 149 | specbind (Qprint_escape_multibyte, Qt); \ | 149 | specbind (Qprint_escape_multibyte, Qt); \ |
| 150 | if (! NILP (current_buffer->enable_multibyte_characters) \ | 150 | if (! NILP (B_ (current_buffer, enable_multibyte_characters)) \ |
| 151 | && ! print_escape_nonascii) \ | 151 | && ! print_escape_nonascii) \ |
| 152 | specbind (Qprint_escape_nonascii, Qt); \ | 152 | specbind (Qprint_escape_nonascii, Qt); \ |
| 153 | if (print_buffer != 0) \ | 153 | if (print_buffer != 0) \ |
| @@ -173,7 +173,7 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1; | |||
| 173 | if (NILP (printcharfun)) \ | 173 | if (NILP (printcharfun)) \ |
| 174 | { \ | 174 | { \ |
| 175 | if (print_buffer_pos != print_buffer_pos_byte \ | 175 | if (print_buffer_pos != print_buffer_pos_byte \ |
| 176 | && NILP (current_buffer->enable_multibyte_characters)) \ | 176 | && NILP (B_ (current_buffer, enable_multibyte_characters))) \ |
| 177 | { \ | 177 | { \ |
| 178 | unsigned char *temp \ | 178 | unsigned char *temp \ |
| 179 | = (unsigned char *) alloca (print_buffer_pos + 1); \ | 179 | = (unsigned char *) alloca (print_buffer_pos + 1); \ |
| @@ -250,7 +250,7 @@ printchar (unsigned int ch, Lisp_Object fun) | |||
| 250 | else | 250 | else |
| 251 | { | 251 | { |
| 252 | int multibyte_p | 252 | int multibyte_p |
| 253 | = !NILP (current_buffer->enable_multibyte_characters); | 253 | = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 254 | 254 | ||
| 255 | setup_echo_area_for_printing (multibyte_p); | 255 | setup_echo_area_for_printing (multibyte_p); |
| 256 | insert_char (ch); | 256 | insert_char (ch); |
| @@ -302,7 +302,7 @@ strout (const char *ptr, EMACS_INT size, EMACS_INT size_byte, | |||
| 302 | job. */ | 302 | job. */ |
| 303 | int i; | 303 | int i; |
| 304 | int multibyte_p | 304 | int multibyte_p |
| 305 | = !NILP (current_buffer->enable_multibyte_characters); | 305 | = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 306 | 306 | ||
| 307 | setup_echo_area_for_printing (multibyte_p); | 307 | setup_echo_area_for_printing (multibyte_p); |
| 308 | message_dolog (ptr, size_byte, 0, multibyte_p); | 308 | message_dolog (ptr, size_byte, 0, multibyte_p); |
| @@ -371,8 +371,8 @@ print_string (Lisp_Object string, Lisp_Object printcharfun) | |||
| 371 | chars = SCHARS (string); | 371 | chars = SCHARS (string); |
| 372 | else if (! print_escape_nonascii | 372 | else if (! print_escape_nonascii |
| 373 | && (EQ (printcharfun, Qt) | 373 | && (EQ (printcharfun, Qt) |
| 374 | ? ! NILP (buffer_defaults.enable_multibyte_characters) | 374 | ? ! NILP (B_ (&buffer_defaults, enable_multibyte_characters)) |
| 375 | : ! NILP (current_buffer->enable_multibyte_characters))) | 375 | : ! NILP (B_ (current_buffer, enable_multibyte_characters)))) |
| 376 | { | 376 | { |
| 377 | /* If unibyte string STRING contains 8-bit codes, we must | 377 | /* If unibyte string STRING contains 8-bit codes, we must |
| 378 | convert STRING to a multibyte string containing the same | 378 | convert STRING to a multibyte string containing the same |
| @@ -504,14 +504,14 @@ temp_output_buffer_setup (const char *bufname) | |||
| 504 | 504 | ||
| 505 | Fkill_all_local_variables (); | 505 | Fkill_all_local_variables (); |
| 506 | delete_all_overlays (current_buffer); | 506 | delete_all_overlays (current_buffer); |
| 507 | current_buffer->directory = old->directory; | 507 | B_ (current_buffer, directory) = B_ (old, directory); |
| 508 | current_buffer->read_only = Qnil; | 508 | B_ (current_buffer, read_only) = Qnil; |
| 509 | current_buffer->filename = Qnil; | 509 | B_ (current_buffer, filename) = Qnil; |
| 510 | current_buffer->undo_list = Qt; | 510 | B_ (current_buffer, undo_list) = Qt; |
| 511 | eassert (current_buffer->overlays_before == NULL); | 511 | eassert (current_buffer->overlays_before == NULL); |
| 512 | eassert (current_buffer->overlays_after == NULL); | 512 | eassert (current_buffer->overlays_after == NULL); |
| 513 | current_buffer->enable_multibyte_characters | 513 | B_ (current_buffer, enable_multibyte_characters) |
| 514 | = buffer_defaults.enable_multibyte_characters; | 514 | = B_ (&buffer_defaults, enable_multibyte_characters); |
| 515 | specbind (Qinhibit_read_only, Qt); | 515 | specbind (Qinhibit_read_only, Qt); |
| 516 | specbind (Qinhibit_modification_hooks, Qt); | 516 | specbind (Qinhibit_modification_hooks, Qt); |
| 517 | Ferase_buffer (); | 517 | Ferase_buffer (); |
| @@ -1854,7 +1854,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 1854 | if (!NILP (XWINDOW (obj)->buffer)) | 1854 | if (!NILP (XWINDOW (obj)->buffer)) |
| 1855 | { | 1855 | { |
| 1856 | strout (" on ", -1, -1, printcharfun, 0); | 1856 | strout (" on ", -1, -1, printcharfun, 0); |
| 1857 | print_string (XBUFFER (XWINDOW (obj)->buffer)->name, printcharfun); | 1857 | print_string (B_ (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun); |
| 1858 | } | 1858 | } |
| 1859 | PRINTCHAR ('>'); | 1859 | PRINTCHAR ('>'); |
| 1860 | } | 1860 | } |
| @@ -1955,16 +1955,16 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 1955 | } | 1955 | } |
| 1956 | else if (BUFFERP (obj)) | 1956 | else if (BUFFERP (obj)) |
| 1957 | { | 1957 | { |
| 1958 | if (NILP (XBUFFER (obj)->name)) | 1958 | if (NILP (B_ (XBUFFER (obj), name))) |
| 1959 | strout ("#<killed buffer>", -1, -1, printcharfun, 0); | 1959 | strout ("#<killed buffer>", -1, -1, printcharfun, 0); |
| 1960 | else if (escapeflag) | 1960 | else if (escapeflag) |
| 1961 | { | 1961 | { |
| 1962 | strout ("#<buffer ", -1, -1, printcharfun, 0); | 1962 | strout ("#<buffer ", -1, -1, printcharfun, 0); |
| 1963 | print_string (XBUFFER (obj)->name, printcharfun); | 1963 | print_string (B_ (XBUFFER (obj), name), printcharfun); |
| 1964 | PRINTCHAR ('>'); | 1964 | PRINTCHAR ('>'); |
| 1965 | } | 1965 | } |
| 1966 | else | 1966 | else |
| 1967 | print_string (XBUFFER (obj)->name, printcharfun); | 1967 | print_string (B_ (XBUFFER (obj), name), printcharfun); |
| 1968 | } | 1968 | } |
| 1969 | else if (WINDOW_CONFIGURATIONP (obj)) | 1969 | else if (WINDOW_CONFIGURATIONP (obj)) |
| 1970 | { | 1970 | { |
| @@ -2076,7 +2076,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 2076 | sprintf (buf, "at %ld", (long)marker_position (obj)); | 2076 | sprintf (buf, "at %ld", (long)marker_position (obj)); |
| 2077 | strout (buf, -1, -1, printcharfun, 0); | 2077 | strout (buf, -1, -1, printcharfun, 0); |
| 2078 | strout (" in ", -1, -1, printcharfun, 0); | 2078 | strout (" in ", -1, -1, printcharfun, 0); |
| 2079 | print_string (XMARKER (obj)->buffer->name, printcharfun); | 2079 | print_string (B_ (XMARKER (obj)->buffer, name), printcharfun); |
| 2080 | } | 2080 | } |
| 2081 | PRINTCHAR ('>'); | 2081 | PRINTCHAR ('>'); |
| 2082 | break; | 2082 | break; |
| @@ -2091,7 +2091,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 2091 | (long)marker_position (OVERLAY_START (obj)), | 2091 | (long)marker_position (OVERLAY_START (obj)), |
| 2092 | (long)marker_position (OVERLAY_END (obj))); | 2092 | (long)marker_position (OVERLAY_END (obj))); |
| 2093 | strout (buf, -1, -1, printcharfun, 0); | 2093 | strout (buf, -1, -1, printcharfun, 0); |
| 2094 | print_string (XMARKER (OVERLAY_START (obj))->buffer->name, | 2094 | print_string (B_ (XMARKER (OVERLAY_START (obj))->buffer, name), |
| 2095 | printcharfun); | 2095 | printcharfun); |
| 2096 | } | 2096 | } |
| 2097 | PRINTCHAR ('>'); | 2097 | 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) | |||
| 719 | { | 719 | { |
| 720 | proc = Fget_buffer_process (obj); | 720 | proc = Fget_buffer_process (obj); |
| 721 | if (NILP (proc)) | 721 | if (NILP (proc)) |
| 722 | error ("Buffer %s has no process", SDATA (XBUFFER (obj)->name)); | 722 | error ("Buffer %s has no process", SDATA (B_ (XBUFFER (obj), name))); |
| 723 | } | 723 | } |
| 724 | else | 724 | else |
| 725 | { | 725 | { |
| @@ -1283,12 +1283,12 @@ list_processes_1 (Lisp_Object query_only) | |||
| 1283 | w_proc = i; | 1283 | w_proc = i; |
| 1284 | if (!NILP (p->buffer)) | 1284 | if (!NILP (p->buffer)) |
| 1285 | { | 1285 | { |
| 1286 | if (NILP (XBUFFER (p->buffer)->name)) | 1286 | if (NILP (B_ (XBUFFER (p->buffer), name))) |
| 1287 | { | 1287 | { |
| 1288 | if (w_buffer < 8) | 1288 | if (w_buffer < 8) |
| 1289 | w_buffer = 8; /* (Killed) */ | 1289 | w_buffer = 8; /* (Killed) */ |
| 1290 | } | 1290 | } |
| 1291 | else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer))) | 1291 | else if ((i = SCHARS (B_ (XBUFFER (p->buffer), name)), (i > w_buffer))) |
| 1292 | w_buffer = i; | 1292 | w_buffer = i; |
| 1293 | } | 1293 | } |
| 1294 | if (STRINGP (p->tty_name) | 1294 | if (STRINGP (p->tty_name) |
| @@ -1312,9 +1312,9 @@ list_processes_1 (Lisp_Object query_only) | |||
| 1312 | XSETFASTINT (minspace, 1); | 1312 | XSETFASTINT (minspace, 1); |
| 1313 | 1313 | ||
| 1314 | set_buffer_internal (XBUFFER (Vstandard_output)); | 1314 | set_buffer_internal (XBUFFER (Vstandard_output)); |
| 1315 | current_buffer->undo_list = Qt; | 1315 | B_ (current_buffer, undo_list) = Qt; |
| 1316 | 1316 | ||
| 1317 | current_buffer->truncate_lines = Qt; | 1317 | B_ (current_buffer, truncate_lines) = Qt; |
| 1318 | 1318 | ||
| 1319 | write_string ("Proc", -1); | 1319 | write_string ("Proc", -1); |
| 1320 | Findent_to (i_status, minspace); write_string ("Status", -1); | 1320 | Findent_to (i_status, minspace); write_string ("Status", -1); |
| @@ -1397,10 +1397,10 @@ list_processes_1 (Lisp_Object query_only) | |||
| 1397 | Findent_to (i_buffer, minspace); | 1397 | Findent_to (i_buffer, minspace); |
| 1398 | if (NILP (p->buffer)) | 1398 | if (NILP (p->buffer)) |
| 1399 | insert_string ("(none)"); | 1399 | insert_string ("(none)"); |
| 1400 | else if (NILP (XBUFFER (p->buffer)->name)) | 1400 | else if (NILP (B_ (XBUFFER (p->buffer), name))) |
| 1401 | insert_string ("(Killed)"); | 1401 | insert_string ("(Killed)"); |
| 1402 | else | 1402 | else |
| 1403 | Finsert (1, &XBUFFER (p->buffer)->name); | 1403 | Finsert (1, &B_ (XBUFFER (p->buffer), name)); |
| 1404 | 1404 | ||
| 1405 | if (!NILP (i_tty)) | 1405 | if (!NILP (i_tty)) |
| 1406 | { | 1406 | { |
| @@ -1548,7 +1548,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1548 | { | 1548 | { |
| 1549 | struct gcpro gcpro1, gcpro2; | 1549 | struct gcpro gcpro1, gcpro2; |
| 1550 | 1550 | ||
| 1551 | current_dir = current_buffer->directory; | 1551 | current_dir = B_ (current_buffer, directory); |
| 1552 | 1552 | ||
| 1553 | GCPRO2 (buffer, current_dir); | 1553 | GCPRO2 (buffer, current_dir); |
| 1554 | 1554 | ||
| @@ -1560,7 +1560,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1560 | current_dir = expand_and_dir_to_file (current_dir, Qnil); | 1560 | current_dir = expand_and_dir_to_file (current_dir, Qnil); |
| 1561 | if (NILP (Ffile_accessible_directory_p (current_dir))) | 1561 | if (NILP (Ffile_accessible_directory_p (current_dir))) |
| 1562 | report_file_error ("Setting current directory", | 1562 | report_file_error ("Setting current directory", |
| 1563 | Fcons (current_buffer->directory, Qnil)); | 1563 | Fcons (B_ (current_buffer, directory), Qnil)); |
| 1564 | 1564 | ||
| 1565 | UNGCPRO; | 1565 | UNGCPRO; |
| 1566 | } | 1566 | } |
| @@ -2898,8 +2898,8 @@ usage: (make-serial-process &rest ARGS) */) | |||
| 2898 | } | 2898 | } |
| 2899 | else if (!NILP (Vcoding_system_for_read)) | 2899 | else if (!NILP (Vcoding_system_for_read)) |
| 2900 | val = Vcoding_system_for_read; | 2900 | val = Vcoding_system_for_read; |
| 2901 | else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)) | 2901 | else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) |
| 2902 | || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) | 2902 | || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) |
| 2903 | val = Qnil; | 2903 | val = Qnil; |
| 2904 | p->decode_coding_system = val; | 2904 | p->decode_coding_system = val; |
| 2905 | 2905 | ||
| @@ -2912,8 +2912,8 @@ usage: (make-serial-process &rest ARGS) */) | |||
| 2912 | } | 2912 | } |
| 2913 | else if (!NILP (Vcoding_system_for_write)) | 2913 | else if (!NILP (Vcoding_system_for_write)) |
| 2914 | val = Vcoding_system_for_write; | 2914 | val = Vcoding_system_for_write; |
| 2915 | else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)) | 2915 | else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) |
| 2916 | || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) | 2916 | || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) |
| 2917 | val = Qnil; | 2917 | val = Qnil; |
| 2918 | p->encode_coding_system = val; | 2918 | p->encode_coding_system = val; |
| 2919 | 2919 | ||
| @@ -3723,8 +3723,8 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3723 | } | 3723 | } |
| 3724 | else if (!NILP (Vcoding_system_for_read)) | 3724 | else if (!NILP (Vcoding_system_for_read)) |
| 3725 | val = Vcoding_system_for_read; | 3725 | val = Vcoding_system_for_read; |
| 3726 | else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)) | 3726 | else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) |
| 3727 | || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) | 3727 | || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) |
| 3728 | /* We dare not decode end-of-line format by setting VAL to | 3728 | /* We dare not decode end-of-line format by setting VAL to |
| 3729 | Qraw_text, because the existing Emacs Lisp libraries | 3729 | Qraw_text, because the existing Emacs Lisp libraries |
| 3730 | assume that they receive bare code including a sequene of | 3730 | assume that they receive bare code including a sequene of |
| @@ -3759,7 +3759,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3759 | } | 3759 | } |
| 3760 | else if (!NILP (Vcoding_system_for_write)) | 3760 | else if (!NILP (Vcoding_system_for_write)) |
| 3761 | val = Vcoding_system_for_write; | 3761 | val = Vcoding_system_for_write; |
| 3762 | else if (NILP (current_buffer->enable_multibyte_characters)) | 3762 | else if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 3763 | val = Qnil; | 3763 | val = Qnil; |
| 3764 | else | 3764 | else |
| 3765 | { | 3765 | { |
| @@ -5268,7 +5268,7 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5268 | /* No need to gcpro these, because all we do with them later | 5268 | /* No need to gcpro these, because all we do with them later |
| 5269 | is test them for EQness, and none of them should be a string. */ | 5269 | is test them for EQness, and none of them should be a string. */ |
| 5270 | XSETBUFFER (obuffer, current_buffer); | 5270 | XSETBUFFER (obuffer, current_buffer); |
| 5271 | okeymap = current_buffer->keymap; | 5271 | okeymap = B_ (current_buffer, keymap); |
| 5272 | 5272 | ||
| 5273 | /* We inhibit quit here instead of just catching it so that | 5273 | /* We inhibit quit here instead of just catching it so that |
| 5274 | hitting ^G when a filter happens to be running won't screw | 5274 | hitting ^G when a filter happens to be running won't screw |
| @@ -5359,7 +5359,7 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5359 | } | 5359 | } |
| 5360 | 5360 | ||
| 5361 | /* If no filter, write into buffer if it isn't dead. */ | 5361 | /* If no filter, write into buffer if it isn't dead. */ |
| 5362 | else if (!NILP (p->buffer) && !NILP (XBUFFER (p->buffer)->name)) | 5362 | else if (!NILP (p->buffer) && !NILP (B_ (XBUFFER (p->buffer), name))) |
| 5363 | { | 5363 | { |
| 5364 | Lisp_Object old_read_only; | 5364 | Lisp_Object old_read_only; |
| 5365 | EMACS_INT old_begv, old_zv; | 5365 | EMACS_INT old_begv, old_zv; |
| @@ -5372,13 +5372,13 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5372 | Fset_buffer (p->buffer); | 5372 | Fset_buffer (p->buffer); |
| 5373 | opoint = PT; | 5373 | opoint = PT; |
| 5374 | opoint_byte = PT_BYTE; | 5374 | opoint_byte = PT_BYTE; |
| 5375 | old_read_only = current_buffer->read_only; | 5375 | old_read_only = B_ (current_buffer, read_only); |
| 5376 | old_begv = BEGV; | 5376 | old_begv = BEGV; |
| 5377 | old_zv = ZV; | 5377 | old_zv = ZV; |
| 5378 | old_begv_byte = BEGV_BYTE; | 5378 | old_begv_byte = BEGV_BYTE; |
| 5379 | old_zv_byte = ZV_BYTE; | 5379 | old_zv_byte = ZV_BYTE; |
| 5380 | 5380 | ||
| 5381 | current_buffer->read_only = Qnil; | 5381 | B_ (current_buffer, read_only) = Qnil; |
| 5382 | 5382 | ||
| 5383 | /* Insert new output into buffer | 5383 | /* Insert new output into buffer |
| 5384 | at the current end-of-output marker, | 5384 | at the current end-of-output marker, |
| @@ -5423,7 +5423,7 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5423 | p->decoding_carryover = coding->carryover_bytes; | 5423 | p->decoding_carryover = coding->carryover_bytes; |
| 5424 | } | 5424 | } |
| 5425 | /* Adjust the multibyteness of TEXT to that of the buffer. */ | 5425 | /* Adjust the multibyteness of TEXT to that of the buffer. */ |
| 5426 | if (NILP (current_buffer->enable_multibyte_characters) | 5426 | if (NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 5427 | != ! STRING_MULTIBYTE (text)) | 5427 | != ! STRING_MULTIBYTE (text)) |
| 5428 | text = (STRING_MULTIBYTE (text) | 5428 | text = (STRING_MULTIBYTE (text) |
| 5429 | ? Fstring_as_unibyte (text) | 5429 | ? Fstring_as_unibyte (text) |
| @@ -5467,7 +5467,7 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5467 | Fnarrow_to_region (make_number (old_begv), make_number (old_zv)); | 5467 | Fnarrow_to_region (make_number (old_begv), make_number (old_zv)); |
| 5468 | 5468 | ||
| 5469 | 5469 | ||
| 5470 | current_buffer->read_only = old_read_only; | 5470 | B_ (current_buffer, read_only) = old_read_only; |
| 5471 | SET_PT_BOTH (opoint, opoint_byte); | 5471 | SET_PT_BOTH (opoint, opoint_byte); |
| 5472 | } | 5472 | } |
| 5473 | /* Handling the process output should not deactivate the mark. */ | 5473 | /* Handling the process output should not deactivate the mark. */ |
| @@ -5525,7 +5525,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, | |||
| 5525 | 5525 | ||
| 5526 | if ((STRINGP (object) && STRING_MULTIBYTE (object)) | 5526 | if ((STRINGP (object) && STRING_MULTIBYTE (object)) |
| 5527 | || (BUFFERP (object) | 5527 | || (BUFFERP (object) |
| 5528 | && !NILP (XBUFFER (object)->enable_multibyte_characters)) | 5528 | && !NILP (B_ (XBUFFER (object), enable_multibyte_characters))) |
| 5529 | || EQ (object, Qt)) | 5529 | || EQ (object, Qt)) |
| 5530 | { | 5530 | { |
| 5531 | p->encode_coding_system | 5531 | p->encode_coding_system |
| @@ -6564,7 +6564,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason) | |||
| 6564 | is test them for EQness, and none of them should be a string. */ | 6564 | is test them for EQness, and none of them should be a string. */ |
| 6565 | odeactivate = Vdeactivate_mark; | 6565 | odeactivate = Vdeactivate_mark; |
| 6566 | XSETBUFFER (obuffer, current_buffer); | 6566 | XSETBUFFER (obuffer, current_buffer); |
| 6567 | okeymap = current_buffer->keymap; | 6567 | okeymap = B_ (current_buffer, keymap); |
| 6568 | 6568 | ||
| 6569 | /* There's no good reason to let sentinels change the current | 6569 | /* There's no good reason to let sentinels change the current |
| 6570 | buffer, and many callers of accept-process-output, sit-for, and | 6570 | buffer, and many callers of accept-process-output, sit-for, and |
| @@ -6714,7 +6714,7 @@ status_notify (struct Lisp_Process *deleting_process) | |||
| 6714 | 6714 | ||
| 6715 | /* Avoid error if buffer is deleted | 6715 | /* Avoid error if buffer is deleted |
| 6716 | (probably that's why the process is dead, too) */ | 6716 | (probably that's why the process is dead, too) */ |
| 6717 | if (NILP (XBUFFER (buffer)->name)) | 6717 | if (NILP (B_ (XBUFFER (buffer), name))) |
| 6718 | continue; | 6718 | continue; |
| 6719 | Fset_buffer (buffer); | 6719 | Fset_buffer (buffer); |
| 6720 | 6720 | ||
| @@ -6731,13 +6731,13 @@ status_notify (struct Lisp_Process *deleting_process) | |||
| 6731 | before = PT; | 6731 | before = PT; |
| 6732 | before_byte = PT_BYTE; | 6732 | before_byte = PT_BYTE; |
| 6733 | 6733 | ||
| 6734 | tem = current_buffer->read_only; | 6734 | tem = B_ (current_buffer, read_only); |
| 6735 | current_buffer->read_only = Qnil; | 6735 | B_ (current_buffer, read_only) = Qnil; |
| 6736 | insert_string ("\nProcess "); | 6736 | insert_string ("\nProcess "); |
| 6737 | Finsert (1, &p->name); | 6737 | Finsert (1, &p->name); |
| 6738 | insert_string (" "); | 6738 | insert_string (" "); |
| 6739 | Finsert (1, &msg); | 6739 | Finsert (1, &msg); |
| 6740 | current_buffer->read_only = tem; | 6740 | B_ (current_buffer, read_only) = tem; |
| 6741 | set_marker_both (p->mark, p->buffer, PT, PT_BYTE); | 6741 | set_marker_both (p->mark, p->buffer, PT, PT_BYTE); |
| 6742 | 6742 | ||
| 6743 | if (opoint >= before) | 6743 | if (opoint >= before) |
| @@ -7136,7 +7136,7 @@ setup_process_coding_systems (Lisp_Object process) | |||
| 7136 | ; | 7136 | ; |
| 7137 | else if (BUFFERP (p->buffer)) | 7137 | else if (BUFFERP (p->buffer)) |
| 7138 | { | 7138 | { |
| 7139 | if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters)) | 7139 | if (NILP (B_ (XBUFFER (p->buffer), enable_multibyte_characters))) |
| 7140 | coding_system = raw_text_coding_system (coding_system); | 7140 | coding_system = raw_text_coding_system (coding_system); |
| 7141 | } | 7141 | } |
| 7142 | setup_coding_system (coding_system, proc_decode_coding_system[inch]); | 7142 | setup_coding_system (coding_system, proc_decode_coding_system[inch]); |
diff --git a/src/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 | |||
| 157 | 157 | ||
| 158 | /* If the compiled pattern hard codes some of the contents of the | 158 | /* If the compiled pattern hard codes some of the contents of the |
| 159 | syntax-table, it can only be reused with *this* syntax table. */ | 159 | syntax-table, it can only be reused with *this* syntax table. */ |
| 160 | cp->syntax_table = cp->buf.used_syntax ? current_buffer->syntax_table : Qt; | 160 | cp->syntax_table = cp->buf.used_syntax ? B_ (current_buffer, syntax_table) : Qt; |
| 161 | 161 | ||
| 162 | re_set_whitespace_regexp (NULL); | 162 | re_set_whitespace_regexp (NULL); |
| 163 | 163 | ||
| @@ -236,7 +236,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object tra | |||
| 236 | && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) | 236 | && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) |
| 237 | && cp->posix == posix | 237 | && cp->posix == posix |
| 238 | && (EQ (cp->syntax_table, Qt) | 238 | && (EQ (cp->syntax_table, Qt) |
| 239 | || EQ (cp->syntax_table, current_buffer->syntax_table)) | 239 | || EQ (cp->syntax_table, B_ (current_buffer, syntax_table))) |
| 240 | && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp)) | 240 | && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp)) |
| 241 | && cp->buf.charset_unibyte == charset_unibyte) | 241 | && cp->buf.charset_unibyte == charset_unibyte) |
| 242 | break; | 242 | break; |
| @@ -285,17 +285,17 @@ looking_at_1 (Lisp_Object string, int posix) | |||
| 285 | save_search_regs (); | 285 | save_search_regs (); |
| 286 | 286 | ||
| 287 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 287 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ |
| 288 | XCHAR_TABLE (current_buffer->case_canon_table)->extras[2] | 288 | XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] |
| 289 | = current_buffer->case_eqv_table; | 289 | = B_ (current_buffer, case_eqv_table); |
| 290 | 290 | ||
| 291 | CHECK_STRING (string); | 291 | CHECK_STRING (string); |
| 292 | bufp = compile_pattern (string, | 292 | bufp = compile_pattern (string, |
| 293 | (NILP (Vinhibit_changing_match_data) | 293 | (NILP (Vinhibit_changing_match_data) |
| 294 | ? &search_regs : NULL), | 294 | ? &search_regs : NULL), |
| 295 | (!NILP (current_buffer->case_fold_search) | 295 | (!NILP (B_ (current_buffer, case_fold_search)) |
| 296 | ? current_buffer->case_canon_table : Qnil), | 296 | ? B_ (current_buffer, case_canon_table) : Qnil), |
| 297 | posix, | 297 | posix, |
| 298 | !NILP (current_buffer->enable_multibyte_characters)); | 298 | !NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 299 | 299 | ||
| 300 | immediate_quit = 1; | 300 | immediate_quit = 1; |
| 301 | QUIT; /* Do a pending quit right away, to avoid paradoxical behavior */ | 301 | QUIT; /* Do a pending quit right away, to avoid paradoxical behavior */ |
| @@ -400,14 +400,14 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, int p | |||
| 400 | } | 400 | } |
| 401 | 401 | ||
| 402 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 402 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ |
| 403 | XCHAR_TABLE (current_buffer->case_canon_table)->extras[2] | 403 | XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] |
| 404 | = current_buffer->case_eqv_table; | 404 | = B_ (current_buffer, case_eqv_table); |
| 405 | 405 | ||
| 406 | bufp = compile_pattern (regexp, | 406 | bufp = compile_pattern (regexp, |
| 407 | (NILP (Vinhibit_changing_match_data) | 407 | (NILP (Vinhibit_changing_match_data) |
| 408 | ? &search_regs : NULL), | 408 | ? &search_regs : NULL), |
| 409 | (!NILP (current_buffer->case_fold_search) | 409 | (!NILP (B_ (current_buffer, case_fold_search)) |
| 410 | ? current_buffer->case_canon_table : Qnil), | 410 | ? B_ (current_buffer, case_canon_table) : Qnil), |
| 411 | posix, | 411 | posix, |
| 412 | STRING_MULTIBYTE (string)); | 412 | STRING_MULTIBYTE (string)); |
| 413 | immediate_quit = 1; | 413 | immediate_quit = 1; |
| @@ -586,7 +586,7 @@ fast_looking_at (Lisp_Object regexp, EMACS_INT pos, EMACS_INT pos_byte, EMACS_IN | |||
| 586 | s2 = 0; | 586 | s2 = 0; |
| 587 | } | 587 | } |
| 588 | re_match_object = Qnil; | 588 | re_match_object = Qnil; |
| 589 | multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 589 | multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 590 | } | 590 | } |
| 591 | 591 | ||
| 592 | buf = compile_pattern (regexp, 0, Qnil, 0, multibyte); | 592 | buf = compile_pattern (regexp, 0, Qnil, 0, multibyte); |
| @@ -608,7 +608,7 @@ fast_looking_at (Lisp_Object regexp, EMACS_INT pos, EMACS_INT pos_byte, EMACS_IN | |||
| 608 | static void | 608 | static void |
| 609 | newline_cache_on_off (struct buffer *buf) | 609 | newline_cache_on_off (struct buffer *buf) |
| 610 | { | 610 | { |
| 611 | if (NILP (buf->cache_long_line_scans)) | 611 | if (NILP (B_ (buf, cache_long_line_scans))) |
| 612 | { | 612 | { |
| 613 | /* It should be off. */ | 613 | /* It should be off. */ |
| 614 | if (buf->newline_cache) | 614 | if (buf->newline_cache) |
| @@ -996,15 +996,15 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, | |||
| 996 | } | 996 | } |
| 997 | 997 | ||
| 998 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 998 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ |
| 999 | XCHAR_TABLE (current_buffer->case_canon_table)->extras[2] | 999 | XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] |
| 1000 | = current_buffer->case_eqv_table; | 1000 | = B_ (current_buffer, case_eqv_table); |
| 1001 | 1001 | ||
| 1002 | np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE, | 1002 | np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE, |
| 1003 | (!NILP (current_buffer->case_fold_search) | 1003 | (!NILP (B_ (current_buffer, case_fold_search)) |
| 1004 | ? current_buffer->case_canon_table | 1004 | ? B_ (current_buffer, case_canon_table) |
| 1005 | : Qnil), | 1005 | : Qnil), |
| 1006 | (!NILP (current_buffer->case_fold_search) | 1006 | (!NILP (B_ (current_buffer, case_fold_search)) |
| 1007 | ? current_buffer->case_eqv_table | 1007 | ? B_ (current_buffer, case_eqv_table) |
| 1008 | : Qnil), | 1008 | : Qnil), |
| 1009 | posix); | 1009 | posix); |
| 1010 | if (np <= 0) | 1010 | if (np <= 0) |
| @@ -1133,7 +1133,7 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte, | |||
| 1133 | (NILP (Vinhibit_changing_match_data) | 1133 | (NILP (Vinhibit_changing_match_data) |
| 1134 | ? &search_regs : &search_regs_1), | 1134 | ? &search_regs : &search_regs_1), |
| 1135 | trt, posix, | 1135 | trt, posix, |
| 1136 | !NILP (current_buffer->enable_multibyte_characters)); | 1136 | !NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 1137 | 1137 | ||
| 1138 | immediate_quit = 1; /* Quit immediately if user types ^G, | 1138 | immediate_quit = 1; /* Quit immediately if user types ^G, |
| 1139 | because letting this function finish | 1139 | because letting this function finish |
| @@ -1254,7 +1254,7 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte, | |||
| 1254 | EMACS_INT raw_pattern_size; | 1254 | EMACS_INT raw_pattern_size; |
| 1255 | EMACS_INT raw_pattern_size_byte; | 1255 | EMACS_INT raw_pattern_size_byte; |
| 1256 | unsigned char *patbuf; | 1256 | unsigned char *patbuf; |
| 1257 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 1257 | int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 1258 | unsigned char *base_pat; | 1258 | unsigned char *base_pat; |
| 1259 | /* Set to positive if we find a non-ASCII char that need | 1259 | /* Set to positive if we find a non-ASCII char that need |
| 1260 | translation. Otherwise set to zero later. */ | 1260 | translation. Otherwise set to zero later. */ |
| @@ -1451,7 +1451,7 @@ simple_search (EMACS_INT n, unsigned char *pat, | |||
| 1451 | EMACS_INT pos, EMACS_INT pos_byte, | 1451 | EMACS_INT pos, EMACS_INT pos_byte, |
| 1452 | EMACS_INT lim, EMACS_INT lim_byte) | 1452 | EMACS_INT lim, EMACS_INT lim_byte) |
| 1453 | { | 1453 | { |
| 1454 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 1454 | int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 1455 | int forward = n > 0; | 1455 | int forward = n > 0; |
| 1456 | /* Number of buffer bytes matched. Note that this may be different | 1456 | /* Number of buffer bytes matched. Note that this may be different |
| 1457 | from len_byte in a multibyte buffer. */ | 1457 | from len_byte in a multibyte buffer. */ |
| @@ -1671,7 +1671,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat, | |||
| 1671 | register EMACS_INT i; | 1671 | register EMACS_INT i; |
| 1672 | register int j; | 1672 | register int j; |
| 1673 | unsigned char *pat, *pat_end; | 1673 | unsigned char *pat, *pat_end; |
| 1674 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 1674 | int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 1675 | 1675 | ||
| 1676 | unsigned char simple_translate[0400]; | 1676 | unsigned char simple_translate[0400]; |
| 1677 | /* These are set to the preceding bytes of a byte to be translated | 1677 | /* These are set to the preceding bytes of a byte to be translated |
| @@ -2639,7 +2639,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2639 | EMACS_INT length = SBYTES (newtext); | 2639 | EMACS_INT length = SBYTES (newtext); |
| 2640 | unsigned char *substed; | 2640 | unsigned char *substed; |
| 2641 | EMACS_INT substed_alloc_size, substed_len; | 2641 | EMACS_INT substed_alloc_size, substed_len; |
| 2642 | int buf_multibyte = !NILP (current_buffer->enable_multibyte_characters); | 2642 | int buf_multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 2643 | int str_multibyte = STRING_MULTIBYTE (newtext); | 2643 | int str_multibyte = STRING_MULTIBYTE (newtext); |
| 2644 | Lisp_Object rev_tbl; | 2644 | Lisp_Object rev_tbl; |
| 2645 | int really_changed = 0; | 2645 | int really_changed = 0; |
diff --git a/src/syntax.c b/src/syntax.c index 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, | |||
| 277 | else | 277 | else |
| 278 | { | 278 | { |
| 279 | gl_state.use_global = 0; | 279 | gl_state.use_global = 0; |
| 280 | gl_state.current_syntax_table = current_buffer->syntax_table; | 280 | gl_state.current_syntax_table = B_ (current_buffer, syntax_table); |
| 281 | } | 281 | } |
| 282 | } | 282 | } |
| 283 | 283 | ||
| @@ -363,7 +363,7 @@ char_quoted (EMACS_INT charpos, EMACS_INT bytepos) | |||
| 363 | static INLINE EMACS_INT | 363 | static INLINE EMACS_INT |
| 364 | dec_bytepos (EMACS_INT bytepos) | 364 | dec_bytepos (EMACS_INT bytepos) |
| 365 | { | 365 | { |
| 366 | if (NILP (current_buffer->enable_multibyte_characters)) | 366 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 367 | return bytepos - 1; | 367 | return bytepos - 1; |
| 368 | 368 | ||
| 369 | DEC_POS (bytepos); | 369 | DEC_POS (bytepos); |
| @@ -779,7 +779,7 @@ DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0, | |||
| 779 | This is the one specified by the current buffer. */) | 779 | This is the one specified by the current buffer. */) |
| 780 | (void) | 780 | (void) |
| 781 | { | 781 | { |
| 782 | return current_buffer->syntax_table; | 782 | return B_ (current_buffer, syntax_table); |
| 783 | } | 783 | } |
| 784 | 784 | ||
| 785 | DEFUN ("standard-syntax-table", Fstandard_syntax_table, | 785 | DEFUN ("standard-syntax-table", Fstandard_syntax_table, |
| @@ -824,7 +824,7 @@ One argument, a syntax table. */) | |||
| 824 | { | 824 | { |
| 825 | int idx; | 825 | int idx; |
| 826 | check_syntax_table (table); | 826 | check_syntax_table (table); |
| 827 | current_buffer->syntax_table = table; | 827 | B_ (current_buffer, syntax_table) = table; |
| 828 | /* Indicate that this buffer now has a specified syntax table. */ | 828 | /* Indicate that this buffer now has a specified syntax table. */ |
| 829 | idx = PER_BUFFER_VAR_IDX (syntax_table); | 829 | idx = PER_BUFFER_VAR_IDX (syntax_table); |
| 830 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); | 830 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); |
| @@ -1035,7 +1035,7 @@ usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */) | |||
| 1035 | CHECK_CHARACTER (c); | 1035 | CHECK_CHARACTER (c); |
| 1036 | 1036 | ||
| 1037 | if (NILP (syntax_table)) | 1037 | if (NILP (syntax_table)) |
| 1038 | syntax_table = current_buffer->syntax_table; | 1038 | syntax_table = B_ (current_buffer, syntax_table); |
| 1039 | else | 1039 | else |
| 1040 | check_syntax_table (syntax_table); | 1040 | check_syntax_table (syntax_table); |
| 1041 | 1041 | ||
| @@ -1450,7 +1450,7 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl | |||
| 1450 | if (XINT (lim) < BEGV) | 1450 | if (XINT (lim) < BEGV) |
| 1451 | XSETFASTINT (lim, BEGV); | 1451 | XSETFASTINT (lim, BEGV); |
| 1452 | 1452 | ||
| 1453 | multibyte = (!NILP (current_buffer->enable_multibyte_characters) | 1453 | multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 1454 | && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); | 1454 | && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); |
| 1455 | string_multibyte = SBYTES (string) > SCHARS (string); | 1455 | string_multibyte = SBYTES (string) > SCHARS (string); |
| 1456 | 1456 | ||
| @@ -1936,7 +1936,7 @@ skip_syntaxes (int forwardp, Lisp_Object string, Lisp_Object lim) | |||
| 1936 | if (forwardp ? (PT >= XFASTINT (lim)) : (PT <= XFASTINT (lim))) | 1936 | if (forwardp ? (PT >= XFASTINT (lim)) : (PT <= XFASTINT (lim))) |
| 1937 | return make_number (0); | 1937 | return make_number (0); |
| 1938 | 1938 | ||
| 1939 | multibyte = (!NILP (current_buffer->enable_multibyte_characters) | 1939 | multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters)) |
| 1940 | && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); | 1940 | && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); |
| 1941 | 1941 | ||
| 1942 | memset (fastmap, 0, sizeof fastmap); | 1942 | memset (fastmap, 0, sizeof fastmap); |
| @@ -2703,7 +2703,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf | |||
| 2703 | while (from > stop) | 2703 | while (from > stop) |
| 2704 | { | 2704 | { |
| 2705 | temp_pos = from_byte; | 2705 | temp_pos = from_byte; |
| 2706 | if (! NILP (current_buffer->enable_multibyte_characters)) | 2706 | if (! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 2707 | DEC_POS (temp_pos); | 2707 | DEC_POS (temp_pos); |
| 2708 | else | 2708 | else |
| 2709 | temp_pos--; | 2709 | temp_pos--; |
diff --git a/src/syntax.h b/src/syntax.h index 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); | |||
| 24 | 24 | ||
| 25 | /* The standard syntax table is stored where it will automatically | 25 | /* The standard syntax table is stored where it will automatically |
| 26 | be used in all new buffers. */ | 26 | be used in all new buffers. */ |
| 27 | #define Vstandard_syntax_table buffer_defaults.syntax_table | 27 | #define Vstandard_syntax_table B_ (&buffer_defaults, syntax_table) |
| 28 | 28 | ||
| 29 | /* A syntax table is a chartable whose elements are cons cells | 29 | /* A syntax table is a chartable whose elements are cons cells |
| 30 | (CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char | 30 | (CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char |
| @@ -79,7 +79,7 @@ enum syntaxcode | |||
| 79 | # define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table | 79 | # define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table |
| 80 | #else | 80 | #else |
| 81 | # define SYNTAX_ENTRY SYNTAX_ENTRY_INT | 81 | # define SYNTAX_ENTRY SYNTAX_ENTRY_INT |
| 82 | # define CURRENT_SYNTAX_TABLE current_buffer->syntax_table | 82 | # define CURRENT_SYNTAX_TABLE B_ (current_buffer, syntax_table) |
| 83 | #endif | 83 | #endif |
| 84 | 84 | ||
| 85 | #define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c)) | 85 | #define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c)) |
| @@ -204,7 +204,7 @@ extern char syntax_code_spec[16]; | |||
| 204 | do \ | 204 | do \ |
| 205 | { \ | 205 | { \ |
| 206 | gl_state.use_global = 0; \ | 206 | gl_state.use_global = 0; \ |
| 207 | gl_state.current_syntax_table = current_buffer->syntax_table; \ | 207 | gl_state.current_syntax_table = B_ (current_buffer, syntax_table); \ |
| 208 | } while (0) | 208 | } while (0) |
| 209 | 209 | ||
| 210 | /* This macro should be called with FROM at the start of forward | 210 | /* This macro should be called with FROM at the start of forward |
diff --git a/src/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) | |||
| 73 | Fundo_boundary (); | 73 | Fundo_boundary (); |
| 74 | last_undo_buffer = current_buffer; | 74 | last_undo_buffer = current_buffer; |
| 75 | 75 | ||
| 76 | if (CONSP (current_buffer->undo_list)) | 76 | if (CONSP (B_ (current_buffer, undo_list))) |
| 77 | { | 77 | { |
| 78 | /* Set AT_BOUNDARY to 1 only when we have nothing other than | 78 | /* Set AT_BOUNDARY to 1 only when we have nothing other than |
| 79 | marker adjustment before undo boundary. */ | 79 | marker adjustment before undo boundary. */ |
| 80 | 80 | ||
| 81 | Lisp_Object tail = current_buffer->undo_list, elt; | 81 | Lisp_Object tail = B_ (current_buffer, undo_list), elt; |
| 82 | 82 | ||
| 83 | while (1) | 83 | while (1) |
| 84 | { | 84 | { |
| @@ -103,8 +103,8 @@ record_point (EMACS_INT pt) | |||
| 103 | if (at_boundary | 103 | if (at_boundary |
| 104 | && current_buffer == last_boundary_buffer | 104 | && current_buffer == last_boundary_buffer |
| 105 | && last_boundary_position != pt) | 105 | && last_boundary_position != pt) |
| 106 | current_buffer->undo_list | 106 | B_ (current_buffer, undo_list) |
| 107 | = Fcons (make_number (last_boundary_position), current_buffer->undo_list); | 107 | = Fcons (make_number (last_boundary_position), B_ (current_buffer, undo_list)); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | /* Record an insertion that just happened or is about to happen, | 110 | /* Record an insertion that just happened or is about to happen, |
| @@ -117,17 +117,17 @@ record_insert (EMACS_INT beg, EMACS_INT length) | |||
| 117 | { | 117 | { |
| 118 | Lisp_Object lbeg, lend; | 118 | Lisp_Object lbeg, lend; |
| 119 | 119 | ||
| 120 | if (EQ (current_buffer->undo_list, Qt)) | 120 | if (EQ (B_ (current_buffer, undo_list), Qt)) |
| 121 | return; | 121 | return; |
| 122 | 122 | ||
| 123 | record_point (beg); | 123 | record_point (beg); |
| 124 | 124 | ||
| 125 | /* If this is following another insertion and consecutive with it | 125 | /* If this is following another insertion and consecutive with it |
| 126 | in the buffer, combine the two. */ | 126 | in the buffer, combine the two. */ |
| 127 | if (CONSP (current_buffer->undo_list)) | 127 | if (CONSP (B_ (current_buffer, undo_list))) |
| 128 | { | 128 | { |
| 129 | Lisp_Object elt; | 129 | Lisp_Object elt; |
| 130 | elt = XCAR (current_buffer->undo_list); | 130 | elt = XCAR (B_ (current_buffer, undo_list)); |
| 131 | if (CONSP (elt) | 131 | if (CONSP (elt) |
| 132 | && INTEGERP (XCAR (elt)) | 132 | && INTEGERP (XCAR (elt)) |
| 133 | && INTEGERP (XCDR (elt)) | 133 | && INTEGERP (XCDR (elt)) |
| @@ -140,8 +140,8 @@ record_insert (EMACS_INT beg, EMACS_INT length) | |||
| 140 | 140 | ||
| 141 | XSETFASTINT (lbeg, beg); | 141 | XSETFASTINT (lbeg, beg); |
| 142 | XSETINT (lend, beg + length); | 142 | XSETINT (lend, beg + length); |
| 143 | current_buffer->undo_list = Fcons (Fcons (lbeg, lend), | 143 | B_ (current_buffer, undo_list) = Fcons (Fcons (lbeg, lend), |
| 144 | current_buffer->undo_list); | 144 | B_ (current_buffer, undo_list)); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | /* Record that a deletion is about to take place, | 147 | /* Record that a deletion is about to take place, |
| @@ -152,7 +152,7 @@ record_delete (EMACS_INT beg, Lisp_Object string) | |||
| 152 | { | 152 | { |
| 153 | Lisp_Object sbeg; | 153 | Lisp_Object sbeg; |
| 154 | 154 | ||
| 155 | if (EQ (current_buffer->undo_list, Qt)) | 155 | if (EQ (B_ (current_buffer, undo_list), Qt)) |
| 156 | return; | 156 | return; |
| 157 | 157 | ||
| 158 | if (PT == beg + SCHARS (string)) | 158 | if (PT == beg + SCHARS (string)) |
| @@ -166,8 +166,8 @@ record_delete (EMACS_INT beg, Lisp_Object string) | |||
| 166 | record_point (beg); | 166 | record_point (beg); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | current_buffer->undo_list | 169 | B_ (current_buffer, undo_list) |
| 170 | = Fcons (Fcons (string, sbeg), current_buffer->undo_list); | 170 | = Fcons (Fcons (string, sbeg), B_ (current_buffer, undo_list)); |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | /* Record the fact that MARKER is about to be adjusted by ADJUSTMENT. | 173 | /* Record the fact that MARKER is about to be adjusted by ADJUSTMENT. |
| @@ -178,7 +178,7 @@ record_delete (EMACS_INT beg, Lisp_Object string) | |||
| 178 | void | 178 | void |
| 179 | record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment) | 179 | record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment) |
| 180 | { | 180 | { |
| 181 | if (EQ (current_buffer->undo_list, Qt)) | 181 | if (EQ (B_ (current_buffer, undo_list), Qt)) |
| 182 | return; | 182 | return; |
| 183 | 183 | ||
| 184 | /* Allocate a cons cell to be the undo boundary after this command. */ | 184 | /* Allocate a cons cell to be the undo boundary after this command. */ |
| @@ -189,9 +189,9 @@ record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment) | |||
| 189 | Fundo_boundary (); | 189 | Fundo_boundary (); |
| 190 | last_undo_buffer = current_buffer; | 190 | last_undo_buffer = current_buffer; |
| 191 | 191 | ||
| 192 | current_buffer->undo_list | 192 | B_ (current_buffer, undo_list) |
| 193 | = Fcons (Fcons (marker, make_number (adjustment)), | 193 | = Fcons (Fcons (marker, make_number (adjustment)), |
| 194 | current_buffer->undo_list); | 194 | B_ (current_buffer, undo_list)); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | /* Record that a replacement is about to take place, | 197 | /* Record that a replacement is about to take place, |
| @@ -215,7 +215,7 @@ record_first_change (void) | |||
| 215 | Lisp_Object high, low; | 215 | Lisp_Object high, low; |
| 216 | struct buffer *base_buffer = current_buffer; | 216 | struct buffer *base_buffer = current_buffer; |
| 217 | 217 | ||
| 218 | if (EQ (current_buffer->undo_list, Qt)) | 218 | if (EQ (B_ (current_buffer, undo_list), Qt)) |
| 219 | return; | 219 | return; |
| 220 | 220 | ||
| 221 | if (current_buffer != last_undo_buffer) | 221 | if (current_buffer != last_undo_buffer) |
| @@ -227,7 +227,7 @@ record_first_change (void) | |||
| 227 | 227 | ||
| 228 | XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff); | 228 | XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff); |
| 229 | XSETFASTINT (low, base_buffer->modtime & 0xffff); | 229 | XSETFASTINT (low, base_buffer->modtime & 0xffff); |
| 230 | current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list); | 230 | B_ (current_buffer, undo_list) = Fcons (Fcons (Qt, Fcons (high, low)), B_ (current_buffer, undo_list)); |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | /* Record a change in property PROP (whose old value was VAL) | 233 | /* Record a change in property PROP (whose old value was VAL) |
| @@ -242,7 +242,7 @@ record_property_change (EMACS_INT beg, EMACS_INT length, | |||
| 242 | struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer); | 242 | struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer); |
| 243 | int boundary = 0; | 243 | int boundary = 0; |
| 244 | 244 | ||
| 245 | if (EQ (buf->undo_list, Qt)) | 245 | if (EQ (B_ (buf, undo_list), Qt)) |
| 246 | return; | 246 | return; |
| 247 | 247 | ||
| 248 | /* Allocate a cons cell to be the undo boundary after this command. */ | 248 | /* Allocate a cons cell to be the undo boundary after this command. */ |
| @@ -265,7 +265,7 @@ record_property_change (EMACS_INT beg, EMACS_INT length, | |||
| 265 | XSETINT (lbeg, beg); | 265 | XSETINT (lbeg, beg); |
| 266 | XSETINT (lend, beg + length); | 266 | XSETINT (lend, beg + length); |
| 267 | entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend)))); | 267 | entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend)))); |
| 268 | current_buffer->undo_list = Fcons (entry, current_buffer->undo_list); | 268 | B_ (current_buffer, undo_list) = Fcons (entry, B_ (current_buffer, undo_list)); |
| 269 | 269 | ||
| 270 | current_buffer = obuf; | 270 | current_buffer = obuf; |
| 271 | } | 271 | } |
| @@ -277,9 +277,9 @@ but another undo command will undo to the previous boundary. */) | |||
| 277 | (void) | 277 | (void) |
| 278 | { | 278 | { |
| 279 | Lisp_Object tem; | 279 | Lisp_Object tem; |
| 280 | if (EQ (current_buffer->undo_list, Qt)) | 280 | if (EQ (B_ (current_buffer, undo_list), Qt)) |
| 281 | return Qnil; | 281 | return Qnil; |
| 282 | tem = Fcar (current_buffer->undo_list); | 282 | tem = Fcar (B_ (current_buffer, undo_list)); |
| 283 | if (!NILP (tem)) | 283 | if (!NILP (tem)) |
| 284 | { | 284 | { |
| 285 | /* One way or another, cons nil onto the front of the undo list. */ | 285 | /* One way or another, cons nil onto the front of the undo list. */ |
| @@ -287,12 +287,12 @@ but another undo command will undo to the previous boundary. */) | |||
| 287 | { | 287 | { |
| 288 | /* If we have preallocated the cons cell to use here, | 288 | /* If we have preallocated the cons cell to use here, |
| 289 | use that one. */ | 289 | use that one. */ |
| 290 | XSETCDR (pending_boundary, current_buffer->undo_list); | 290 | XSETCDR (pending_boundary, B_ (current_buffer, undo_list)); |
| 291 | current_buffer->undo_list = pending_boundary; | 291 | B_ (current_buffer, undo_list) = pending_boundary; |
| 292 | pending_boundary = Qnil; | 292 | pending_boundary = Qnil; |
| 293 | } | 293 | } |
| 294 | else | 294 | else |
| 295 | current_buffer->undo_list = Fcons (Qnil, current_buffer->undo_list); | 295 | B_ (current_buffer, undo_list) = Fcons (Qnil, B_ (current_buffer, undo_list)); |
| 296 | } | 296 | } |
| 297 | last_boundary_position = PT; | 297 | last_boundary_position = PT; |
| 298 | last_boundary_buffer = current_buffer; | 298 | last_boundary_buffer = current_buffer; |
| @@ -321,7 +321,7 @@ truncate_undo_list (struct buffer *b) | |||
| 321 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); | 321 | record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); |
| 322 | set_buffer_internal (b); | 322 | set_buffer_internal (b); |
| 323 | 323 | ||
| 324 | list = b->undo_list; | 324 | list = B_ (b, undo_list); |
| 325 | 325 | ||
| 326 | prev = Qnil; | 326 | prev = Qnil; |
| 327 | next = list; | 327 | next = list; |
| @@ -433,7 +433,7 @@ truncate_undo_list (struct buffer *b) | |||
| 433 | XSETCDR (last_boundary, Qnil); | 433 | XSETCDR (last_boundary, Qnil); |
| 434 | /* There's nothing we decided to keep, so clear it out. */ | 434 | /* There's nothing we decided to keep, so clear it out. */ |
| 435 | else | 435 | else |
| 436 | b->undo_list = Qnil; | 436 | B_ (b, undo_list) = Qnil; |
| 437 | 437 | ||
| 438 | unbind_to (count, Qnil); | 438 | unbind_to (count, Qnil); |
| 439 | } | 439 | } |
| @@ -470,13 +470,13 @@ Return what remains of the list. */) | |||
| 470 | 470 | ||
| 471 | /* In a writable buffer, enable undoing read-only text that is so | 471 | /* In a writable buffer, enable undoing read-only text that is so |
| 472 | because of text properties. */ | 472 | because of text properties. */ |
| 473 | if (NILP (current_buffer->read_only)) | 473 | if (NILP (B_ (current_buffer, read_only))) |
| 474 | specbind (Qinhibit_read_only, Qt); | 474 | specbind (Qinhibit_read_only, Qt); |
| 475 | 475 | ||
| 476 | /* Don't let `intangible' properties interfere with undo. */ | 476 | /* Don't let `intangible' properties interfere with undo. */ |
| 477 | specbind (Qinhibit_point_motion_hooks, Qt); | 477 | specbind (Qinhibit_point_motion_hooks, Qt); |
| 478 | 478 | ||
| 479 | oldlist = current_buffer->undo_list; | 479 | oldlist = B_ (current_buffer, undo_list); |
| 480 | 480 | ||
| 481 | while (arg > 0) | 481 | while (arg > 0) |
| 482 | { | 482 | { |
| @@ -631,9 +631,9 @@ Return what remains of the list. */) | |||
| 631 | so the test in `undo' for continuing an undo series | 631 | so the test in `undo' for continuing an undo series |
| 632 | will work right. */ | 632 | will work right. */ |
| 633 | if (did_apply | 633 | if (did_apply |
| 634 | && EQ (oldlist, current_buffer->undo_list)) | 634 | && EQ (oldlist, B_ (current_buffer, undo_list))) |
| 635 | current_buffer->undo_list | 635 | B_ (current_buffer, undo_list) |
| 636 | = Fcons (list3 (Qapply, Qcdr, Qnil), current_buffer->undo_list); | 636 | = Fcons (list3 (Qapply, Qcdr, Qnil), B_ (current_buffer, undo_list)); |
| 637 | 637 | ||
| 638 | UNGCPRO; | 638 | UNGCPRO; |
| 639 | return unbind_to (count, list); | 639 | return unbind_to (count, list); |
diff --git a/src/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) | |||
| 1359 | { | 1359 | { |
| 1360 | struct buffer *b = XBUFFER (w->buffer); | 1360 | struct buffer *b = XBUFFER (w->buffer); |
| 1361 | 1361 | ||
| 1362 | if (DISP_TABLE_P (b->display_table)) | 1362 | if (DISP_TABLE_P (B_ (b, display_table))) |
| 1363 | dp = XCHAR_TABLE (b->display_table); | 1363 | dp = XCHAR_TABLE (B_ (b, display_table)); |
| 1364 | else if (DISP_TABLE_P (Vstandard_display_table)) | 1364 | else if (DISP_TABLE_P (Vstandard_display_table)) |
| 1365 | dp = XCHAR_TABLE (Vstandard_display_table); | 1365 | dp = XCHAR_TABLE (Vstandard_display_table); |
| 1366 | } | 1366 | } |
| @@ -1414,9 +1414,9 @@ unshow_buffer (register struct window *w) | |||
| 1414 | So don't clobber point in that buffer. */ | 1414 | So don't clobber point in that buffer. */ |
| 1415 | if (! EQ (buf, XWINDOW (selected_window)->buffer) | 1415 | if (! EQ (buf, XWINDOW (selected_window)->buffer) |
| 1416 | /* This line helps to fix Horsley's testbug.el bug. */ | 1416 | /* This line helps to fix Horsley's testbug.el bug. */ |
| 1417 | && !(WINDOWP (b->last_selected_window) | 1417 | && !(WINDOWP (B_ (b, last_selected_window)) |
| 1418 | && w != XWINDOW (b->last_selected_window) | 1418 | && w != XWINDOW (B_ (b, last_selected_window)) |
| 1419 | && EQ (buf, XWINDOW (b->last_selected_window)->buffer))) | 1419 | && EQ (buf, XWINDOW (B_ (b, last_selected_window))->buffer))) |
| 1420 | temp_set_point_both (b, | 1420 | temp_set_point_both (b, |
| 1421 | clip_to_bounds (BUF_BEGV (b), | 1421 | clip_to_bounds (BUF_BEGV (b), |
| 1422 | XMARKER (w->pointm)->charpos, | 1422 | XMARKER (w->pointm)->charpos, |
| @@ -1425,9 +1425,9 @@ unshow_buffer (register struct window *w) | |||
| 1425 | marker_byte_position (w->pointm), | 1425 | marker_byte_position (w->pointm), |
| 1426 | BUF_ZV_BYTE (b))); | 1426 | BUF_ZV_BYTE (b))); |
| 1427 | 1427 | ||
| 1428 | if (WINDOWP (b->last_selected_window) | 1428 | if (WINDOWP (B_ (b, last_selected_window)) |
| 1429 | && w == XWINDOW (b->last_selected_window)) | 1429 | && w == XWINDOW (B_ (b, last_selected_window))) |
| 1430 | b->last_selected_window = Qnil; | 1430 | B_ (b, last_selected_window) = Qnil; |
| 1431 | } | 1431 | } |
| 1432 | 1432 | ||
| 1433 | /* Put replacement into the window structure in place of old. */ | 1433 | /* Put replacement into the window structure in place of old. */ |
| @@ -2325,7 +2325,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame | |||
| 2325 | /* Check for a window that has a killed buffer. */ | 2325 | /* Check for a window that has a killed buffer. */ |
| 2326 | case CHECK_ALL_WINDOWS: | 2326 | case CHECK_ALL_WINDOWS: |
| 2327 | if (! NILP (w->buffer) | 2327 | if (! NILP (w->buffer) |
| 2328 | && NILP (XBUFFER (w->buffer)->name)) | 2328 | && NILP (B_ (XBUFFER (w->buffer), name))) |
| 2329 | abort (); | 2329 | abort (); |
| 2330 | break; | 2330 | break; |
| 2331 | 2331 | ||
| @@ -2729,7 +2729,7 @@ window_min_size_2 (struct window *w, int width_p, int safe_p) | |||
| 2729 | { | 2729 | { |
| 2730 | int safe_size = (MIN_SAFE_WINDOW_HEIGHT | 2730 | int safe_size = (MIN_SAFE_WINDOW_HEIGHT |
| 2731 | + ((BUFFERP (w->buffer) | 2731 | + ((BUFFERP (w->buffer) |
| 2732 | && !NILP (XBUFFER (w->buffer)->mode_line_format)) | 2732 | && !NILP (B_ (XBUFFER (w->buffer), mode_line_format))) |
| 2733 | ? 1 : 0)); | 2733 | ? 1 : 0)); |
| 2734 | 2734 | ||
| 2735 | return safe_p ? safe_size : max (window_min_height, safe_size); | 2735 | return safe_p ? safe_size : max (window_min_height, safe_size); |
| @@ -3360,15 +3360,15 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int | |||
| 3360 | w->buffer = buffer; | 3360 | w->buffer = buffer; |
| 3361 | 3361 | ||
| 3362 | if (EQ (window, selected_window)) | 3362 | if (EQ (window, selected_window)) |
| 3363 | b->last_selected_window = window; | 3363 | B_ (b, last_selected_window) = window; |
| 3364 | 3364 | ||
| 3365 | /* Let redisplay errors through. */ | 3365 | /* Let redisplay errors through. */ |
| 3366 | b->display_error_modiff = 0; | 3366 | b->display_error_modiff = 0; |
| 3367 | 3367 | ||
| 3368 | /* Update time stamps of buffer display. */ | 3368 | /* Update time stamps of buffer display. */ |
| 3369 | if (INTEGERP (b->display_count)) | 3369 | if (INTEGERP (B_ (b, display_count))) |
| 3370 | XSETINT (b->display_count, XINT (b->display_count) + 1); | 3370 | XSETINT (B_ (b, display_count), XINT (B_ (b, display_count)) + 1); |
| 3371 | b->display_time = Fcurrent_time (); | 3371 | B_ (b, display_time) = Fcurrent_time (); |
| 3372 | 3372 | ||
| 3373 | XSETFASTINT (w->window_end_pos, 0); | 3373 | XSETFASTINT (w->window_end_pos, 0); |
| 3374 | XSETFASTINT (w->window_end_vpos, 0); | 3374 | XSETFASTINT (w->window_end_vpos, 0); |
| @@ -3421,18 +3421,18 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int | |||
| 3421 | w->left_margin_cols = w->right_margin_cols = Qnil; | 3421 | w->left_margin_cols = w->right_margin_cols = Qnil; |
| 3422 | 3422 | ||
| 3423 | Fset_window_fringes (window, | 3423 | Fset_window_fringes (window, |
| 3424 | b->left_fringe_width, b->right_fringe_width, | 3424 | B_ (b, left_fringe_width), B_ (b, right_fringe_width), |
| 3425 | b->fringes_outside_margins); | 3425 | B_ (b, fringes_outside_margins)); |
| 3426 | 3426 | ||
| 3427 | Fset_window_scroll_bars (window, | 3427 | Fset_window_scroll_bars (window, |
| 3428 | b->scroll_bar_width, | 3428 | B_ (b, scroll_bar_width), |
| 3429 | b->vertical_scroll_bar_type, Qnil); | 3429 | B_ (b, vertical_scroll_bar_type), Qnil); |
| 3430 | 3430 | ||
| 3431 | w->left_margin_cols = save_left; | 3431 | w->left_margin_cols = save_left; |
| 3432 | w->right_margin_cols = save_right; | 3432 | w->right_margin_cols = save_right; |
| 3433 | 3433 | ||
| 3434 | Fset_window_margins (window, | 3434 | Fset_window_margins (window, |
| 3435 | b->left_margin_cols, b->right_margin_cols); | 3435 | B_ (b, left_margin_cols), B_ (b, right_margin_cols)); |
| 3436 | } | 3436 | } |
| 3437 | 3437 | ||
| 3438 | if (run_hooks_p) | 3438 | if (run_hooks_p) |
| @@ -3469,7 +3469,7 @@ This function runs `window-scroll-functions' before running | |||
| 3469 | XSETWINDOW (window, w); | 3469 | XSETWINDOW (window, w); |
| 3470 | buffer = Fget_buffer (buffer_or_name); | 3470 | buffer = Fget_buffer (buffer_or_name); |
| 3471 | CHECK_BUFFER (buffer); | 3471 | CHECK_BUFFER (buffer); |
| 3472 | if (NILP (XBUFFER (buffer)->name)) | 3472 | if (NILP (B_ (XBUFFER (buffer), name))) |
| 3473 | error ("Attempt to display deleted buffer"); | 3473 | error ("Attempt to display deleted buffer"); |
| 3474 | 3474 | ||
| 3475 | tem = w->buffer; | 3475 | tem = w->buffer; |
| @@ -3481,7 +3481,7 @@ This function runs `window-scroll-functions' before running | |||
| 3481 | if (EQ (tem, buffer)) | 3481 | if (EQ (tem, buffer)) |
| 3482 | return Qnil; | 3482 | return Qnil; |
| 3483 | else if (EQ (w->dedicated, Qt)) | 3483 | else if (EQ (w->dedicated, Qt)) |
| 3484 | error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name)); | 3484 | error ("Window is dedicated to `%s'", SDATA (B_ (XBUFFER (tem), name))); |
| 3485 | else | 3485 | else |
| 3486 | w->dedicated = Qnil; | 3486 | w->dedicated = Qnil; |
| 3487 | 3487 | ||
| @@ -3552,7 +3552,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) | |||
| 3552 | 3552 | ||
| 3553 | Fset_buffer (w->buffer); | 3553 | Fset_buffer (w->buffer); |
| 3554 | 3554 | ||
| 3555 | XBUFFER (w->buffer)->last_selected_window = window; | 3555 | B_ (XBUFFER (w->buffer), last_selected_window) = window; |
| 3556 | 3556 | ||
| 3557 | /* Go to the point recorded in the window. | 3557 | /* Go to the point recorded in the window. |
| 3558 | This is important when the buffer is in more | 3558 | This is important when the buffer is in more |
| @@ -3640,7 +3640,7 @@ displaying that buffer. */) | |||
| 3640 | 3640 | ||
| 3641 | if (STRINGP (object)) | 3641 | if (STRINGP (object)) |
| 3642 | object = Fget_buffer (object); | 3642 | object = Fget_buffer (object); |
| 3643 | if (BUFFERP (object) && !NILP (XBUFFER (object)->name)) | 3643 | if (BUFFERP (object) && !NILP (B_ (XBUFFER (object), name))) |
| 3644 | { | 3644 | { |
| 3645 | /* Walk all windows looking for buffer, and force update | 3645 | /* Walk all windows looking for buffer, and force update |
| 3646 | of each of those windows. */ | 3646 | of each of those windows. */ |
| @@ -3663,7 +3663,7 @@ temp_output_buffer_show (register Lisp_Object buf) | |||
| 3663 | register Lisp_Object window; | 3663 | register Lisp_Object window; |
| 3664 | register struct window *w; | 3664 | register struct window *w; |
| 3665 | 3665 | ||
| 3666 | XBUFFER (buf)->directory = current_buffer->directory; | 3666 | B_ (XBUFFER (buf), directory) = B_ (current_buffer, directory); |
| 3667 | 3667 | ||
| 3668 | Fset_buffer (buf); | 3668 | Fset_buffer (buf); |
| 3669 | BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF; | 3669 | BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF; |
| @@ -5878,7 +5878,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5878 | saved_windows = XVECTOR (data->saved_windows); | 5878 | saved_windows = XVECTOR (data->saved_windows); |
| 5879 | 5879 | ||
| 5880 | new_current_buffer = data->current_buffer; | 5880 | new_current_buffer = data->current_buffer; |
| 5881 | if (NILP (XBUFFER (new_current_buffer)->name)) | 5881 | if (NILP (B_ (XBUFFER (new_current_buffer), name))) |
| 5882 | new_current_buffer = Qnil; | 5882 | new_current_buffer = Qnil; |
| 5883 | else | 5883 | else |
| 5884 | { | 5884 | { |
| @@ -6063,14 +6063,14 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6063 | w->buffer = p->buffer; | 6063 | w->buffer = p->buffer; |
| 6064 | else | 6064 | else |
| 6065 | { | 6065 | { |
| 6066 | if (!NILP (XBUFFER (p->buffer)->name)) | 6066 | if (!NILP (B_ (XBUFFER (p->buffer), name))) |
| 6067 | /* If saved buffer is alive, install it. */ | 6067 | /* If saved buffer is alive, install it. */ |
| 6068 | { | 6068 | { |
| 6069 | w->buffer = p->buffer; | 6069 | w->buffer = p->buffer; |
| 6070 | w->start_at_line_beg = p->start_at_line_beg; | 6070 | w->start_at_line_beg = p->start_at_line_beg; |
| 6071 | set_marker_restricted (w->start, p->start, w->buffer); | 6071 | set_marker_restricted (w->start, p->start, w->buffer); |
| 6072 | set_marker_restricted (w->pointm, p->pointm, w->buffer); | 6072 | set_marker_restricted (w->pointm, p->pointm, w->buffer); |
| 6073 | Fset_marker (XBUFFER (w->buffer)->mark, | 6073 | Fset_marker (B_ (XBUFFER (w->buffer), mark), |
| 6074 | p->mark, w->buffer); | 6074 | p->mark, w->buffer); |
| 6075 | 6075 | ||
| 6076 | /* As documented in Fcurrent_window_configuration, don't | 6076 | /* As documented in Fcurrent_window_configuration, don't |
| @@ -6080,7 +6080,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6080 | && XBUFFER (p->buffer) == current_buffer) | 6080 | && XBUFFER (p->buffer) == current_buffer) |
| 6081 | Fgoto_char (w->pointm); | 6081 | Fgoto_char (w->pointm); |
| 6082 | } | 6082 | } |
| 6083 | else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name)) | 6083 | else if (NILP (w->buffer) || NILP (B_ (XBUFFER (w->buffer), name))) |
| 6084 | /* Else unless window has a live buffer, get one. */ | 6084 | /* Else unless window has a live buffer, get one. */ |
| 6085 | { | 6085 | { |
| 6086 | w->buffer = Fcdr (Fcar (Vbuffer_alist)); | 6086 | w->buffer = Fcdr (Fcar (Vbuffer_alist)); |
| @@ -6121,7 +6121,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6121 | has been restored into it. We already swapped out that point | 6121 | has been restored into it. We already swapped out that point |
| 6122 | from that window's old buffer. */ | 6122 | from that window's old buffer. */ |
| 6123 | select_window (data->current_window, Qnil, 1); | 6123 | select_window (data->current_window, Qnil, 1); |
| 6124 | XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window | 6124 | B_ (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window) |
| 6125 | = selected_window; | 6125 | = selected_window; |
| 6126 | 6126 | ||
| 6127 | if (NILP (data->focus_frame) | 6127 | if (NILP (data->focus_frame) |
| @@ -6322,7 +6322,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) | |||
| 6322 | p->start = Fcopy_marker (w->start, Qnil); | 6322 | p->start = Fcopy_marker (w->start, Qnil); |
| 6323 | p->start_at_line_beg = w->start_at_line_beg; | 6323 | p->start_at_line_beg = w->start_at_line_beg; |
| 6324 | 6324 | ||
| 6325 | tem = XBUFFER (w->buffer)->mark; | 6325 | tem = B_ (XBUFFER (w->buffer), mark); |
| 6326 | p->mark = Fcopy_marker (tem, Qnil); | 6326 | p->mark = Fcopy_marker (tem, Qnil); |
| 6327 | } | 6327 | } |
| 6328 | else | 6328 | else |
diff --git a/src/xdisp.c b/src/xdisp.c index 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, | |||
| 1210 | if (WINDOW_WANTS_MODELINE_P (w)) | 1210 | if (WINDOW_WANTS_MODELINE_P (w)) |
| 1211 | current_mode_line_height | 1211 | current_mode_line_height |
| 1212 | = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w), | 1212 | = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w), |
| 1213 | current_buffer->mode_line_format); | 1213 | B_ (current_buffer, mode_line_format)); |
| 1214 | 1214 | ||
| 1215 | if (WINDOW_WANTS_HEADER_LINE_P (w)) | 1215 | if (WINDOW_WANTS_HEADER_LINE_P (w)) |
| 1216 | current_header_line_height | 1216 | current_header_line_height |
| 1217 | = display_mode_line (w, HEADER_LINE_FACE_ID, | 1217 | = display_mode_line (w, HEADER_LINE_FACE_ID, |
| 1218 | current_buffer->header_line_format); | 1218 | B_ (current_buffer, header_line_format)); |
| 1219 | 1219 | ||
| 1220 | start_display (&it, w, top); | 1220 | start_display (&it, w, top); |
| 1221 | move_it_to (&it, charpos, -1, it.last_visible_y-1, -1, | 1221 | move_it_to (&it, charpos, -1, it.last_visible_y-1, -1, |
| @@ -2405,10 +2405,10 @@ init_iterator (struct it *it, struct window *w, | |||
| 2405 | if (base_face_id == DEFAULT_FACE_ID | 2405 | if (base_face_id == DEFAULT_FACE_ID |
| 2406 | && FRAME_WINDOW_P (it->f)) | 2406 | && FRAME_WINDOW_P (it->f)) |
| 2407 | { | 2407 | { |
| 2408 | if (NATNUMP (current_buffer->extra_line_spacing)) | 2408 | if (NATNUMP (B_ (current_buffer, extra_line_spacing))) |
| 2409 | it->extra_line_spacing = XFASTINT (current_buffer->extra_line_spacing); | 2409 | it->extra_line_spacing = XFASTINT (B_ (current_buffer, extra_line_spacing)); |
| 2410 | else if (FLOATP (current_buffer->extra_line_spacing)) | 2410 | else if (FLOATP (B_ (current_buffer, extra_line_spacing))) |
| 2411 | it->extra_line_spacing = (XFLOAT_DATA (current_buffer->extra_line_spacing) | 2411 | it->extra_line_spacing = (XFLOAT_DATA (B_ (current_buffer, extra_line_spacing)) |
| 2412 | * FRAME_LINE_HEIGHT (it->f)); | 2412 | * FRAME_LINE_HEIGHT (it->f)); |
| 2413 | else if (it->f->extra_line_spacing > 0) | 2413 | else if (it->f->extra_line_spacing > 0) |
| 2414 | it->extra_line_spacing = it->f->extra_line_spacing; | 2414 | it->extra_line_spacing = it->f->extra_line_spacing; |
| @@ -2431,36 +2431,36 @@ init_iterator (struct it *it, struct window *w, | |||
| 2431 | it->override_ascent = -1; | 2431 | it->override_ascent = -1; |
| 2432 | 2432 | ||
| 2433 | /* Are control characters displayed as `^C'? */ | 2433 | /* Are control characters displayed as `^C'? */ |
| 2434 | it->ctl_arrow_p = !NILP (current_buffer->ctl_arrow); | 2434 | it->ctl_arrow_p = !NILP (B_ (current_buffer, ctl_arrow)); |
| 2435 | 2435 | ||
| 2436 | /* -1 means everything between a CR and the following line end | 2436 | /* -1 means everything between a CR and the following line end |
| 2437 | is invisible. >0 means lines indented more than this value are | 2437 | is invisible. >0 means lines indented more than this value are |
| 2438 | invisible. */ | 2438 | invisible. */ |
| 2439 | it->selective = (INTEGERP (current_buffer->selective_display) | 2439 | it->selective = (INTEGERP (B_ (current_buffer, selective_display)) |
| 2440 | ? XFASTINT (current_buffer->selective_display) | 2440 | ? XFASTINT (B_ (current_buffer, selective_display)) |
| 2441 | : (!NILP (current_buffer->selective_display) | 2441 | : (!NILP (B_ (current_buffer, selective_display)) |
| 2442 | ? -1 : 0)); | 2442 | ? -1 : 0)); |
| 2443 | it->selective_display_ellipsis_p | 2443 | it->selective_display_ellipsis_p |
| 2444 | = !NILP (current_buffer->selective_display_ellipses); | 2444 | = !NILP (B_ (current_buffer, selective_display_ellipses)); |
| 2445 | 2445 | ||
| 2446 | /* Display table to use. */ | 2446 | /* Display table to use. */ |
| 2447 | it->dp = window_display_table (w); | 2447 | it->dp = window_display_table (w); |
| 2448 | 2448 | ||
| 2449 | /* Are multibyte characters enabled in current_buffer? */ | 2449 | /* Are multibyte characters enabled in current_buffer? */ |
| 2450 | it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters); | 2450 | it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 2451 | 2451 | ||
| 2452 | /* Do we need to reorder bidirectional text? Not if this is a | 2452 | /* Do we need to reorder bidirectional text? Not if this is a |
| 2453 | unibyte buffer: by definition, none of the single-byte characters | 2453 | unibyte buffer: by definition, none of the single-byte characters |
| 2454 | are strong R2L, so no reordering is needed. And bidi.c doesn't | 2454 | are strong R2L, so no reordering is needed. And bidi.c doesn't |
| 2455 | support unibyte buffers anyway. */ | 2455 | support unibyte buffers anyway. */ |
| 2456 | it->bidi_p | 2456 | it->bidi_p |
| 2457 | = !NILP (current_buffer->bidi_display_reordering) && it->multibyte_p; | 2457 | = !NILP (B_ (current_buffer, bidi_display_reordering)) && it->multibyte_p; |
| 2458 | 2458 | ||
| 2459 | /* Non-zero if we should highlight the region. */ | 2459 | /* Non-zero if we should highlight the region. */ |
| 2460 | highlight_region_p | 2460 | highlight_region_p |
| 2461 | = (!NILP (Vtransient_mark_mode) | 2461 | = (!NILP (Vtransient_mark_mode) |
| 2462 | && !NILP (current_buffer->mark_active) | 2462 | && !NILP (B_ (current_buffer, mark_active)) |
| 2463 | && XMARKER (current_buffer->mark)->buffer != 0); | 2463 | && XMARKER (B_ (current_buffer, mark))->buffer != 0); |
| 2464 | 2464 | ||
| 2465 | /* Set IT->region_beg_charpos and IT->region_end_charpos to the | 2465 | /* Set IT->region_beg_charpos and IT->region_end_charpos to the |
| 2466 | start and end of a visible region in window IT->w. Set both to | 2466 | start and end of a visible region in window IT->w. Set both to |
| @@ -2477,7 +2477,7 @@ init_iterator (struct it *it, struct window *w, | |||
| 2477 | && WINDOWP (minibuf_selected_window) | 2477 | && WINDOWP (minibuf_selected_window) |
| 2478 | && w == XWINDOW (minibuf_selected_window)))) | 2478 | && w == XWINDOW (minibuf_selected_window)))) |
| 2479 | { | 2479 | { |
| 2480 | EMACS_INT charpos = marker_position (current_buffer->mark); | 2480 | EMACS_INT charpos = marker_position (B_ (current_buffer, mark)); |
| 2481 | it->region_beg_charpos = min (PT, charpos); | 2481 | it->region_beg_charpos = min (PT, charpos); |
| 2482 | it->region_end_charpos = max (PT, charpos); | 2482 | it->region_end_charpos = max (PT, charpos); |
| 2483 | } | 2483 | } |
| @@ -2494,7 +2494,7 @@ init_iterator (struct it *it, struct window *w, | |||
| 2494 | it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger); | 2494 | it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger); |
| 2495 | 2495 | ||
| 2496 | /* Correct bogus values of tab_width. */ | 2496 | /* Correct bogus values of tab_width. */ |
| 2497 | it->tab_width = XINT (current_buffer->tab_width); | 2497 | it->tab_width = XINT (B_ (current_buffer, tab_width)); |
| 2498 | if (it->tab_width <= 0 || it->tab_width > 1000) | 2498 | if (it->tab_width <= 0 || it->tab_width > 1000) |
| 2499 | it->tab_width = 8; | 2499 | it->tab_width = 8; |
| 2500 | 2500 | ||
| @@ -2508,8 +2508,8 @@ init_iterator (struct it *it, struct window *w, | |||
| 2508 | && (WINDOW_TOTAL_COLS (it->w) | 2508 | && (WINDOW_TOTAL_COLS (it->w) |
| 2509 | < XINT (Vtruncate_partial_width_windows)))))) | 2509 | < XINT (Vtruncate_partial_width_windows)))))) |
| 2510 | it->line_wrap = TRUNCATE; | 2510 | it->line_wrap = TRUNCATE; |
| 2511 | else if (NILP (current_buffer->truncate_lines)) | 2511 | else if (NILP (B_ (current_buffer, truncate_lines))) |
| 2512 | it->line_wrap = NILP (current_buffer->word_wrap) | 2512 | it->line_wrap = NILP (B_ (current_buffer, word_wrap)) |
| 2513 | ? WINDOW_WRAP : WORD_WRAP; | 2513 | ? WINDOW_WRAP : WORD_WRAP; |
| 2514 | else | 2514 | else |
| 2515 | it->line_wrap = TRUNCATE; | 2515 | it->line_wrap = TRUNCATE; |
| @@ -2611,9 +2611,9 @@ init_iterator (struct it *it, struct window *w, | |||
| 2611 | { | 2611 | { |
| 2612 | /* Note the paragraph direction that this buffer wants to | 2612 | /* Note the paragraph direction that this buffer wants to |
| 2613 | use. */ | 2613 | use. */ |
| 2614 | if (EQ (current_buffer->bidi_paragraph_direction, Qleft_to_right)) | 2614 | if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qleft_to_right)) |
| 2615 | it->paragraph_embedding = L2R; | 2615 | it->paragraph_embedding = L2R; |
| 2616 | else if (EQ (current_buffer->bidi_paragraph_direction, Qright_to_left)) | 2616 | else if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qright_to_left)) |
| 2617 | it->paragraph_embedding = R2L; | 2617 | it->paragraph_embedding = R2L; |
| 2618 | else | 2618 | else |
| 2619 | it->paragraph_embedding = NEUTRAL_DIR; | 2619 | it->paragraph_embedding = NEUTRAL_DIR; |
| @@ -5411,7 +5411,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p) | |||
| 5411 | it->method = GET_FROM_BUFFER; | 5411 | it->method = GET_FROM_BUFFER; |
| 5412 | it->object = it->w->buffer; | 5412 | it->object = it->w->buffer; |
| 5413 | it->area = TEXT_AREA; | 5413 | it->area = TEXT_AREA; |
| 5414 | it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters); | 5414 | it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 5415 | it->sp = 0; | 5415 | it->sp = 0; |
| 5416 | it->string_from_display_prop_p = 0; | 5416 | it->string_from_display_prop_p = 0; |
| 5417 | it->face_before_selective_p = 0; | 5417 | it->face_before_selective_p = 0; |
| @@ -7919,7 +7919,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte) | |||
| 7919 | old_deactivate_mark = Vdeactivate_mark; | 7919 | old_deactivate_mark = Vdeactivate_mark; |
| 7920 | oldbuf = current_buffer; | 7920 | oldbuf = current_buffer; |
| 7921 | Fset_buffer (Fget_buffer_create (Vmessages_buffer_name)); | 7921 | Fset_buffer (Fget_buffer_create (Vmessages_buffer_name)); |
| 7922 | current_buffer->undo_list = Qt; | 7922 | B_ (current_buffer, undo_list) = Qt; |
| 7923 | 7923 | ||
| 7924 | oldpoint = message_dolog_marker1; | 7924 | oldpoint = message_dolog_marker1; |
| 7925 | set_marker_restricted (oldpoint, make_number (PT), Qnil); | 7925 | set_marker_restricted (oldpoint, make_number (PT), Qnil); |
| @@ -7943,7 +7943,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte) | |||
| 7943 | /* Insert the string--maybe converting multibyte to single byte | 7943 | /* Insert the string--maybe converting multibyte to single byte |
| 7944 | or vice versa, so that all the text fits the buffer. */ | 7944 | or vice versa, so that all the text fits the buffer. */ |
| 7945 | if (multibyte | 7945 | if (multibyte |
| 7946 | && NILP (current_buffer->enable_multibyte_characters)) | 7946 | && NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 7947 | { | 7947 | { |
| 7948 | EMACS_INT i; | 7948 | EMACS_INT i; |
| 7949 | int c, char_bytes; | 7949 | int c, char_bytes; |
| @@ -7961,7 +7961,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte) | |||
| 7961 | } | 7961 | } |
| 7962 | } | 7962 | } |
| 7963 | else if (! multibyte | 7963 | else if (! multibyte |
| 7964 | && ! NILP (current_buffer->enable_multibyte_characters)) | 7964 | && ! NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 7965 | { | 7965 | { |
| 7966 | EMACS_INT i; | 7966 | EMACS_INT i; |
| 7967 | int c, char_bytes; | 7967 | int c, char_bytes; |
| @@ -8460,7 +8460,7 @@ update_echo_area (void) | |||
| 8460 | Lisp_Object string; | 8460 | Lisp_Object string; |
| 8461 | string = Fcurrent_message (); | 8461 | string = Fcurrent_message (); |
| 8462 | message3 (string, SBYTES (string), | 8462 | message3 (string, SBYTES (string), |
| 8463 | !NILP (current_buffer->enable_multibyte_characters)); | 8463 | !NILP (B_ (current_buffer, enable_multibyte_characters))); |
| 8464 | } | 8464 | } |
| 8465 | } | 8465 | } |
| 8466 | 8466 | ||
| @@ -8475,7 +8475,7 @@ ensure_echo_area_buffers (void) | |||
| 8475 | 8475 | ||
| 8476 | for (i = 0; i < 2; ++i) | 8476 | for (i = 0; i < 2; ++i) |
| 8477 | if (!BUFFERP (echo_buffer[i]) | 8477 | if (!BUFFERP (echo_buffer[i]) |
| 8478 | || NILP (XBUFFER (echo_buffer[i])->name)) | 8478 | || NILP (B_ (XBUFFER (echo_buffer[i]), name))) |
| 8479 | { | 8479 | { |
| 8480 | char name[30]; | 8480 | char name[30]; |
| 8481 | Lisp_Object old_buffer; | 8481 | Lisp_Object old_buffer; |
| @@ -8484,7 +8484,7 @@ ensure_echo_area_buffers (void) | |||
| 8484 | old_buffer = echo_buffer[i]; | 8484 | old_buffer = echo_buffer[i]; |
| 8485 | sprintf (name, " *Echo Area %d*", i); | 8485 | sprintf (name, " *Echo Area %d*", i); |
| 8486 | echo_buffer[i] = Fget_buffer_create (build_string (name)); | 8486 | echo_buffer[i] = Fget_buffer_create (build_string (name)); |
| 8487 | XBUFFER (echo_buffer[i])->truncate_lines = Qnil; | 8487 | B_ (XBUFFER (echo_buffer[i]), truncate_lines) = Qnil; |
| 8488 | /* to force word wrap in echo area - | 8488 | /* to force word wrap in echo area - |
| 8489 | it was decided to postpone this*/ | 8489 | it was decided to postpone this*/ |
| 8490 | /* XBUFFER (echo_buffer[i])->word_wrap = Qt; */ | 8490 | /* XBUFFER (echo_buffer[i])->word_wrap = Qt; */ |
| @@ -8577,8 +8577,8 @@ with_echo_area_buffer (struct window *w, int which, | |||
| 8577 | set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); | 8577 | set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); |
| 8578 | } | 8578 | } |
| 8579 | 8579 | ||
| 8580 | current_buffer->undo_list = Qt; | 8580 | B_ (current_buffer, undo_list) = Qt; |
| 8581 | current_buffer->read_only = Qnil; | 8581 | B_ (current_buffer, read_only) = Qnil; |
| 8582 | specbind (Qinhibit_read_only, Qt); | 8582 | specbind (Qinhibit_read_only, Qt); |
| 8583 | specbind (Qinhibit_modification_hooks, Qt); | 8583 | specbind (Qinhibit_modification_hooks, Qt); |
| 8584 | 8584 | ||
| @@ -8691,7 +8691,7 @@ setup_echo_area_for_printing (int multibyte_p) | |||
| 8691 | 8691 | ||
| 8692 | /* Switch to that buffer and clear it. */ | 8692 | /* Switch to that buffer and clear it. */ |
| 8693 | set_buffer_internal (XBUFFER (echo_area_buffer[0])); | 8693 | set_buffer_internal (XBUFFER (echo_area_buffer[0])); |
| 8694 | current_buffer->truncate_lines = Qnil; | 8694 | B_ (current_buffer, truncate_lines) = Qnil; |
| 8695 | 8695 | ||
| 8696 | if (Z > BEG) | 8696 | if (Z > BEG) |
| 8697 | { | 8697 | { |
| @@ -8705,7 +8705,7 @@ setup_echo_area_for_printing (int multibyte_p) | |||
| 8705 | 8705 | ||
| 8706 | /* Set up the buffer for the multibyteness we need. */ | 8706 | /* Set up the buffer for the multibyteness we need. */ |
| 8707 | if (multibyte_p | 8707 | if (multibyte_p |
| 8708 | != !NILP (current_buffer->enable_multibyte_characters)) | 8708 | != !NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 8709 | Fset_buffer_multibyte (multibyte_p ? Qt : Qnil); | 8709 | Fset_buffer_multibyte (multibyte_p ? Qt : Qnil); |
| 8710 | 8710 | ||
| 8711 | /* Raise the frame containing the echo area. */ | 8711 | /* Raise the frame containing the echo area. */ |
| @@ -8734,7 +8734,7 @@ setup_echo_area_for_printing (int multibyte_p) | |||
| 8734 | { | 8734 | { |
| 8735 | /* Someone switched buffers between print requests. */ | 8735 | /* Someone switched buffers between print requests. */ |
| 8736 | set_buffer_internal (XBUFFER (echo_area_buffer[0])); | 8736 | set_buffer_internal (XBUFFER (echo_area_buffer[0])); |
| 8737 | current_buffer->truncate_lines = Qnil; | 8737 | B_ (current_buffer, truncate_lines) = Qnil; |
| 8738 | } | 8738 | } |
| 8739 | } | 8739 | } |
| 8740 | } | 8740 | } |
| @@ -9177,12 +9177,12 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby | |||
| 9177 | 9177 | ||
| 9178 | /* Change multibyteness of the echo buffer appropriately. */ | 9178 | /* Change multibyteness of the echo buffer appropriately. */ |
| 9179 | if (message_enable_multibyte | 9179 | if (message_enable_multibyte |
| 9180 | != !NILP (current_buffer->enable_multibyte_characters)) | 9180 | != !NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 9181 | Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); | 9181 | Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); |
| 9182 | 9182 | ||
| 9183 | current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil; | 9183 | B_ (current_buffer, truncate_lines) = message_truncate_lines ? Qt : Qnil; |
| 9184 | if (!NILP (current_buffer->bidi_display_reordering)) | 9184 | if (!NILP (B_ (current_buffer, bidi_display_reordering))) |
| 9185 | current_buffer->bidi_paragraph_direction = Qleft_to_right; | 9185 | B_ (current_buffer, bidi_paragraph_direction) = Qleft_to_right; |
| 9186 | 9186 | ||
| 9187 | /* Insert new message at BEG. */ | 9187 | /* Insert new message at BEG. */ |
| 9188 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); | 9188 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); |
| @@ -9205,7 +9205,7 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby | |||
| 9205 | if (nbytes == 0) | 9205 | if (nbytes == 0) |
| 9206 | nbytes = strlen (s); | 9206 | nbytes = strlen (s); |
| 9207 | 9207 | ||
| 9208 | if (multibyte_p && NILP (current_buffer->enable_multibyte_characters)) | 9208 | if (multibyte_p && NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 9209 | { | 9209 | { |
| 9210 | /* Convert from multi-byte to single-byte. */ | 9210 | /* Convert from multi-byte to single-byte. */ |
| 9211 | EMACS_INT i; | 9211 | EMACS_INT i; |
| @@ -9223,7 +9223,7 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby | |||
| 9223 | } | 9223 | } |
| 9224 | } | 9224 | } |
| 9225 | else if (!multibyte_p | 9225 | else if (!multibyte_p |
| 9226 | && !NILP (current_buffer->enable_multibyte_characters)) | 9226 | && !NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 9227 | { | 9227 | { |
| 9228 | /* Convert from single-byte to multi-byte. */ | 9228 | /* Convert from single-byte to multi-byte. */ |
| 9229 | EMACS_INT i; | 9229 | EMACS_INT i; |
| @@ -9808,7 +9808,7 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run) | |||
| 9808 | < BUF_MODIFF (XBUFFER (w->buffer))) | 9808 | < BUF_MODIFF (XBUFFER (w->buffer))) |
| 9809 | != !NILP (w->last_had_star)) | 9809 | != !NILP (w->last_had_star)) |
| 9810 | || ((!NILP (Vtransient_mark_mode) | 9810 | || ((!NILP (Vtransient_mark_mode) |
| 9811 | && !NILP (XBUFFER (w->buffer)->mark_active)) | 9811 | && !NILP (B_ (XBUFFER (w->buffer), mark_active))) |
| 9812 | != !NILP (w->region_showing))) | 9812 | != !NILP (w->region_showing))) |
| 9813 | { | 9813 | { |
| 9814 | struct buffer *prev = current_buffer; | 9814 | struct buffer *prev = current_buffer; |
| @@ -10006,7 +10006,7 @@ update_tool_bar (struct frame *f, int save_match_data) | |||
| 10006 | < BUF_MODIFF (XBUFFER (w->buffer))) | 10006 | < BUF_MODIFF (XBUFFER (w->buffer))) |
| 10007 | != !NILP (w->last_had_star)) | 10007 | != !NILP (w->last_had_star)) |
| 10008 | || ((!NILP (Vtransient_mark_mode) | 10008 | || ((!NILP (Vtransient_mark_mode) |
| 10009 | && !NILP (XBUFFER (w->buffer)->mark_active)) | 10009 | && !NILP (B_ (XBUFFER (w->buffer), mark_active))) |
| 10010 | != !NILP (w->region_showing))) | 10010 | != !NILP (w->region_showing))) |
| 10011 | { | 10011 | { |
| 10012 | struct buffer *prev = current_buffer; | 10012 | struct buffer *prev = current_buffer; |
| @@ -11097,8 +11097,8 @@ text_outside_line_unchanged_p (struct window *w, | |||
| 11097 | /* If selective display, can't optimize if changes start at the | 11097 | /* If selective display, can't optimize if changes start at the |
| 11098 | beginning of the line. */ | 11098 | beginning of the line. */ |
| 11099 | if (unchanged_p | 11099 | if (unchanged_p |
| 11100 | && INTEGERP (current_buffer->selective_display) | 11100 | && INTEGERP (B_ (current_buffer, selective_display)) |
| 11101 | && XINT (current_buffer->selective_display) > 0 | 11101 | && XINT (B_ (current_buffer, selective_display)) > 0 |
| 11102 | && (BEG_UNCHANGED < start || GPT <= start)) | 11102 | && (BEG_UNCHANGED < start || GPT <= start)) |
| 11103 | unchanged_p = 0; | 11103 | unchanged_p = 0; |
| 11104 | 11104 | ||
| @@ -11126,8 +11126,8 @@ text_outside_line_unchanged_p (struct window *w, | |||
| 11126 | require to redisplay the whole paragraph. It might be worthwhile | 11126 | require to redisplay the whole paragraph. It might be worthwhile |
| 11127 | to find the paragraph limits and widen the range of redisplayed | 11127 | to find the paragraph limits and widen the range of redisplayed |
| 11128 | lines to that, but for now just give up this optimization. */ | 11128 | lines to that, but for now just give up this optimization. */ |
| 11129 | if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering) | 11129 | if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) |
| 11130 | && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction)) | 11130 | && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction))) |
| 11131 | unchanged_p = 0; | 11131 | unchanged_p = 0; |
| 11132 | } | 11132 | } |
| 11133 | 11133 | ||
| @@ -11662,11 +11662,11 @@ redisplay_internal (int preserve_echo_area) | |||
| 11662 | the whole window. The assignment to this_line_start_pos prevents | 11662 | the whole window. The assignment to this_line_start_pos prevents |
| 11663 | the optimization directly below this if-statement. */ | 11663 | the optimization directly below this if-statement. */ |
| 11664 | if (((!NILP (Vtransient_mark_mode) | 11664 | if (((!NILP (Vtransient_mark_mode) |
| 11665 | && !NILP (XBUFFER (w->buffer)->mark_active)) | 11665 | && !NILP (B_ (XBUFFER (w->buffer), mark_active))) |
| 11666 | != !NILP (w->region_showing)) | 11666 | != !NILP (w->region_showing)) |
| 11667 | || (!NILP (w->region_showing) | 11667 | || (!NILP (w->region_showing) |
| 11668 | && !EQ (w->region_showing, | 11668 | && !EQ (w->region_showing, |
| 11669 | Fmarker_position (XBUFFER (w->buffer)->mark)))) | 11669 | Fmarker_position (B_ (XBUFFER (w->buffer), mark))))) |
| 11670 | CHARPOS (this_line_start_pos) = 0; | 11670 | CHARPOS (this_line_start_pos) = 0; |
| 11671 | 11671 | ||
| 11672 | /* Optimize the case that only the line containing the cursor in the | 11672 | /* Optimize the case that only the line containing the cursor in the |
| @@ -11826,8 +11826,8 @@ redisplay_internal (int preserve_echo_area) | |||
| 11826 | /* If highlighting the region, or if the cursor is in the echo area, | 11826 | /* If highlighting the region, or if the cursor is in the echo area, |
| 11827 | then we can't just move the cursor. */ | 11827 | then we can't just move the cursor. */ |
| 11828 | else if (! (!NILP (Vtransient_mark_mode) | 11828 | else if (! (!NILP (Vtransient_mark_mode) |
| 11829 | && !NILP (current_buffer->mark_active)) | 11829 | && !NILP (B_ (current_buffer, mark_active))) |
| 11830 | && (EQ (selected_window, current_buffer->last_selected_window) | 11830 | && (EQ (selected_window, B_ (current_buffer, last_selected_window)) |
| 11831 | || highlight_nonselected_windows) | 11831 | || highlight_nonselected_windows) |
| 11832 | && NILP (w->region_showing) | 11832 | && NILP (w->region_showing) |
| 11833 | && NILP (Vshow_trailing_whitespace) | 11833 | && NILP (Vshow_trailing_whitespace) |
| @@ -13033,8 +13033,8 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13033 | scroll_max = (max (scroll_step, | 13033 | scroll_max = (max (scroll_step, |
| 13034 | max (arg_scroll_conservatively, temp_scroll_step)) | 13034 | max (arg_scroll_conservatively, temp_scroll_step)) |
| 13035 | * FRAME_LINE_HEIGHT (f)); | 13035 | * FRAME_LINE_HEIGHT (f)); |
| 13036 | else if (NUMBERP (current_buffer->scroll_down_aggressively) | 13036 | else if (NUMBERP (B_ (current_buffer, scroll_down_aggressively)) |
| 13037 | || NUMBERP (current_buffer->scroll_up_aggressively)) | 13037 | || NUMBERP (B_ (current_buffer, scroll_up_aggressively))) |
| 13038 | /* We're trying to scroll because of aggressive scrolling but no | 13038 | /* We're trying to scroll because of aggressive scrolling but no |
| 13039 | scroll_step is set. Choose an arbitrary one. */ | 13039 | scroll_step is set. Choose an arbitrary one. */ |
| 13040 | scroll_max = 10 * FRAME_LINE_HEIGHT (f); | 13040 | scroll_max = 10 * FRAME_LINE_HEIGHT (f); |
| @@ -13099,7 +13099,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13099 | amount_to_scroll = scroll_max; | 13099 | amount_to_scroll = scroll_max; |
| 13100 | else | 13100 | else |
| 13101 | { | 13101 | { |
| 13102 | aggressive = current_buffer->scroll_up_aggressively; | 13102 | aggressive = B_ (current_buffer, scroll_up_aggressively); |
| 13103 | height = WINDOW_BOX_TEXT_HEIGHT (w); | 13103 | height = WINDOW_BOX_TEXT_HEIGHT (w); |
| 13104 | if (NUMBERP (aggressive)) | 13104 | if (NUMBERP (aggressive)) |
| 13105 | { | 13105 | { |
| @@ -13182,7 +13182,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13182 | amount_to_scroll = scroll_max; | 13182 | amount_to_scroll = scroll_max; |
| 13183 | else | 13183 | else |
| 13184 | { | 13184 | { |
| 13185 | aggressive = current_buffer->scroll_down_aggressively; | 13185 | aggressive = B_ (current_buffer, scroll_down_aggressively); |
| 13186 | height = WINDOW_BOX_TEXT_HEIGHT (w); | 13186 | height = WINDOW_BOX_TEXT_HEIGHT (w); |
| 13187 | if (NUMBERP (aggressive)) | 13187 | if (NUMBERP (aggressive)) |
| 13188 | { | 13188 | { |
| @@ -13363,7 +13363,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 13363 | region exists, cursor movement has to do more than just | 13363 | region exists, cursor movement has to do more than just |
| 13364 | set the cursor. */ | 13364 | set the cursor. */ |
| 13365 | && !(!NILP (Vtransient_mark_mode) | 13365 | && !(!NILP (Vtransient_mark_mode) |
| 13366 | && !NILP (current_buffer->mark_active)) | 13366 | && !NILP (B_ (current_buffer, mark_active))) |
| 13367 | && NILP (w->region_showing) | 13367 | && NILP (w->region_showing) |
| 13368 | && NILP (Vshow_trailing_whitespace) | 13368 | && NILP (Vshow_trailing_whitespace) |
| 13369 | /* Right after splitting windows, last_point may be nil. */ | 13369 | /* 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 | |||
| 13518 | must_scroll = 1; | 13518 | must_scroll = 1; |
| 13519 | } | 13519 | } |
| 13520 | else if (rc != CURSOR_MOVEMENT_SUCCESS | 13520 | else if (rc != CURSOR_MOVEMENT_SUCCESS |
| 13521 | && !NILP (XBUFFER (w->buffer)->bidi_display_reordering)) | 13521 | && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) |
| 13522 | { | 13522 | { |
| 13523 | /* If rows are bidi-reordered and point moved, back up | 13523 | /* If rows are bidi-reordered and point moved, back up |
| 13524 | until we find a row that does not belong to a | 13524 | 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 | |||
| 13576 | else if (scroll_p) | 13576 | else if (scroll_p) |
| 13577 | rc = CURSOR_MOVEMENT_MUST_SCROLL; | 13577 | rc = CURSOR_MOVEMENT_MUST_SCROLL; |
| 13578 | else if (rc != CURSOR_MOVEMENT_SUCCESS | 13578 | else if (rc != CURSOR_MOVEMENT_SUCCESS |
| 13579 | && !NILP (XBUFFER (w->buffer)->bidi_display_reordering)) | 13579 | && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) |
| 13580 | { | 13580 | { |
| 13581 | /* With bidi-reordered rows, there could be more than | 13581 | /* With bidi-reordered rows, there could be more than |
| 13582 | one candidate row whose start and end positions | 13582 | one candidate row whose start and end positions |
| @@ -13876,7 +13876,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 13876 | struct Lisp_Char_Table *disptab = buffer_display_table (); | 13876 | struct Lisp_Char_Table *disptab = buffer_display_table (); |
| 13877 | 13877 | ||
| 13878 | if (! disptab_matches_widthtab (disptab, | 13878 | if (! disptab_matches_widthtab (disptab, |
| 13879 | XVECTOR (current_buffer->width_table))) | 13879 | XVECTOR (B_ (current_buffer, width_table)))) |
| 13880 | { | 13880 | { |
| 13881 | invalidate_region_cache (current_buffer, | 13881 | invalidate_region_cache (current_buffer, |
| 13882 | current_buffer->width_run_cache, | 13882 | current_buffer->width_run_cache, |
| @@ -13998,7 +13998,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 13998 | /* If we are highlighting the region, then we just changed | 13998 | /* If we are highlighting the region, then we just changed |
| 13999 | the region, so redisplay to show it. */ | 13999 | the region, so redisplay to show it. */ |
| 14000 | if (!NILP (Vtransient_mark_mode) | 14000 | if (!NILP (Vtransient_mark_mode) |
| 14001 | && !NILP (current_buffer->mark_active)) | 14001 | && !NILP (B_ (current_buffer, mark_active))) |
| 14002 | { | 14002 | { |
| 14003 | clear_glyph_matrix (w->desired_matrix); | 14003 | clear_glyph_matrix (w->desired_matrix); |
| 14004 | if (!try_window (window, startp, 0)) | 14004 | if (!try_window (window, startp, 0)) |
| @@ -14161,8 +14161,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 14161 | if ((scroll_conservatively | 14161 | if ((scroll_conservatively |
| 14162 | || emacs_scroll_step | 14162 | || emacs_scroll_step |
| 14163 | || temp_scroll_step | 14163 | || temp_scroll_step |
| 14164 | || NUMBERP (current_buffer->scroll_up_aggressively) | 14164 | || NUMBERP (B_ (current_buffer, scroll_up_aggressively)) |
| 14165 | || NUMBERP (current_buffer->scroll_down_aggressively)) | 14165 | || NUMBERP (B_ (current_buffer, scroll_down_aggressively))) |
| 14166 | && !current_buffer->clip_changed | 14166 | && !current_buffer->clip_changed |
| 14167 | && CHARPOS (startp) >= BEGV | 14167 | && CHARPOS (startp) >= BEGV |
| 14168 | && CHARPOS (startp) <= ZV) | 14168 | && CHARPOS (startp) <= ZV) |
| @@ -14605,7 +14605,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 14605 | 14605 | ||
| 14606 | /* Can't do this if region may have changed. */ | 14606 | /* Can't do this if region may have changed. */ |
| 14607 | if ((!NILP (Vtransient_mark_mode) | 14607 | if ((!NILP (Vtransient_mark_mode) |
| 14608 | && !NILP (current_buffer->mark_active)) | 14608 | && !NILP (B_ (current_buffer, mark_active))) |
| 14609 | || !NILP (w->region_showing) | 14609 | || !NILP (w->region_showing) |
| 14610 | || !NILP (Vshow_trailing_whitespace)) | 14610 | || !NILP (Vshow_trailing_whitespace)) |
| 14611 | return 0; | 14611 | return 0; |
| @@ -14948,7 +14948,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 14948 | 14948 | ||
| 14949 | /* Can't use this optimization with bidi-reordered glyph | 14949 | /* Can't use this optimization with bidi-reordered glyph |
| 14950 | rows, unless cursor is already at point. */ | 14950 | rows, unless cursor is already at point. */ |
| 14951 | if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)) | 14951 | if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) |
| 14952 | { | 14952 | { |
| 14953 | if (!(w->cursor.hpos >= 0 | 14953 | if (!(w->cursor.hpos >= 0 |
| 14954 | && w->cursor.hpos < row->used[TEXT_AREA] | 14954 | && w->cursor.hpos < row->used[TEXT_AREA] |
| @@ -15262,7 +15262,7 @@ row_containing_pos (struct window *w, EMACS_INT charpos, | |||
| 15262 | { | 15262 | { |
| 15263 | struct glyph *g; | 15263 | struct glyph *g; |
| 15264 | 15264 | ||
| 15265 | if (NILP (XBUFFER (w->buffer)->bidi_display_reordering) | 15265 | if (NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) |
| 15266 | || (!best_row && !row->continued_p)) | 15266 | || (!best_row && !row->continued_p)) |
| 15267 | return row; | 15267 | return row; |
| 15268 | /* In bidi-reordered rows, there could be several rows | 15268 | /* In bidi-reordered rows, there could be several rows |
| @@ -15409,7 +15409,7 @@ try_window_id (struct window *w) | |||
| 15409 | /* Can't use this if highlighting a region because a cursor movement | 15409 | /* Can't use this if highlighting a region because a cursor movement |
| 15410 | will do more than just set the cursor. */ | 15410 | will do more than just set the cursor. */ |
| 15411 | if (!NILP (Vtransient_mark_mode) | 15411 | if (!NILP (Vtransient_mark_mode) |
| 15412 | && !NILP (current_buffer->mark_active)) | 15412 | && !NILP (B_ (current_buffer, mark_active))) |
| 15413 | GIVE_UP (9); | 15413 | GIVE_UP (9); |
| 15414 | 15414 | ||
| 15415 | /* Likewise if highlighting trailing whitespace. */ | 15415 | /* Likewise if highlighting trailing whitespace. */ |
| @@ -15429,7 +15429,7 @@ try_window_id (struct window *w) | |||
| 15429 | wrapped line can change the wrap position, altering the line | 15429 | wrapped line can change the wrap position, altering the line |
| 15430 | above it. It might be worthwhile to handle this more | 15430 | above it. It might be worthwhile to handle this more |
| 15431 | intelligently, but for now just redisplay from scratch. */ | 15431 | intelligently, but for now just redisplay from scratch. */ |
| 15432 | if (!NILP (XBUFFER (w->buffer)->word_wrap)) | 15432 | if (!NILP (B_ (XBUFFER (w->buffer), word_wrap))) |
| 15433 | GIVE_UP (21); | 15433 | GIVE_UP (21); |
| 15434 | 15434 | ||
| 15435 | /* Under bidi reordering, adding or deleting a character in the | 15435 | /* Under bidi reordering, adding or deleting a character in the |
| @@ -15440,8 +15440,8 @@ try_window_id (struct window *w) | |||
| 15440 | to find the paragraph limits and widen the range of redisplayed | 15440 | to find the paragraph limits and widen the range of redisplayed |
| 15441 | lines to that, but for now just give up this optimization and | 15441 | lines to that, but for now just give up this optimization and |
| 15442 | redisplay from scratch. */ | 15442 | redisplay from scratch. */ |
| 15443 | if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering) | 15443 | if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) |
| 15444 | && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction)) | 15444 | && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction))) |
| 15445 | GIVE_UP (22); | 15445 | GIVE_UP (22); |
| 15446 | 15446 | ||
| 15447 | /* Make sure beg_unchanged and end_unchanged are up to date. Do it | 15447 | /* 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) | |||
| 16412 | it.glyph_row->used[TEXT_AREA] = 0; | 16412 | it.glyph_row->used[TEXT_AREA] = 0; |
| 16413 | SET_TEXT_POS (it.position, 0, 0); | 16413 | SET_TEXT_POS (it.position, 0, 0); |
| 16414 | 16414 | ||
| 16415 | multibyte_p = !NILP (buffer->enable_multibyte_characters); | 16415 | multibyte_p = !NILP (B_ (buffer, enable_multibyte_characters)); |
| 16416 | p = arrow_string; | 16416 | p = arrow_string; |
| 16417 | while (p < arrow_end) | 16417 | while (p < arrow_end) |
| 16418 | { | 16418 | { |
| @@ -17347,7 +17347,7 @@ display_line (struct it *it) | |||
| 17347 | row->glyphs[TEXT_AREA]->charpos = -1; | 17347 | row->glyphs[TEXT_AREA]->charpos = -1; |
| 17348 | row->displays_text_p = 0; | 17348 | row->displays_text_p = 0; |
| 17349 | 17349 | ||
| 17350 | if (!NILP (XBUFFER (it->w->buffer)->indicate_empty_lines) | 17350 | if (!NILP (B_ (XBUFFER (it->w->buffer), indicate_empty_lines)) |
| 17351 | && (!MINI_WINDOW_P (it->w) | 17351 | && (!MINI_WINDOW_P (it->w) |
| 17352 | || (minibuf_level && EQ (it->window, minibuf_window)))) | 17352 | || (minibuf_level && EQ (it->window, minibuf_window)))) |
| 17353 | row->indicate_empty_line_p = 1; | 17353 | row->indicate_empty_line_p = 1; |
| @@ -17925,10 +17925,10 @@ See also `bidi-paragraph-direction'. */) | |||
| 17925 | old = current_buffer; | 17925 | old = current_buffer; |
| 17926 | } | 17926 | } |
| 17927 | 17927 | ||
| 17928 | if (NILP (buf->bidi_display_reordering)) | 17928 | if (NILP (B_ (buf, bidi_display_reordering))) |
| 17929 | return Qleft_to_right; | 17929 | return Qleft_to_right; |
| 17930 | else if (!NILP (buf->bidi_paragraph_direction)) | 17930 | else if (!NILP (B_ (buf, bidi_paragraph_direction))) |
| 17931 | return buf->bidi_paragraph_direction; | 17931 | return B_ (buf, bidi_paragraph_direction); |
| 17932 | else | 17932 | else |
| 17933 | { | 17933 | { |
| 17934 | /* Determine the direction from buffer text. We could try to | 17934 | /* Determine the direction from buffer text. We could try to |
| @@ -18187,14 +18187,14 @@ display_mode_lines (struct window *w) | |||
| 18187 | 18187 | ||
| 18188 | /* Select mode line face based on the real selected window. */ | 18188 | /* Select mode line face based on the real selected window. */ |
| 18189 | display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w), | 18189 | display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w), |
| 18190 | current_buffer->mode_line_format); | 18190 | B_ (current_buffer, mode_line_format)); |
| 18191 | ++n; | 18191 | ++n; |
| 18192 | } | 18192 | } |
| 18193 | 18193 | ||
| 18194 | if (WINDOW_WANTS_HEADER_LINE_P (w)) | 18194 | if (WINDOW_WANTS_HEADER_LINE_P (w)) |
| 18195 | { | 18195 | { |
| 18196 | display_mode_line (w, HEADER_LINE_FACE_ID, | 18196 | display_mode_line (w, HEADER_LINE_FACE_ID, |
| 18197 | current_buffer->header_line_format); | 18197 | B_ (current_buffer, header_line_format)); |
| 18198 | ++n; | 18198 | ++n; |
| 18199 | } | 18199 | } |
| 18200 | 18200 | ||
| @@ -19129,7 +19129,7 @@ static char * | |||
| 19129 | decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag) | 19129 | decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag) |
| 19130 | { | 19130 | { |
| 19131 | Lisp_Object val; | 19131 | Lisp_Object val; |
| 19132 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 19132 | int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); |
| 19133 | const unsigned char *eol_str; | 19133 | const unsigned char *eol_str; |
| 19134 | int eol_str_len; | 19134 | int eol_str_len; |
| 19135 | /* The EOL conversion we are using. */ | 19135 | /* The EOL conversion we are using. */ |
| @@ -19225,7 +19225,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19225 | switch (c) | 19225 | switch (c) |
| 19226 | { | 19226 | { |
| 19227 | case '*': | 19227 | case '*': |
| 19228 | if (!NILP (b->read_only)) | 19228 | if (!NILP (B_ (b, read_only))) |
| 19229 | return "%"; | 19229 | return "%"; |
| 19230 | if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) | 19230 | if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) |
| 19231 | return "*"; | 19231 | return "*"; |
| @@ -19235,7 +19235,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19235 | /* This differs from %* only for a modified read-only buffer. */ | 19235 | /* This differs from %* only for a modified read-only buffer. */ |
| 19236 | if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) | 19236 | if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) |
| 19237 | return "*"; | 19237 | return "*"; |
| 19238 | if (!NILP (b->read_only)) | 19238 | if (!NILP (B_ (b, read_only))) |
| 19239 | return "%"; | 19239 | return "%"; |
| 19240 | return "-"; | 19240 | return "-"; |
| 19241 | 19241 | ||
| @@ -19297,7 +19297,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19297 | } | 19297 | } |
| 19298 | 19298 | ||
| 19299 | case 'b': | 19299 | case 'b': |
| 19300 | obj = b->name; | 19300 | obj = B_ (b, name); |
| 19301 | break; | 19301 | break; |
| 19302 | 19302 | ||
| 19303 | case 'c': | 19303 | case 'c': |
| @@ -19337,7 +19337,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19337 | return "Emacs"; | 19337 | return "Emacs"; |
| 19338 | 19338 | ||
| 19339 | case 'f': | 19339 | case 'f': |
| 19340 | obj = b->filename; | 19340 | obj = B_ (b, filename); |
| 19341 | break; | 19341 | break; |
| 19342 | 19342 | ||
| 19343 | case 'i': | 19343 | case 'i': |
| @@ -19473,7 +19473,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19473 | break; | 19473 | break; |
| 19474 | 19474 | ||
| 19475 | case 'm': | 19475 | case 'm': |
| 19476 | obj = b->mode_name; | 19476 | obj = B_ (b, mode_name); |
| 19477 | break; | 19477 | break; |
| 19478 | 19478 | ||
| 19479 | case 'n': | 19479 | case 'n': |
| @@ -19558,7 +19558,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19558 | { | 19558 | { |
| 19559 | int count = inhibit_garbage_collection (); | 19559 | int count = inhibit_garbage_collection (); |
| 19560 | Lisp_Object val = call1 (intern ("file-remote-p"), | 19560 | Lisp_Object val = call1 (intern ("file-remote-p"), |
| 19561 | current_buffer->directory); | 19561 | B_ (current_buffer, directory)); |
| 19562 | unbind_to (count, Qnil); | 19562 | unbind_to (count, Qnil); |
| 19563 | 19563 | ||
| 19564 | if (NILP (val)) | 19564 | if (NILP (val)) |
| @@ -19593,7 +19593,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19593 | (FRAME_TERMINAL_CODING (f)->id), | 19593 | (FRAME_TERMINAL_CODING (f)->id), |
| 19594 | p, 0); | 19594 | p, 0); |
| 19595 | } | 19595 | } |
| 19596 | p = decode_mode_spec_coding (b->buffer_file_coding_system, | 19596 | p = decode_mode_spec_coding (B_ (b, buffer_file_coding_system), |
| 19597 | p, eol_flag); | 19597 | p, eol_flag); |
| 19598 | 19598 | ||
| 19599 | #if 0 /* This proves to be annoying; I think we can do without. -- rms. */ | 19599 | #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, | |||
| 19643 | 19643 | ||
| 19644 | /* If we are not in selective display mode, | 19644 | /* If we are not in selective display mode, |
| 19645 | check only for newlines. */ | 19645 | check only for newlines. */ |
| 19646 | int selective_display = (!NILP (current_buffer->selective_display) | 19646 | int selective_display = (!NILP (B_ (current_buffer, selective_display)) |
| 19647 | && !INTEGERP (current_buffer->selective_display)); | 19647 | && !INTEGERP (B_ (current_buffer, selective_display))); |
| 19648 | 19648 | ||
| 19649 | if (count > 0) | 19649 | if (count > 0) |
| 19650 | { | 19650 | { |
| @@ -23291,13 +23291,13 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, | |||
| 23291 | { | 23291 | { |
| 23292 | if (w == XWINDOW (echo_area_window)) | 23292 | if (w == XWINDOW (echo_area_window)) |
| 23293 | { | 23293 | { |
| 23294 | if (EQ (b->cursor_type, Qt) || NILP (b->cursor_type)) | 23294 | if (EQ (B_ (b, cursor_type), Qt) || NILP (B_ (b, cursor_type))) |
| 23295 | { | 23295 | { |
| 23296 | *width = FRAME_CURSOR_WIDTH (f); | 23296 | *width = FRAME_CURSOR_WIDTH (f); |
| 23297 | return FRAME_DESIRED_CURSOR (f); | 23297 | return FRAME_DESIRED_CURSOR (f); |
| 23298 | } | 23298 | } |
| 23299 | else | 23299 | else |
| 23300 | return get_specified_cursor_type (b->cursor_type, width); | 23300 | return get_specified_cursor_type (B_ (b, cursor_type), width); |
| 23301 | } | 23301 | } |
| 23302 | 23302 | ||
| 23303 | *active_cursor = 0; | 23303 | *active_cursor = 0; |
| @@ -23317,23 +23317,23 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, | |||
| 23317 | } | 23317 | } |
| 23318 | 23318 | ||
| 23319 | /* Never display a cursor in a window in which cursor-type is nil. */ | 23319 | /* Never display a cursor in a window in which cursor-type is nil. */ |
| 23320 | if (NILP (b->cursor_type)) | 23320 | if (NILP (B_ (b, cursor_type))) |
| 23321 | return NO_CURSOR; | 23321 | return NO_CURSOR; |
| 23322 | 23322 | ||
| 23323 | /* Get the normal cursor type for this window. */ | 23323 | /* Get the normal cursor type for this window. */ |
| 23324 | if (EQ (b->cursor_type, Qt)) | 23324 | if (EQ (B_ (b, cursor_type), Qt)) |
| 23325 | { | 23325 | { |
| 23326 | cursor_type = FRAME_DESIRED_CURSOR (f); | 23326 | cursor_type = FRAME_DESIRED_CURSOR (f); |
| 23327 | *width = FRAME_CURSOR_WIDTH (f); | 23327 | *width = FRAME_CURSOR_WIDTH (f); |
| 23328 | } | 23328 | } |
| 23329 | else | 23329 | else |
| 23330 | cursor_type = get_specified_cursor_type (b->cursor_type, width); | 23330 | cursor_type = get_specified_cursor_type (B_ (b, cursor_type), width); |
| 23331 | 23331 | ||
| 23332 | /* Use cursor-in-non-selected-windows instead | 23332 | /* Use cursor-in-non-selected-windows instead |
| 23333 | for non-selected window or frame. */ | 23333 | for non-selected window or frame. */ |
| 23334 | if (non_selected) | 23334 | if (non_selected) |
| 23335 | { | 23335 | { |
| 23336 | alt_cursor = b->cursor_in_non_selected_windows; | 23336 | alt_cursor = B_ (b, cursor_in_non_selected_windows); |
| 23337 | if (!EQ (Qt, alt_cursor)) | 23337 | if (!EQ (Qt, alt_cursor)) |
| 23338 | return get_specified_cursor_type (alt_cursor, width); | 23338 | return get_specified_cursor_type (alt_cursor, width); |
| 23339 | /* t means modify the normal cursor type. */ | 23339 | /* t means modify the normal cursor type. */ |
| @@ -23380,7 +23380,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, | |||
| 23380 | /* Cursor is blinked off, so determine how to "toggle" it. */ | 23380 | /* Cursor is blinked off, so determine how to "toggle" it. */ |
| 23381 | 23381 | ||
| 23382 | /* First look for an entry matching the buffer's cursor-type in blink-cursor-alist. */ | 23382 | /* First look for an entry matching the buffer's cursor-type in blink-cursor-alist. */ |
| 23383 | if ((alt_cursor = Fassoc (b->cursor_type, Vblink_cursor_alist), !NILP (alt_cursor))) | 23383 | if ((alt_cursor = Fassoc (B_ (b, cursor_type), Vblink_cursor_alist), !NILP (alt_cursor))) |
| 23384 | return get_specified_cursor_type (XCDR (alt_cursor), width); | 23384 | return get_specified_cursor_type (XCDR (alt_cursor), width); |
| 23385 | 23385 | ||
| 23386 | /* Then see if frame has specified a specific blink off cursor type. */ | 23386 | /* 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) | |||
| 25496 | necessarily display the character whose position | 25496 | necessarily display the character whose position |
| 25497 | is the smallest. */ | 25497 | is the smallest. */ |
| 25498 | Lisp_Object lim1 = | 25498 | Lisp_Object lim1 = |
| 25499 | NILP (XBUFFER (buffer)->bidi_display_reordering) | 25499 | NILP (B_ (XBUFFER (buffer), bidi_display_reordering)) |
| 25500 | ? Fmarker_position (w->start) | 25500 | ? Fmarker_position (w->start) |
| 25501 | : Qnil; | 25501 | : Qnil; |
| 25502 | Lisp_Object lim2 = | 25502 | Lisp_Object lim2 = |
| 25503 | NILP (XBUFFER (buffer)->bidi_display_reordering) | 25503 | NILP (B_ (XBUFFER (buffer), bidi_display_reordering)) |
| 25504 | ? make_number (BUF_Z (XBUFFER (buffer)) | 25504 | ? make_number (BUF_Z (XBUFFER (buffer)) |
| 25505 | - XFASTINT (w->window_end_pos)) | 25505 | - XFASTINT (w->window_end_pos)) |
| 25506 | : Qnil; | 25506 | : 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) | |||
| 5970 | { | 5970 | { |
| 5971 | int face_id; | 5971 | int face_id; |
| 5972 | 5972 | ||
| 5973 | if (NILP (current_buffer->enable_multibyte_characters)) | 5973 | if (NILP (B_ (current_buffer, enable_multibyte_characters))) |
| 5974 | ch = 0; | 5974 | ch = 0; |
| 5975 | 5975 | ||
| 5976 | if (NILP (prop)) | 5976 | if (NILP (prop)) |
diff --git a/src/xfns.c b/src/xfns.c index ce2d91e0df1..062bb105d0a 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -4610,7 +4610,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4610 | Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); | 4610 | Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); |
| 4611 | old_buffer = current_buffer; | 4611 | old_buffer = current_buffer; |
| 4612 | set_buffer_internal_1 (XBUFFER (buffer)); | 4612 | set_buffer_internal_1 (XBUFFER (buffer)); |
| 4613 | current_buffer->truncate_lines = Qnil; | 4613 | B_ (current_buffer, truncate_lines) = Qnil; |
| 4614 | specbind (Qinhibit_read_only, Qt); | 4614 | specbind (Qinhibit_read_only, Qt); |
| 4615 | specbind (Qinhibit_modification_hooks, Qt); | 4615 | specbind (Qinhibit_modification_hooks, Qt); |
| 4616 | Ferase_buffer (); | 4616 | Ferase_buffer (); |
| @@ -5106,7 +5106,7 @@ Text larger than the specified size is clipped. */) | |||
| 5106 | /* Display the tooltip text in a temporary buffer. */ | 5106 | /* Display the tooltip text in a temporary buffer. */ |
| 5107 | old_buffer = current_buffer; | 5107 | old_buffer = current_buffer; |
| 5108 | set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); | 5108 | set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); |
| 5109 | current_buffer->truncate_lines = Qnil; | 5109 | B_ (current_buffer, truncate_lines) = Qnil; |
| 5110 | clear_glyph_matrix (w->desired_matrix); | 5110 | clear_glyph_matrix (w->desired_matrix); |
| 5111 | clear_glyph_matrix (w->current_matrix); | 5111 | clear_glyph_matrix (w->current_matrix); |
| 5112 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 5112 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |