aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c161
1 files changed, 89 insertions, 72 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 2ea69f38f91..6bff57fe12e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5035,6 +5035,93 @@ init_buffer_once (void)
5035 5035
5036 memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); 5036 memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags);
5037 5037
5038 /* 0 means not a lisp var, -1 means always local, else mask. */
5039 memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
5040 bset_filename (&buffer_local_flags, make_number (-1));
5041 bset_directory (&buffer_local_flags, make_number (-1));
5042 bset_backed_up (&buffer_local_flags, make_number (-1));
5043 bset_save_length (&buffer_local_flags, make_number (-1));
5044 bset_auto_save_file_name (&buffer_local_flags, make_number (-1));
5045 bset_read_only (&buffer_local_flags, make_number (-1));
5046 bset_major_mode (&buffer_local_flags, make_number (-1));
5047 bset_mode_name (&buffer_local_flags, make_number (-1));
5048 bset_undo_list (&buffer_local_flags, make_number (-1));
5049 bset_mark_active (&buffer_local_flags, make_number (-1));
5050 bset_point_before_scroll (&buffer_local_flags, make_number (-1));
5051 bset_file_truename (&buffer_local_flags, make_number (-1));
5052 bset_invisibility_spec (&buffer_local_flags, make_number (-1));
5053 bset_file_format (&buffer_local_flags, make_number (-1));
5054 bset_auto_save_file_format (&buffer_local_flags, make_number (-1));
5055 bset_display_count (&buffer_local_flags, make_number (-1));
5056 bset_display_time (&buffer_local_flags, make_number (-1));
5057 bset_enable_multibyte_characters (&buffer_local_flags, make_number (-1));
5058
5059 /* These used to be stuck at 0 by default, but now that the all-zero value
5060 means Qnil, we have to initialize them explicitly. */
5061 bset_name (&buffer_local_flags, make_number (0));
5062 bset_mark (&buffer_local_flags, make_number (0));
5063 bset_local_var_alist (&buffer_local_flags, make_number (0));
5064 bset_keymap (&buffer_local_flags, make_number (0));
5065 bset_downcase_table (&buffer_local_flags, make_number (0));
5066 bset_upcase_table (&buffer_local_flags, make_number (0));
5067 bset_case_canon_table (&buffer_local_flags, make_number (0));
5068 bset_case_eqv_table (&buffer_local_flags, make_number (0));
5069 bset_minor_modes (&buffer_local_flags, make_number (0));
5070 bset_width_table (&buffer_local_flags, make_number (0));
5071 bset_pt_marker (&buffer_local_flags, make_number (0));
5072 bset_begv_marker (&buffer_local_flags, make_number (0));
5073 bset_zv_marker (&buffer_local_flags, make_number (0));
5074 bset_last_selected_window (&buffer_local_flags, make_number (0));
5075
5076 idx = 1;
5077 XSETFASTINT (BVAR (&buffer_local_flags, mode_line_format), idx); ++idx;
5078 XSETFASTINT (BVAR (&buffer_local_flags, abbrev_mode), idx); ++idx;
5079 XSETFASTINT (BVAR (&buffer_local_flags, overwrite_mode), idx); ++idx;
5080 XSETFASTINT (BVAR (&buffer_local_flags, case_fold_search), idx); ++idx;
5081 XSETFASTINT (BVAR (&buffer_local_flags, auto_fill_function), idx); ++idx;
5082 XSETFASTINT (BVAR (&buffer_local_flags, selective_display), idx); ++idx;
5083 XSETFASTINT (BVAR (&buffer_local_flags, selective_display_ellipses), idx); ++idx;
5084 XSETFASTINT (BVAR (&buffer_local_flags, tab_width), idx); ++idx;
5085 XSETFASTINT (BVAR (&buffer_local_flags, truncate_lines), idx); ++idx;
5086 XSETFASTINT (BVAR (&buffer_local_flags, word_wrap), idx); ++idx;
5087 XSETFASTINT (BVAR (&buffer_local_flags, ctl_arrow), idx); ++idx;
5088 XSETFASTINT (BVAR (&buffer_local_flags, fill_column), idx); ++idx;
5089 XSETFASTINT (BVAR (&buffer_local_flags, left_margin), idx); ++idx;
5090 XSETFASTINT (BVAR (&buffer_local_flags, abbrev_table), idx); ++idx;
5091 XSETFASTINT (BVAR (&buffer_local_flags, display_table), idx); ++idx;
5092 XSETFASTINT (BVAR (&buffer_local_flags, syntax_table), idx); ++idx;
5093 XSETFASTINT (BVAR (&buffer_local_flags, cache_long_scans), idx); ++idx;
5094 XSETFASTINT (BVAR (&buffer_local_flags, category_table), idx); ++idx;
5095 XSETFASTINT (BVAR (&buffer_local_flags, bidi_display_reordering), idx); ++idx;
5096 XSETFASTINT (BVAR (&buffer_local_flags, bidi_paragraph_direction), idx); ++idx;
5097 XSETFASTINT (BVAR (&buffer_local_flags, buffer_file_coding_system), idx);
5098 /* Make this one a permanent local. */
5099 buffer_permanent_local_flags[idx++] = 1;
5100 XSETFASTINT (BVAR (&buffer_local_flags, left_margin_cols), idx); ++idx;
5101 XSETFASTINT (BVAR (&buffer_local_flags, right_margin_cols), idx); ++idx;
5102 XSETFASTINT (BVAR (&buffer_local_flags, left_fringe_width), idx); ++idx;
5103 XSETFASTINT (BVAR (&buffer_local_flags, right_fringe_width), idx); ++idx;
5104 XSETFASTINT (BVAR (&buffer_local_flags, fringes_outside_margins), idx); ++idx;
5105 XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_width), idx); ++idx;
5106 XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_height), idx); ++idx;
5107 XSETFASTINT (BVAR (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx;
5108 XSETFASTINT (BVAR (&buffer_local_flags, horizontal_scroll_bar_type), idx); ++idx;
5109 XSETFASTINT (BVAR (&buffer_local_flags, indicate_empty_lines), idx); ++idx;
5110 XSETFASTINT (BVAR (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx;
5111 XSETFASTINT (BVAR (&buffer_local_flags, fringe_indicator_alist), idx); ++idx;
5112 XSETFASTINT (BVAR (&buffer_local_flags, fringe_cursor_alist), idx); ++idx;
5113 XSETFASTINT (BVAR (&buffer_local_flags, scroll_up_aggressively), idx); ++idx;
5114 XSETFASTINT (BVAR (&buffer_local_flags, scroll_down_aggressively), idx); ++idx;
5115 XSETFASTINT (BVAR (&buffer_local_flags, header_line_format), idx); ++idx;
5116 XSETFASTINT (BVAR (&buffer_local_flags, cursor_type), idx); ++idx;
5117 XSETFASTINT (BVAR (&buffer_local_flags, extra_line_spacing), idx); ++idx;
5118 XSETFASTINT (BVAR (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx;
5119
5120 /* Need more room? */
5121 if (idx >= MAX_PER_BUFFER_VARS)
5122 emacs_abort ();
5123 last_per_buffer_idx = idx;
5124
5038 /* Make sure all markable slots in buffer_defaults 5125 /* Make sure all markable slots in buffer_defaults
5039 are initialized reasonably, so mark_buffer won't choke. */ 5126 are initialized reasonably, so mark_buffer won't choke. */
5040 reset_buffer (&buffer_defaults); 5127 reset_buffer (&buffer_defaults);
@@ -5121,79 +5208,9 @@ init_buffer_once (void)
5121 to say that it has its own local value for the slot. 5208 to say that it has its own local value for the slot.
5122 The local flag bits are in the local_var_flags slot of the buffer. */ 5209 The local flag bits are in the local_var_flags slot of the buffer. */
5123 5210
5124 /* Nothing can work if this isn't true */ 5211 /* Nothing can work if this isn't true. */
5125 { verify (sizeof (EMACS_INT) == word_size); } 5212 { verify (sizeof (EMACS_INT) == word_size); }
5126 5213
5127 /* 0 means not a lisp var, -1 means always local, else mask */
5128 memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
5129 bset_filename (&buffer_local_flags, make_number (-1));
5130 bset_directory (&buffer_local_flags, make_number (-1));
5131 bset_backed_up (&buffer_local_flags, make_number (-1));
5132 bset_save_length (&buffer_local_flags, make_number (-1));
5133 bset_auto_save_file_name (&buffer_local_flags, make_number (-1));
5134 bset_read_only (&buffer_local_flags, make_number (-1));
5135 bset_major_mode (&buffer_local_flags, make_number (-1));
5136 bset_mode_name (&buffer_local_flags, make_number (-1));
5137 bset_undo_list (&buffer_local_flags, make_number (-1));
5138 bset_mark_active (&buffer_local_flags, make_number (-1));
5139 bset_point_before_scroll (&buffer_local_flags, make_number (-1));
5140 bset_file_truename (&buffer_local_flags, make_number (-1));
5141 bset_invisibility_spec (&buffer_local_flags, make_number (-1));
5142 bset_file_format (&buffer_local_flags, make_number (-1));
5143 bset_auto_save_file_format (&buffer_local_flags, make_number (-1));
5144 bset_display_count (&buffer_local_flags, make_number (-1));
5145 bset_display_time (&buffer_local_flags, make_number (-1));
5146 bset_enable_multibyte_characters (&buffer_local_flags, make_number (-1));
5147
5148 idx = 1;
5149 XSETFASTINT (BVAR (&buffer_local_flags, mode_line_format), idx); ++idx;
5150 XSETFASTINT (BVAR (&buffer_local_flags, abbrev_mode), idx); ++idx;
5151 XSETFASTINT (BVAR (&buffer_local_flags, overwrite_mode), idx); ++idx;
5152 XSETFASTINT (BVAR (&buffer_local_flags, case_fold_search), idx); ++idx;
5153 XSETFASTINT (BVAR (&buffer_local_flags, auto_fill_function), idx); ++idx;
5154 XSETFASTINT (BVAR (&buffer_local_flags, selective_display), idx); ++idx;
5155 XSETFASTINT (BVAR (&buffer_local_flags, selective_display_ellipses), idx); ++idx;
5156 XSETFASTINT (BVAR (&buffer_local_flags, tab_width), idx); ++idx;
5157 XSETFASTINT (BVAR (&buffer_local_flags, truncate_lines), idx); ++idx;
5158 XSETFASTINT (BVAR (&buffer_local_flags, word_wrap), idx); ++idx;
5159 XSETFASTINT (BVAR (&buffer_local_flags, ctl_arrow), idx); ++idx;
5160 XSETFASTINT (BVAR (&buffer_local_flags, fill_column), idx); ++idx;
5161 XSETFASTINT (BVAR (&buffer_local_flags, left_margin), idx); ++idx;
5162 XSETFASTINT (BVAR (&buffer_local_flags, abbrev_table), idx); ++idx;
5163 XSETFASTINT (BVAR (&buffer_local_flags, display_table), idx); ++idx;
5164 XSETFASTINT (BVAR (&buffer_local_flags, syntax_table), idx); ++idx;
5165 XSETFASTINT (BVAR (&buffer_local_flags, cache_long_scans), idx); ++idx;
5166 XSETFASTINT (BVAR (&buffer_local_flags, category_table), idx); ++idx;
5167 XSETFASTINT (BVAR (&buffer_local_flags, bidi_display_reordering), idx); ++idx;
5168 XSETFASTINT (BVAR (&buffer_local_flags, bidi_paragraph_direction), idx); ++idx;
5169 XSETFASTINT (BVAR (&buffer_local_flags, buffer_file_coding_system), idx);
5170 /* Make this one a permanent local. */
5171 buffer_permanent_local_flags[idx++] = 1;
5172 XSETFASTINT (BVAR (&buffer_local_flags, left_margin_cols), idx); ++idx;
5173 XSETFASTINT (BVAR (&buffer_local_flags, right_margin_cols), idx); ++idx;
5174 XSETFASTINT (BVAR (&buffer_local_flags, left_fringe_width), idx); ++idx;
5175 XSETFASTINT (BVAR (&buffer_local_flags, right_fringe_width), idx); ++idx;
5176 XSETFASTINT (BVAR (&buffer_local_flags, fringes_outside_margins), idx); ++idx;
5177 XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_width), idx); ++idx;
5178 XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_height), idx); ++idx;
5179 XSETFASTINT (BVAR (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx;
5180 XSETFASTINT (BVAR (&buffer_local_flags, horizontal_scroll_bar_type), idx); ++idx;
5181 XSETFASTINT (BVAR (&buffer_local_flags, indicate_empty_lines), idx); ++idx;
5182 XSETFASTINT (BVAR (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx;
5183 XSETFASTINT (BVAR (&buffer_local_flags, fringe_indicator_alist), idx); ++idx;
5184 XSETFASTINT (BVAR (&buffer_local_flags, fringe_cursor_alist), idx); ++idx;
5185 XSETFASTINT (BVAR (&buffer_local_flags, scroll_up_aggressively), idx); ++idx;
5186 XSETFASTINT (BVAR (&buffer_local_flags, scroll_down_aggressively), idx); ++idx;
5187 XSETFASTINT (BVAR (&buffer_local_flags, header_line_format), idx); ++idx;
5188 XSETFASTINT (BVAR (&buffer_local_flags, cursor_type), idx); ++idx;
5189 XSETFASTINT (BVAR (&buffer_local_flags, extra_line_spacing), idx); ++idx;
5190 XSETFASTINT (BVAR (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx;
5191
5192 /* Need more room? */
5193 if (idx >= MAX_PER_BUFFER_VARS)
5194 emacs_abort ();
5195 last_per_buffer_idx = idx;
5196
5197 Vbuffer_alist = Qnil; 5214 Vbuffer_alist = Qnil;
5198 current_buffer = 0; 5215 current_buffer = 0;
5199 all_buffers = 0; 5216 all_buffers = 0;
@@ -5210,7 +5227,7 @@ init_buffer_once (void)
5210 DEFSYM (Qkill_buffer_hook, "kill-buffer-hook"); 5227 DEFSYM (Qkill_buffer_hook, "kill-buffer-hook");
5211 Fput (Qkill_buffer_hook, Qpermanent_local, Qt); 5228 Fput (Qkill_buffer_hook, Qpermanent_local, Qt);
5212 5229
5213 /* super-magic invisible buffer */ 5230 /* Super-magic invisible buffer. */
5214 Vprin1_to_string_buffer = Fget_buffer_create (build_pure_c_string (" prin1")); 5231 Vprin1_to_string_buffer = Fget_buffer_create (build_pure_c_string (" prin1"));
5215 Vbuffer_alist = Qnil; 5232 Vbuffer_alist = Qnil;
5216 5233