aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c76
1 files changed, 37 insertions, 39 deletions
diff --git a/src/window.c b/src/window.c
index a10222b1aff..2a498c43d80 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1395,10 +1395,10 @@ overriding motion of point in order to display at this exact start. */)
1395 CHECK_NUMBER_COERCE_MARKER (pos); 1395 CHECK_NUMBER_COERCE_MARKER (pos);
1396 set_marker_restricted (w->start, pos, w->buffer); 1396 set_marker_restricted (w->start, pos, w->buffer);
1397 /* this is not right, but much easier than doing what is right. */ 1397 /* this is not right, but much easier than doing what is right. */
1398 w->start_at_line_beg = Qnil; 1398 w->start_at_line_beg = 0;
1399 if (NILP (noforce)) 1399 if (NILP (noforce))
1400 w->force_start = Qt; 1400 w->force_start = 1;
1401 w->update_mode_line = Qt; 1401 w->update_mode_line = 1;
1402 XSETFASTINT (w->last_modified, 0); 1402 XSETFASTINT (w->last_modified, 0);
1403 XSETFASTINT (w->last_overlay_modified, 0); 1403 XSETFASTINT (w->last_overlay_modified, 0);
1404 if (!EQ (window, selected_window)) 1404 if (!EQ (window, selected_window))
@@ -2474,7 +2474,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2474 if (EQ (w->buffer, obj)) 2474 if (EQ (w->buffer, obj))
2475 { 2475 {
2476 mark_window_display_accurate (window, 0); 2476 mark_window_display_accurate (window, 0);
2477 w->update_mode_line = Qt; 2477 w->update_mode_line = 1;
2478 XBUFFER (obj)->prevent_redisplay_optimizations_p = 1; 2478 XBUFFER (obj)->prevent_redisplay_optimizations_p = 1;
2479 ++update_mode_lines; 2479 ++update_mode_lines;
2480 best_window = window; 2480 best_window = window;
@@ -2773,12 +2773,11 @@ window-start value is reasonable when this function is called. */)
2773 2773
2774 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); 2774 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
2775 w->window_end_valid = Qnil; 2775 w->window_end_valid = Qnil;
2776 w->start_at_line_beg = ((pos.bytepos == BEGV_BYTE 2776 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
2777 || FETCH_BYTE (pos.bytepos - 1) == '\n') ? Qt 2777 || FETCH_BYTE (pos.bytepos - 1) == '\n');
2778 : Qnil);
2779 /* We need to do this, so that the window-scroll-functions 2778 /* We need to do this, so that the window-scroll-functions
2780 get called. */ 2779 get called. */
2781 w->optional_new_start = Qt; 2780 w->optional_new_start = 1;
2782 2781
2783 set_buffer_internal (obuf); 2782 set_buffer_internal (obuf);
2784 } 2783 }
@@ -3008,8 +3007,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3008 set_marker_restricted (w->start, 3007 set_marker_restricted (w->start,
3009 make_number (b->last_window_start), 3008 make_number (b->last_window_start),
3010 buffer); 3009 buffer);
3011 w->start_at_line_beg = Qnil; 3010 w->start_at_line_beg = 0;
3012 w->force_start = Qnil; 3011 w->force_start = 0;
3013 XSETFASTINT (w->last_modified, 0); 3012 XSETFASTINT (w->last_modified, 0);
3014 XSETFASTINT (w->last_overlay_modified, 0); 3013 XSETFASTINT (w->last_overlay_modified, 0);
3015 } 3014 }
@@ -3145,7 +3144,7 @@ displaying that buffer. */)
3145 { 3144 {
3146 struct window *w = XWINDOW (object); 3145 struct window *w = XWINDOW (object);
3147 mark_window_display_accurate (object, 0); 3146 mark_window_display_accurate (object, 0);
3148 w->update_mode_line = Qt; 3147 w->update_mode_line = 1;
3149 if (BUFFERP (w->buffer)) 3148 if (BUFFERP (w->buffer))
3150 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; 3149 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
3151 ++update_mode_lines; 3150 ++update_mode_lines;
@@ -3277,7 +3276,8 @@ make_window (void)
3277 3276
3278 w = allocate_window (); 3277 w = allocate_window ();
3279 /* Initialize all Lisp data. */ 3278 /* Initialize all Lisp data. */
3280 w->frame = w->mini_p = Qnil; 3279 w->frame = Qnil;
3280 w->mini = 0;
3281 w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil; 3281 w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil;
3282 XSETFASTINT (w->left_col, 0); 3282 XSETFASTINT (w->left_col, 0);
3283 XSETFASTINT (w->top_line, 0); 3283 XSETFASTINT (w->top_line, 0);
@@ -3290,7 +3290,7 @@ make_window (void)
3290 w->buffer = Qnil; 3290 w->buffer = Qnil;
3291 w->start = Fmake_marker (); 3291 w->start = Fmake_marker ();
3292 w->pointm = Fmake_marker (); 3292 w->pointm = Fmake_marker ();
3293 w->force_start = w->optional_new_start = Qnil; 3293 w->force_start = w->optional_new_start = 0;
3294 XSETFASTINT (w->hscroll, 0); 3294 XSETFASTINT (w->hscroll, 0);
3295 XSETFASTINT (w->min_hscroll, 0); 3295 XSETFASTINT (w->min_hscroll, 0);
3296 XSETFASTINT (w->use_time, 0); 3296 XSETFASTINT (w->use_time, 0);
@@ -3298,17 +3298,18 @@ make_window (void)
3298 XSETFASTINT (w->sequence_number, sequence_number); 3298 XSETFASTINT (w->sequence_number, sequence_number);
3299 w->temslot = w->last_modified = w->last_overlay_modified = Qnil; 3299 w->temslot = w->last_modified = w->last_overlay_modified = Qnil;
3300 XSETFASTINT (w->last_point, 0); 3300 XSETFASTINT (w->last_point, 0);
3301 w->last_had_star = w->vertical_scroll_bar = Qnil; 3301 w->last_had_star = 0;
3302 w->vertical_scroll_bar = Qnil;
3302 w->left_margin_cols = w->right_margin_cols = Qnil; 3303 w->left_margin_cols = w->right_margin_cols = Qnil;
3303 w->left_fringe_width = w->right_fringe_width = Qnil; 3304 w->left_fringe_width = w->right_fringe_width = Qnil;
3304 w->fringes_outside_margins = Qnil; 3305 w->fringes_outside_margins = Qnil;
3305 w->scroll_bar_width = Qnil; 3306 w->scroll_bar_width = Qnil;
3306 w->vertical_scroll_bar_type = Qt; 3307 w->vertical_scroll_bar_type = Qt;
3307 w->last_mark_x = w->last_mark_y = Qnil;
3308 XSETFASTINT (w->window_end_pos, 0); 3308 XSETFASTINT (w->window_end_pos, 0);
3309 XSETFASTINT (w->window_end_vpos, 0); 3309 XSETFASTINT (w->window_end_vpos, 0);
3310 w->window_end_valid = w->update_mode_line = Qnil; 3310 w->window_end_valid = w->display_table = Qnil;
3311 w->start_at_line_beg = w->display_table = w->dedicated = Qnil; 3311 w->update_mode_line = w->start_at_line_beg = 0;
3312 w->dedicated = Qnil;
3312 w->base_line_number = w->base_line_pos = w->region_showing = Qnil; 3313 w->base_line_number = w->base_line_pos = w->region_showing = Qnil;
3313 w->column_number_displayed = w->redisplay_end_trigger = Qnil; 3314 w->column_number_displayed = w->redisplay_end_trigger = Qnil;
3314 w->combination_limit = w->window_parameters = Qnil; 3315 w->combination_limit = w->window_parameters = Qnil;
@@ -4310,13 +4311,13 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4310 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); 4311 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV);
4311 set_marker_restricted (w->start, make_number (spos), 4312 set_marker_restricted (w->start, make_number (spos),
4312 w->buffer); 4313 w->buffer);
4313 w->start_at_line_beg = Qt; 4314 w->start_at_line_beg = 1;
4314 w->update_mode_line = Qt; 4315 w->update_mode_line = 1;
4315 XSETFASTINT (w->last_modified, 0); 4316 XSETFASTINT (w->last_modified, 0);
4316 XSETFASTINT (w->last_overlay_modified, 0); 4317 XSETFASTINT (w->last_overlay_modified, 0);
4317 /* Set force_start so that redisplay_window will run the 4318 /* Set force_start so that redisplay_window will run the
4318 window-scroll-functions. */ 4319 window-scroll-functions. */
4319 w->force_start = Qt; 4320 w->force_start = 1;
4320 return; 4321 return;
4321 } 4322 }
4322 } 4323 }
@@ -4456,14 +4457,13 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4456 set_marker_restricted (w->start, make_number (pos), 4457 set_marker_restricted (w->start, make_number (pos),
4457 w->buffer); 4458 w->buffer);
4458 bytepos = XMARKER (w->start)->bytepos; 4459 bytepos = XMARKER (w->start)->bytepos;
4459 w->start_at_line_beg = ((pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n') 4460 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
4460 ? Qt : Qnil); 4461 w->update_mode_line = 1;
4461 w->update_mode_line = Qt;
4462 XSETFASTINT (w->last_modified, 0); 4462 XSETFASTINT (w->last_modified, 0);
4463 XSETFASTINT (w->last_overlay_modified, 0); 4463 XSETFASTINT (w->last_overlay_modified, 0);
4464 /* Set force_start so that redisplay_window will run the 4464 /* Set force_start so that redisplay_window will run the
4465 window-scroll-functions. */ 4465 window-scroll-functions. */
4466 w->force_start = Qt; 4466 w->force_start = 1;
4467 } 4467 }
4468 4468
4469 /* The rest of this function uses current_y in a nonstandard way, 4469 /* The rest of this function uses current_y in a nonstandard way,
@@ -4656,13 +4656,13 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
4656 max (0, min (scroll_margin, XINT (w->total_lines) / 4)); 4656 max (0, min (scroll_margin, XINT (w->total_lines) / 4));
4657 4657
4658 set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); 4658 set_marker_restricted_both (w->start, w->buffer, pos, pos_byte);
4659 w->start_at_line_beg = bolp; 4659 w->start_at_line_beg = !NILP (bolp);
4660 w->update_mode_line = Qt; 4660 w->update_mode_line = 1;
4661 XSETFASTINT (w->last_modified, 0); 4661 XSETFASTINT (w->last_modified, 0);
4662 XSETFASTINT (w->last_overlay_modified, 0); 4662 XSETFASTINT (w->last_overlay_modified, 0);
4663 /* Set force_start so that redisplay_window will run 4663 /* Set force_start so that redisplay_window will run
4664 the window-scroll-functions. */ 4664 the window-scroll-functions. */
4665 w->force_start = Qt; 4665 w->force_start = 1;
4666 4666
4667 if (!NILP (Vscroll_preserve_screen_position) 4667 if (!NILP (Vscroll_preserve_screen_position)
4668 && (whole || !EQ (Vscroll_preserve_screen_position, Qt))) 4668 && (whole || !EQ (Vscroll_preserve_screen_position, Qt)))
@@ -5206,12 +5206,10 @@ and redisplay normally--don't erase and redraw the frame. */)
5206 set_marker_both (w->start, w->buffer, charpos, bytepos); 5206 set_marker_both (w->start, w->buffer, charpos, bytepos);
5207 w->window_end_valid = Qnil; 5207 w->window_end_valid = Qnil;
5208 5208
5209 w->optional_new_start = Qt; 5209 w->optional_new_start = 1;
5210 5210
5211 if (bytepos == BEGV_BYTE || FETCH_BYTE (bytepos - 1) == '\n') 5211 w->start_at_line_beg = (bytepos == BEGV_BYTE ||
5212 w->start_at_line_beg = Qt; 5212 FETCH_BYTE (bytepos - 1) == '\n');
5213 else
5214 w->start_at_line_beg = Qnil;
5215 5213
5216 set_buffer_internal (obuf); 5214 set_buffer_internal (obuf);
5217 return Qnil; 5215 return Qnil;
@@ -5262,8 +5260,8 @@ zero means top of window, negative means relative to bottom of window. */)
5262 int height = window_internal_height (w); 5260 int height = window_internal_height (w);
5263 Fvertical_motion (make_number (- (height / 2)), window); 5261 Fvertical_motion (make_number (- (height / 2)), window);
5264 set_marker_both (w->start, w->buffer, PT, PT_BYTE); 5262 set_marker_both (w->start, w->buffer, PT, PT_BYTE);
5265 w->start_at_line_beg = Fbolp (); 5263 w->start_at_line_beg = !NILP (Fbolp ());
5266 w->force_start = Qt; 5264 w->force_start = 1;
5267 } 5265 }
5268 else 5266 else
5269 Fgoto_char (w->start); 5267 Fgoto_char (w->start);
@@ -5612,7 +5610,7 @@ the return value is nil. Otherwise the value is t. */)
5612 /* If saved buffer is alive, install it. */ 5610 /* If saved buffer is alive, install it. */
5613 { 5611 {
5614 w->buffer = p->buffer; 5612 w->buffer = p->buffer;
5615 w->start_at_line_beg = p->start_at_line_beg; 5613 w->start_at_line_beg = !NILP (p->start_at_line_beg);
5616 set_marker_restricted (w->start, p->start, w->buffer); 5614 set_marker_restricted (w->start, p->start, w->buffer);
5617 set_marker_restricted (w->pointm, p->pointm, w->buffer); 5615 set_marker_restricted (w->pointm, p->pointm, w->buffer);
5618 Fset_marker (BVAR (XBUFFER (w->buffer), mark), 5616 Fset_marker (BVAR (XBUFFER (w->buffer), mark),
@@ -5637,7 +5635,7 @@ the return value is nil. Otherwise the value is t. */)
5637 set_marker_restricted_both (w->pointm, w->buffer, 5635 set_marker_restricted_both (w->pointm, w->buffer,
5638 BUF_PT (XBUFFER (w->buffer)), 5636 BUF_PT (XBUFFER (w->buffer)),
5639 BUF_PT_BYTE (XBUFFER (w->buffer))); 5637 BUF_PT_BYTE (XBUFFER (w->buffer)));
5640 w->start_at_line_beg = Qt; 5638 w->start_at_line_beg = 1;
5641 } 5639 }
5642 else if (STRINGP (auto_buffer_name = 5640 else if (STRINGP (auto_buffer_name =
5643 Fwindow_parameter (window, Qauto_buffer_name)) 5641 Fwindow_parameter (window, Qauto_buffer_name))
@@ -5646,7 +5644,7 @@ the return value is nil. Otherwise the value is t. */)
5646 { 5644 {
5647 set_marker_restricted (w->start, make_number (0), w->buffer); 5645 set_marker_restricted (w->start, make_number (0), w->buffer);
5648 set_marker_restricted (w->pointm, make_number (0), w->buffer); 5646 set_marker_restricted (w->pointm, make_number (0), w->buffer);
5649 w->start_at_line_beg = Qt; 5647 w->start_at_line_beg = 1;
5650 } 5648 }
5651 else 5649 else
5652 /* Window has no live buffer, get one. */ 5650 /* Window has no live buffer, get one. */
@@ -5660,7 +5658,7 @@ the return value is nil. Otherwise the value is t. */)
5660 range. */ 5658 range. */
5661 set_marker_restricted (w->start, make_number (0), w->buffer); 5659 set_marker_restricted (w->start, make_number (0), w->buffer);
5662 set_marker_restricted (w->pointm, make_number (0), w->buffer); 5660 set_marker_restricted (w->pointm, make_number (0), w->buffer);
5663 w->start_at_line_beg = Qt; 5661 w->start_at_line_beg = 1;
5664 if (!NILP (w->dedicated)) 5662 if (!NILP (w->dedicated))
5665 /* Record this window as dead. */ 5663 /* Record this window as dead. */
5666 dead_windows = Fcons (window, dead_windows); 5664 dead_windows = Fcons (window, dead_windows);
@@ -5961,7 +5959,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5961 = !NILP (Vwindow_point_insertion_type); 5959 = !NILP (Vwindow_point_insertion_type);
5962 5960
5963 p->start = Fcopy_marker (w->start, Qnil); 5961 p->start = Fcopy_marker (w->start, Qnil);
5964 p->start_at_line_beg = w->start_at_line_beg; 5962 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;
5965 5963
5966 tem = BVAR (XBUFFER (w->buffer), mark); 5964 tem = BVAR (XBUFFER (w->buffer), mark);
5967 p->mark = Fcopy_marker (tem, Qnil); 5965 p->mark = Fcopy_marker (tem, Qnil);