aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorKenichi Handa2012-10-06 21:55:09 +0900
committerKenichi Handa2012-10-06 21:55:09 +0900
commit16ddec7e9e6adcf615db097d9627d490ca29208c (patch)
tree1c16b9565c9cca81ec8f5b10f0f4110340d4654a /src/buffer.c
parent2b89bca49d55cec1a004353354a76de2972c68f3 (diff)
parentd5acb99a199d83cde1a43482709c3e9d4ec34b2f (diff)
downloademacs-16ddec7e9e6adcf615db097d9627d490ca29208c.tar.gz
emacs-16ddec7e9e6adcf615db097d9627d490ca29208c.zip
merge trunk
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c106
1 files changed, 52 insertions, 54 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 356a308fce6..425d05ca790 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -150,222 +150,222 @@ static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t);
150static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); 150static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool);
151 151
152/* These setters are used only in this file, so they can be private. */ 152/* These setters are used only in this file, so they can be private. */
153static inline void 153static void
154bset_abbrev_mode (struct buffer *b, Lisp_Object val) 154bset_abbrev_mode (struct buffer *b, Lisp_Object val)
155{ 155{
156 b->INTERNAL_FIELD (abbrev_mode) = val; 156 b->INTERNAL_FIELD (abbrev_mode) = val;
157} 157}
158static inline void 158static void
159bset_abbrev_table (struct buffer *b, Lisp_Object val) 159bset_abbrev_table (struct buffer *b, Lisp_Object val)
160{ 160{
161 b->INTERNAL_FIELD (abbrev_table) = val; 161 b->INTERNAL_FIELD (abbrev_table) = val;
162} 162}
163static inline void 163static void
164bset_auto_fill_function (struct buffer *b, Lisp_Object val) 164bset_auto_fill_function (struct buffer *b, Lisp_Object val)
165{ 165{
166 b->INTERNAL_FIELD (auto_fill_function) = val; 166 b->INTERNAL_FIELD (auto_fill_function) = val;
167} 167}
168static inline void 168static void
169bset_auto_save_file_format (struct buffer *b, Lisp_Object val) 169bset_auto_save_file_format (struct buffer *b, Lisp_Object val)
170{ 170{
171 b->INTERNAL_FIELD (auto_save_file_format) = val; 171 b->INTERNAL_FIELD (auto_save_file_format) = val;
172} 172}
173static inline void 173static void
174bset_auto_save_file_name (struct buffer *b, Lisp_Object val) 174bset_auto_save_file_name (struct buffer *b, Lisp_Object val)
175{ 175{
176 b->INTERNAL_FIELD (auto_save_file_name) = val; 176 b->INTERNAL_FIELD (auto_save_file_name) = val;
177} 177}
178static inline void 178static void
179bset_backed_up (struct buffer *b, Lisp_Object val) 179bset_backed_up (struct buffer *b, Lisp_Object val)
180{ 180{
181 b->INTERNAL_FIELD (backed_up) = val; 181 b->INTERNAL_FIELD (backed_up) = val;
182} 182}
183static inline void 183static void
184bset_begv_marker (struct buffer *b, Lisp_Object val) 184bset_begv_marker (struct buffer *b, Lisp_Object val)
185{ 185{
186 b->INTERNAL_FIELD (begv_marker) = val; 186 b->INTERNAL_FIELD (begv_marker) = val;
187} 187}
188static inline void 188static void
189bset_bidi_display_reordering (struct buffer *b, Lisp_Object val) 189bset_bidi_display_reordering (struct buffer *b, Lisp_Object val)
190{ 190{
191 b->INTERNAL_FIELD (bidi_display_reordering) = val; 191 b->INTERNAL_FIELD (bidi_display_reordering) = val;
192} 192}
193static inline void 193static void
194bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val) 194bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val)
195{ 195{
196 b->INTERNAL_FIELD (buffer_file_coding_system) = val; 196 b->INTERNAL_FIELD (buffer_file_coding_system) = val;
197} 197}
198static inline void 198static void
199bset_cache_long_line_scans (struct buffer *b, Lisp_Object val) 199bset_cache_long_line_scans (struct buffer *b, Lisp_Object val)
200{ 200{
201 b->INTERNAL_FIELD (cache_long_line_scans) = val; 201 b->INTERNAL_FIELD (cache_long_line_scans) = val;
202} 202}
203static inline void 203static void
204bset_case_fold_search (struct buffer *b, Lisp_Object val) 204bset_case_fold_search (struct buffer *b, Lisp_Object val)
205{ 205{
206 b->INTERNAL_FIELD (case_fold_search) = val; 206 b->INTERNAL_FIELD (case_fold_search) = val;
207} 207}
208static inline void 208static void
209bset_ctl_arrow (struct buffer *b, Lisp_Object val) 209bset_ctl_arrow (struct buffer *b, Lisp_Object val)
210{ 210{
211 b->INTERNAL_FIELD (ctl_arrow) = val; 211 b->INTERNAL_FIELD (ctl_arrow) = val;
212} 212}
213static inline void 213static void
214bset_cursor_in_non_selected_windows (struct buffer *b, Lisp_Object val) 214bset_cursor_in_non_selected_windows (struct buffer *b, Lisp_Object val)
215{ 215{
216 b->INTERNAL_FIELD (cursor_in_non_selected_windows) = val; 216 b->INTERNAL_FIELD (cursor_in_non_selected_windows) = val;
217} 217}
218static inline void 218static void
219bset_cursor_type (struct buffer *b, Lisp_Object val) 219bset_cursor_type (struct buffer *b, Lisp_Object val)
220{ 220{
221 b->INTERNAL_FIELD (cursor_type) = val; 221 b->INTERNAL_FIELD (cursor_type) = val;
222} 222}
223static inline void 223static void
224bset_display_table (struct buffer *b, Lisp_Object val) 224bset_display_table (struct buffer *b, Lisp_Object val)
225{ 225{
226 b->INTERNAL_FIELD (display_table) = val; 226 b->INTERNAL_FIELD (display_table) = val;
227} 227}
228static inline void 228static void
229bset_extra_line_spacing (struct buffer *b, Lisp_Object val) 229bset_extra_line_spacing (struct buffer *b, Lisp_Object val)
230{ 230{
231 b->INTERNAL_FIELD (extra_line_spacing) = val; 231 b->INTERNAL_FIELD (extra_line_spacing) = val;
232} 232}
233static inline void 233static void
234bset_file_format (struct buffer *b, Lisp_Object val) 234bset_file_format (struct buffer *b, Lisp_Object val)
235{ 235{
236 b->INTERNAL_FIELD (file_format) = val; 236 b->INTERNAL_FIELD (file_format) = val;
237} 237}
238static inline void 238static void
239bset_file_truename (struct buffer *b, Lisp_Object val) 239bset_file_truename (struct buffer *b, Lisp_Object val)
240{ 240{
241 b->INTERNAL_FIELD (file_truename) = val; 241 b->INTERNAL_FIELD (file_truename) = val;
242} 242}
243static inline void 243static void
244bset_fringe_cursor_alist (struct buffer *b, Lisp_Object val) 244bset_fringe_cursor_alist (struct buffer *b, Lisp_Object val)
245{ 245{
246 b->INTERNAL_FIELD (fringe_cursor_alist) = val; 246 b->INTERNAL_FIELD (fringe_cursor_alist) = val;
247} 247}
248static inline void 248static void
249bset_fringe_indicator_alist (struct buffer *b, Lisp_Object val) 249bset_fringe_indicator_alist (struct buffer *b, Lisp_Object val)
250{ 250{
251 b->INTERNAL_FIELD (fringe_indicator_alist) = val; 251 b->INTERNAL_FIELD (fringe_indicator_alist) = val;
252} 252}
253static inline void 253static void
254bset_fringes_outside_margins (struct buffer *b, Lisp_Object val) 254bset_fringes_outside_margins (struct buffer *b, Lisp_Object val)
255{ 255{
256 b->INTERNAL_FIELD (fringes_outside_margins) = val; 256 b->INTERNAL_FIELD (fringes_outside_margins) = val;
257} 257}
258static inline void 258static void
259bset_header_line_format (struct buffer *b, Lisp_Object val) 259bset_header_line_format (struct buffer *b, Lisp_Object val)
260{ 260{
261 b->INTERNAL_FIELD (header_line_format) = val; 261 b->INTERNAL_FIELD (header_line_format) = val;
262} 262}
263static inline void 263static void
264bset_indicate_buffer_boundaries (struct buffer *b, Lisp_Object val) 264bset_indicate_buffer_boundaries (struct buffer *b, Lisp_Object val)
265{ 265{
266 b->INTERNAL_FIELD (indicate_buffer_boundaries) = val; 266 b->INTERNAL_FIELD (indicate_buffer_boundaries) = val;
267} 267}
268static inline void 268static void
269bset_indicate_empty_lines (struct buffer *b, Lisp_Object val) 269bset_indicate_empty_lines (struct buffer *b, Lisp_Object val)
270{ 270{
271 b->INTERNAL_FIELD (indicate_empty_lines) = val; 271 b->INTERNAL_FIELD (indicate_empty_lines) = val;
272} 272}
273static inline void 273static void
274bset_invisibility_spec (struct buffer *b, Lisp_Object val) 274bset_invisibility_spec (struct buffer *b, Lisp_Object val)
275{ 275{
276 b->INTERNAL_FIELD (invisibility_spec) = val; 276 b->INTERNAL_FIELD (invisibility_spec) = val;
277} 277}
278static inline void 278static void
279bset_left_fringe_width (struct buffer *b, Lisp_Object val) 279bset_left_fringe_width (struct buffer *b, Lisp_Object val)
280{ 280{
281 b->INTERNAL_FIELD (left_fringe_width) = val; 281 b->INTERNAL_FIELD (left_fringe_width) = val;
282} 282}
283static inline void 283static void
284bset_major_mode (struct buffer *b, Lisp_Object val) 284bset_major_mode (struct buffer *b, Lisp_Object val)
285{ 285{
286 b->INTERNAL_FIELD (major_mode) = val; 286 b->INTERNAL_FIELD (major_mode) = val;
287} 287}
288static inline void 288static void
289bset_mark (struct buffer *b, Lisp_Object val) 289bset_mark (struct buffer *b, Lisp_Object val)
290{ 290{
291 b->INTERNAL_FIELD (mark) = val; 291 b->INTERNAL_FIELD (mark) = val;
292} 292}
293static inline void 293static void
294bset_minor_modes (struct buffer *b, Lisp_Object val) 294bset_minor_modes (struct buffer *b, Lisp_Object val)
295{ 295{
296 b->INTERNAL_FIELD (minor_modes) = val; 296 b->INTERNAL_FIELD (minor_modes) = val;
297} 297}
298static inline void 298static void
299bset_mode_line_format (struct buffer *b, Lisp_Object val) 299bset_mode_line_format (struct buffer *b, Lisp_Object val)
300{ 300{
301 b->INTERNAL_FIELD (mode_line_format) = val; 301 b->INTERNAL_FIELD (mode_line_format) = val;
302} 302}
303static inline void 303static void
304bset_mode_name (struct buffer *b, Lisp_Object val) 304bset_mode_name (struct buffer *b, Lisp_Object val)
305{ 305{
306 b->INTERNAL_FIELD (mode_name) = val; 306 b->INTERNAL_FIELD (mode_name) = val;
307} 307}
308static inline void 308static void
309bset_name (struct buffer *b, Lisp_Object val) 309bset_name (struct buffer *b, Lisp_Object val)
310{ 310{
311 b->INTERNAL_FIELD (name) = val; 311 b->INTERNAL_FIELD (name) = val;
312} 312}
313static inline void 313static void
314bset_overwrite_mode (struct buffer *b, Lisp_Object val) 314bset_overwrite_mode (struct buffer *b, Lisp_Object val)
315{ 315{
316 b->INTERNAL_FIELD (overwrite_mode) = val; 316 b->INTERNAL_FIELD (overwrite_mode) = val;
317} 317}
318static inline void 318static void
319bset_pt_marker (struct buffer *b, Lisp_Object val) 319bset_pt_marker (struct buffer *b, Lisp_Object val)
320{ 320{
321 b->INTERNAL_FIELD (pt_marker) = val; 321 b->INTERNAL_FIELD (pt_marker) = val;
322} 322}
323static inline void 323static void
324bset_right_fringe_width (struct buffer *b, Lisp_Object val) 324bset_right_fringe_width (struct buffer *b, Lisp_Object val)
325{ 325{
326 b->INTERNAL_FIELD (right_fringe_width) = val; 326 b->INTERNAL_FIELD (right_fringe_width) = val;
327} 327}
328static inline void 328static void
329bset_save_length (struct buffer *b, Lisp_Object val) 329bset_save_length (struct buffer *b, Lisp_Object val)
330{ 330{
331 b->INTERNAL_FIELD (save_length) = val; 331 b->INTERNAL_FIELD (save_length) = val;
332} 332}
333static inline void 333static void
334bset_scroll_bar_width (struct buffer *b, Lisp_Object val) 334bset_scroll_bar_width (struct buffer *b, Lisp_Object val)
335{ 335{
336 b->INTERNAL_FIELD (scroll_bar_width) = val; 336 b->INTERNAL_FIELD (scroll_bar_width) = val;
337} 337}
338static inline void 338static void
339bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val) 339bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val)
340{ 340{
341 b->INTERNAL_FIELD (scroll_down_aggressively) = val; 341 b->INTERNAL_FIELD (scroll_down_aggressively) = val;
342} 342}
343static inline void 343static void
344bset_scroll_up_aggressively (struct buffer *b, Lisp_Object val) 344bset_scroll_up_aggressively (struct buffer *b, Lisp_Object val)
345{ 345{
346 b->INTERNAL_FIELD (scroll_up_aggressively) = val; 346 b->INTERNAL_FIELD (scroll_up_aggressively) = val;
347} 347}
348static inline void 348static void
349bset_selective_display (struct buffer *b, Lisp_Object val) 349bset_selective_display (struct buffer *b, Lisp_Object val)
350{ 350{
351 b->INTERNAL_FIELD (selective_display) = val; 351 b->INTERNAL_FIELD (selective_display) = val;
352} 352}
353static inline void 353static void
354bset_selective_display_ellipses (struct buffer *b, Lisp_Object val) 354bset_selective_display_ellipses (struct buffer *b, Lisp_Object val)
355{ 355{
356 b->INTERNAL_FIELD (selective_display_ellipses) = val; 356 b->INTERNAL_FIELD (selective_display_ellipses) = val;
357} 357}
358static inline void 358static void
359bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val) 359bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val)
360{ 360{
361 b->INTERNAL_FIELD (vertical_scroll_bar_type) = val; 361 b->INTERNAL_FIELD (vertical_scroll_bar_type) = val;
362} 362}
363static inline void 363static void
364bset_word_wrap (struct buffer *b, Lisp_Object val) 364bset_word_wrap (struct buffer *b, Lisp_Object val)
365{ 365{
366 b->INTERNAL_FIELD (word_wrap) = val; 366 b->INTERNAL_FIELD (word_wrap) = val;
367} 367}
368static inline void 368static void
369bset_zv_marker (struct buffer *b, Lisp_Object val) 369bset_zv_marker (struct buffer *b, Lisp_Object val)
370{ 370{
371 b->INTERNAL_FIELD (zv_marker) = val; 371 b->INTERNAL_FIELD (zv_marker) = val;
@@ -651,13 +651,13 @@ copy_overlays (struct buffer *b, struct Lisp_Overlay *list)
651 651
652/* Set an appropriate overlay of B. */ 652/* Set an appropriate overlay of B. */
653 653
654static inline void 654static void
655set_buffer_overlays_before (struct buffer *b, struct Lisp_Overlay *o) 655set_buffer_overlays_before (struct buffer *b, struct Lisp_Overlay *o)
656{ 656{
657 b->overlays_before = o; 657 b->overlays_before = o;
658} 658}
659 659
660static inline void 660static void
661set_buffer_overlays_after (struct buffer *b, struct Lisp_Overlay *o) 661set_buffer_overlays_after (struct buffer *b, struct Lisp_Overlay *o)
662{ 662{
663 b->overlays_after = o; 663 b->overlays_after = o;
@@ -2464,7 +2464,7 @@ current buffer is cleared. */)
2464 begv = BEGV, zv = ZV; 2464 begv = BEGV, zv = ZV;
2465 2465
2466 if (narrowed) 2466 if (narrowed)
2467 Fwiden (); 2467 error ("Changing multibyteness in a narrowed buffer");
2468 2468
2469 if (NILP (flag)) 2469 if (NILP (flag))
2470 { 2470 {
@@ -3689,7 +3689,6 @@ fix_start_end_in_overlays (register ptrdiff_t start, register ptrdiff_t end)
3689 beforep->next = current_buffer->overlays_before; 3689 beforep->next = current_buffer->overlays_before;
3690 set_buffer_overlays_before (current_buffer, before_list); 3690 set_buffer_overlays_before (current_buffer, before_list);
3691 } 3691 }
3692 recenter_overlay_lists (current_buffer, current_buffer->overlay_center);
3693 3692
3694 if (afterp) 3693 if (afterp)
3695 { 3694 {
@@ -3847,17 +3846,16 @@ for the rear of the overlay advance when text is inserted there
3847 end = OVERLAY_END (overlay); 3846 end = OVERLAY_END (overlay);
3848 if (OVERLAY_POSITION (end) < b->overlay_center) 3847 if (OVERLAY_POSITION (end) < b->overlay_center)
3849 { 3848 {
3850 if (b->overlays_after) 3849 eassert (b->overlays_after || (XOVERLAY (overlay)->next == NULL));
3851 XOVERLAY (overlay)->next = b->overlays_after; 3850 XOVERLAY (overlay)->next = b->overlays_after;
3852 set_buffer_overlays_after (b, XOVERLAY (overlay)); 3851 set_buffer_overlays_after (b, XOVERLAY (overlay));
3853 } 3852 }
3854 else 3853 else
3855 { 3854 {
3856 if (b->overlays_before) 3855 eassert (b->overlays_before || (XOVERLAY (overlay)->next == NULL));
3857 XOVERLAY (overlay)->next = b->overlays_before; 3856 XOVERLAY (overlay)->next = b->overlays_before;
3858 set_buffer_overlays_before (b, XOVERLAY (overlay)); 3857 set_buffer_overlays_before (b, XOVERLAY (overlay));
3859 } 3858 }
3860
3861 /* This puts it in the right list, and in the right order. */ 3859 /* This puts it in the right list, and in the right order. */
3862 recenter_overlay_lists (b, b->overlay_center); 3860 recenter_overlay_lists (b, b->overlay_center);
3863 3861
@@ -4141,7 +4139,7 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0,
4141 /* Put all the overlays we want in a vector in overlay_vec. 4139 /* Put all the overlays we want in a vector in overlay_vec.
4142 Store the length in len. */ 4140 Store the length in len. */
4143 noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, 4141 noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len,
4144 0, 0, 0); 4142 NULL, NULL, 0);
4145 4143
4146 /* Make a list of them all. */ 4144 /* Make a list of them all. */
4147 result = Flist (noverlays, overlay_vec); 4145 result = Flist (noverlays, overlay_vec);