aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/fileio.c4
-rw-r--r--src/frame.c4
-rw-r--r--src/keyboard.c4
-rw-r--r--src/window.c76
-rw-r--r--src/window.h57
-rw-r--r--src/xdisp.c62
-rw-r--r--src/xfns.c2
8 files changed, 113 insertions, 107 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6d71346dd78..12845538a9e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2
3 For a 'struct window', replace some Lisp_Object fields to
4 bitfields where appropriate, remove unused fields.
5 * window.h (struct window): Remove unused 'last_mark_x' and
6 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7 change it's type from Lisp_Object to bitfield.
8 Change type of 'force_start', 'optional_new_start',
9 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
10 fields from Lisp_Object to bitfield. Adjust users accordingly.
11
12012-05-31 Paul Eggert <eggert@cs.ucla.edu> 122012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2 13
3 Pacify gcc -Wdouble-precision when using Xaw. 14 Pacify gcc -Wdouble-precision when using Xaw.
diff --git a/src/fileio.c b/src/fileio.c
index c6e2eea5089..496f9d7efa4 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3735,7 +3735,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3735 /* If display currently starts at beginning of line, 3735 /* If display currently starts at beginning of line,
3736 keep it that way. */ 3736 keep it that way. */
3737 if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) 3737 if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
3738 XWINDOW (selected_window)->start_at_line_beg = Fbolp (); 3738 XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
3739 3739
3740 replace_handled = 1; 3740 replace_handled = 1;
3741 } 3741 }
@@ -3892,7 +3892,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3892 /* If display currently starts at beginning of line, 3892 /* If display currently starts at beginning of line,
3893 keep it that way. */ 3893 keep it that way. */
3894 if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) 3894 if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
3895 XWINDOW (selected_window)->start_at_line_beg = Fbolp (); 3895 XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
3896 3896
3897 /* Replace the chars that we need to replace, 3897 /* Replace the chars that we need to replace,
3898 and update INSERTED to equal the number of bytes 3898 and update INSERTED to equal the number of bytes
diff --git a/src/frame.c b/src/frame.c
index e962251f420..744485d4615 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -331,7 +331,7 @@ make_frame (int mini_p)
331 mini_window = make_window (); 331 mini_window = make_window ();
332 XWINDOW (root_window)->next = mini_window; 332 XWINDOW (root_window)->next = mini_window;
333 XWINDOW (mini_window)->prev = root_window; 333 XWINDOW (mini_window)->prev = root_window;
334 XWINDOW (mini_window)->mini_p = Qt; 334 XWINDOW (mini_window)->mini = 1;
335 XWINDOW (mini_window)->frame = frame; 335 XWINDOW (mini_window)->frame = frame;
336 f->minibuffer_window = mini_window; 336 f->minibuffer_window = mini_window;
337 } 337 }
@@ -480,7 +480,7 @@ make_minibuffer_frame (void)
480 as nil. */ 480 as nil. */
481 481
482 mini_window = f->minibuffer_window = f->root_window; 482 mini_window = f->minibuffer_window = f->root_window;
483 XWINDOW (mini_window)->mini_p = Qt; 483 XWINDOW (mini_window)->mini = 1;
484 XWINDOW (mini_window)->next = Qnil; 484 XWINDOW (mini_window)->next = Qnil;
485 XWINDOW (mini_window)->prev = Qnil; 485 XWINDOW (mini_window)->prev = Qnil;
486 XWINDOW (mini_window)->frame = frame; 486 XWINDOW (mini_window)->frame = frame;
diff --git a/src/keyboard.c b/src/keyboard.c
index 339cf2a7e9e..2642ad7734b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1484,10 +1484,10 @@ command_loop_1 (void)
1484 from that position. But also throw away beg_unchanged and 1484 from that position. But also throw away beg_unchanged and
1485 end_unchanged information in that case, so that redisplay will 1485 end_unchanged information in that case, so that redisplay will
1486 update the whole window properly. */ 1486 update the whole window properly. */
1487 if (!NILP (XWINDOW (selected_window)->force_start)) 1487 if (XWINDOW (selected_window)->force_start)
1488 { 1488 {
1489 struct buffer *b; 1489 struct buffer *b;
1490 XWINDOW (selected_window)->force_start = Qnil; 1490 XWINDOW (selected_window)->force_start = 0;
1491 b = XBUFFER (XWINDOW (selected_window)->buffer); 1491 b = XBUFFER (XWINDOW (selected_window)->buffer);
1492 BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0; 1492 BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0;
1493 } 1493 }
diff --git a/src/window.c b/src/window.c
index 37bcf64181a..54ad0af4c3f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1393,10 +1393,10 @@ overriding motion of point in order to display at this exact start. */)
1393 CHECK_NUMBER_COERCE_MARKER (pos); 1393 CHECK_NUMBER_COERCE_MARKER (pos);
1394 set_marker_restricted (w->start, pos, w->buffer); 1394 set_marker_restricted (w->start, pos, w->buffer);
1395 /* this is not right, but much easier than doing what is right. */ 1395 /* this is not right, but much easier than doing what is right. */
1396 w->start_at_line_beg = Qnil; 1396 w->start_at_line_beg = 0;
1397 if (NILP (noforce)) 1397 if (NILP (noforce))
1398 w->force_start = Qt; 1398 w->force_start = 1;
1399 w->update_mode_line = Qt; 1399 w->update_mode_line = 1;
1400 XSETFASTINT (w->last_modified, 0); 1400 XSETFASTINT (w->last_modified, 0);
1401 XSETFASTINT (w->last_overlay_modified, 0); 1401 XSETFASTINT (w->last_overlay_modified, 0);
1402 if (!EQ (window, selected_window)) 1402 if (!EQ (window, selected_window))
@@ -2472,7 +2472,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2472 if (EQ (w->buffer, obj)) 2472 if (EQ (w->buffer, obj))
2473 { 2473 {
2474 mark_window_display_accurate (window, 0); 2474 mark_window_display_accurate (window, 0);
2475 w->update_mode_line = Qt; 2475 w->update_mode_line = 1;
2476 XBUFFER (obj)->prevent_redisplay_optimizations_p = 1; 2476 XBUFFER (obj)->prevent_redisplay_optimizations_p = 1;
2477 ++update_mode_lines; 2477 ++update_mode_lines;
2478 best_window = window; 2478 best_window = window;
@@ -2771,12 +2771,11 @@ window-start value is reasonable when this function is called. */)
2771 2771
2772 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); 2772 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
2773 w->window_end_valid = Qnil; 2773 w->window_end_valid = Qnil;
2774 w->start_at_line_beg = ((pos.bytepos == BEGV_BYTE 2774 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
2775 || FETCH_BYTE (pos.bytepos - 1) == '\n') ? Qt 2775 || FETCH_BYTE (pos.bytepos - 1) == '\n');
2776 : Qnil);
2777 /* We need to do this, so that the window-scroll-functions 2776 /* We need to do this, so that the window-scroll-functions
2778 get called. */ 2777 get called. */
2779 w->optional_new_start = Qt; 2778 w->optional_new_start = 1;
2780 2779
2781 set_buffer_internal (obuf); 2780 set_buffer_internal (obuf);
2782 } 2781 }
@@ -3006,8 +3005,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3006 set_marker_restricted (w->start, 3005 set_marker_restricted (w->start,
3007 make_number (b->last_window_start), 3006 make_number (b->last_window_start),
3008 buffer); 3007 buffer);
3009 w->start_at_line_beg = Qnil; 3008 w->start_at_line_beg = 0;
3010 w->force_start = Qnil; 3009 w->force_start = 0;
3011 XSETFASTINT (w->last_modified, 0); 3010 XSETFASTINT (w->last_modified, 0);
3012 XSETFASTINT (w->last_overlay_modified, 0); 3011 XSETFASTINT (w->last_overlay_modified, 0);
3013 } 3012 }
@@ -3143,7 +3142,7 @@ displaying that buffer. */)
3143 { 3142 {
3144 struct window *w = XWINDOW (object); 3143 struct window *w = XWINDOW (object);
3145 mark_window_display_accurate (object, 0); 3144 mark_window_display_accurate (object, 0);
3146 w->update_mode_line = Qt; 3145 w->update_mode_line = 1;
3147 if (BUFFERP (w->buffer)) 3146 if (BUFFERP (w->buffer))
3148 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; 3147 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
3149 ++update_mode_lines; 3148 ++update_mode_lines;
@@ -3275,7 +3274,8 @@ make_window (void)
3275 3274
3276 w = allocate_window (); 3275 w = allocate_window ();
3277 /* Initialize all Lisp data. */ 3276 /* Initialize all Lisp data. */
3278 w->frame = w->mini_p = Qnil; 3277 w->frame = Qnil;
3278 w->mini = 0;
3279 w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil; 3279 w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil;
3280 XSETFASTINT (w->left_col, 0); 3280 XSETFASTINT (w->left_col, 0);
3281 XSETFASTINT (w->top_line, 0); 3281 XSETFASTINT (w->top_line, 0);
@@ -3288,7 +3288,7 @@ make_window (void)
3288 w->buffer = Qnil; 3288 w->buffer = Qnil;
3289 w->start = Fmake_marker (); 3289 w->start = Fmake_marker ();
3290 w->pointm = Fmake_marker (); 3290 w->pointm = Fmake_marker ();
3291 w->force_start = w->optional_new_start = Qnil; 3291 w->force_start = w->optional_new_start = 0;
3292 XSETFASTINT (w->hscroll, 0); 3292 XSETFASTINT (w->hscroll, 0);
3293 XSETFASTINT (w->min_hscroll, 0); 3293 XSETFASTINT (w->min_hscroll, 0);
3294 XSETFASTINT (w->use_time, 0); 3294 XSETFASTINT (w->use_time, 0);
@@ -3296,17 +3296,18 @@ make_window (void)
3296 XSETFASTINT (w->sequence_number, sequence_number); 3296 XSETFASTINT (w->sequence_number, sequence_number);
3297 w->temslot = w->last_modified = w->last_overlay_modified = Qnil; 3297 w->temslot = w->last_modified = w->last_overlay_modified = Qnil;
3298 XSETFASTINT (w->last_point, 0); 3298 XSETFASTINT (w->last_point, 0);
3299 w->last_had_star = w->vertical_scroll_bar = Qnil; 3299 w->last_had_star = 0;
3300 w->vertical_scroll_bar = Qnil;
3300 w->left_margin_cols = w->right_margin_cols = Qnil; 3301 w->left_margin_cols = w->right_margin_cols = Qnil;
3301 w->left_fringe_width = w->right_fringe_width = Qnil; 3302 w->left_fringe_width = w->right_fringe_width = Qnil;
3302 w->fringes_outside_margins = Qnil; 3303 w->fringes_outside_margins = Qnil;
3303 w->scroll_bar_width = Qnil; 3304 w->scroll_bar_width = Qnil;
3304 w->vertical_scroll_bar_type = Qt; 3305 w->vertical_scroll_bar_type = Qt;
3305 w->last_mark_x = w->last_mark_y = Qnil;
3306 XSETFASTINT (w->window_end_pos, 0); 3306 XSETFASTINT (w->window_end_pos, 0);
3307 XSETFASTINT (w->window_end_vpos, 0); 3307 XSETFASTINT (w->window_end_vpos, 0);
3308 w->window_end_valid = w->update_mode_line = Qnil; 3308 w->window_end_valid = w->display_table = Qnil;
3309 w->start_at_line_beg = w->display_table = w->dedicated = Qnil; 3309 w->update_mode_line = w->start_at_line_beg = 0;
3310 w->dedicated = Qnil;
3310 w->base_line_number = w->base_line_pos = w->region_showing = Qnil; 3311 w->base_line_number = w->base_line_pos = w->region_showing = Qnil;
3311 w->column_number_displayed = w->redisplay_end_trigger = Qnil; 3312 w->column_number_displayed = w->redisplay_end_trigger = Qnil;
3312 w->combination_limit = w->window_parameters = Qnil; 3313 w->combination_limit = w->window_parameters = Qnil;
@@ -4305,13 +4306,13 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4305 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); 4306 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV);
4306 set_marker_restricted (w->start, make_number (spos), 4307 set_marker_restricted (w->start, make_number (spos),
4307 w->buffer); 4308 w->buffer);
4308 w->start_at_line_beg = Qt; 4309 w->start_at_line_beg = 1;
4309 w->update_mode_line = Qt; 4310 w->update_mode_line = 1;
4310 XSETFASTINT (w->last_modified, 0); 4311 XSETFASTINT (w->last_modified, 0);
4311 XSETFASTINT (w->last_overlay_modified, 0); 4312 XSETFASTINT (w->last_overlay_modified, 0);
4312 /* Set force_start so that redisplay_window will run the 4313 /* Set force_start so that redisplay_window will run the
4313 window-scroll-functions. */ 4314 window-scroll-functions. */
4314 w->force_start = Qt; 4315 w->force_start = 1;
4315 return; 4316 return;
4316 } 4317 }
4317 } 4318 }
@@ -4451,14 +4452,13 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4451 set_marker_restricted (w->start, make_number (pos), 4452 set_marker_restricted (w->start, make_number (pos),
4452 w->buffer); 4453 w->buffer);
4453 bytepos = XMARKER (w->start)->bytepos; 4454 bytepos = XMARKER (w->start)->bytepos;
4454 w->start_at_line_beg = ((pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n') 4455 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
4455 ? Qt : Qnil); 4456 w->update_mode_line = 1;
4456 w->update_mode_line = Qt;
4457 XSETFASTINT (w->last_modified, 0); 4457 XSETFASTINT (w->last_modified, 0);
4458 XSETFASTINT (w->last_overlay_modified, 0); 4458 XSETFASTINT (w->last_overlay_modified, 0);
4459 /* Set force_start so that redisplay_window will run the 4459 /* Set force_start so that redisplay_window will run the
4460 window-scroll-functions. */ 4460 window-scroll-functions. */
4461 w->force_start = Qt; 4461 w->force_start = 1;
4462 } 4462 }
4463 4463
4464 /* The rest of this function uses current_y in a nonstandard way, 4464 /* The rest of this function uses current_y in a nonstandard way,
@@ -4651,13 +4651,13 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
4651 max (0, min (scroll_margin, XINT (w->total_lines) / 4)); 4651 max (0, min (scroll_margin, XINT (w->total_lines) / 4));
4652 4652
4653 set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); 4653 set_marker_restricted_both (w->start, w->buffer, pos, pos_byte);
4654 w->start_at_line_beg = bolp; 4654 w->start_at_line_beg = !NILP (bolp);
4655 w->update_mode_line = Qt; 4655 w->update_mode_line = 1;
4656 XSETFASTINT (w->last_modified, 0); 4656 XSETFASTINT (w->last_modified, 0);
4657 XSETFASTINT (w->last_overlay_modified, 0); 4657 XSETFASTINT (w->last_overlay_modified, 0);
4658 /* Set force_start so that redisplay_window will run 4658 /* Set force_start so that redisplay_window will run
4659 the window-scroll-functions. */ 4659 the window-scroll-functions. */
4660 w->force_start = Qt; 4660 w->force_start = 1;
4661 4661
4662 if (!NILP (Vscroll_preserve_screen_position) 4662 if (!NILP (Vscroll_preserve_screen_position)
4663 && (whole || !EQ (Vscroll_preserve_screen_position, Qt))) 4663 && (whole || !EQ (Vscroll_preserve_screen_position, Qt)))
@@ -5201,12 +5201,10 @@ and redisplay normally--don't erase and redraw the frame. */)
5201 set_marker_both (w->start, w->buffer, charpos, bytepos); 5201 set_marker_both (w->start, w->buffer, charpos, bytepos);
5202 w->window_end_valid = Qnil; 5202 w->window_end_valid = Qnil;
5203 5203
5204 w->optional_new_start = Qt; 5204 w->optional_new_start = 1;
5205 5205
5206 if (bytepos == BEGV_BYTE || FETCH_BYTE (bytepos - 1) == '\n') 5206 w->start_at_line_beg = (bytepos == BEGV_BYTE ||
5207 w->start_at_line_beg = Qt; 5207 FETCH_BYTE (bytepos - 1) == '\n');
5208 else
5209 w->start_at_line_beg = Qnil;
5210 5208
5211 set_buffer_internal (obuf); 5209 set_buffer_internal (obuf);
5212 return Qnil; 5210 return Qnil;
@@ -5257,8 +5255,8 @@ zero means top of window, negative means relative to bottom of window. */)
5257 int height = window_internal_height (w); 5255 int height = window_internal_height (w);
5258 Fvertical_motion (make_number (- (height / 2)), window); 5256 Fvertical_motion (make_number (- (height / 2)), window);
5259 set_marker_both (w->start, w->buffer, PT, PT_BYTE); 5257 set_marker_both (w->start, w->buffer, PT, PT_BYTE);
5260 w->start_at_line_beg = Fbolp (); 5258 w->start_at_line_beg = !NILP (Fbolp ());
5261 w->force_start = Qt; 5259 w->force_start = 1;
5262 } 5260 }
5263 else 5261 else
5264 Fgoto_char (w->start); 5262 Fgoto_char (w->start);
@@ -5607,7 +5605,7 @@ the return value is nil. Otherwise the value is t. */)
5607 /* If saved buffer is alive, install it. */ 5605 /* If saved buffer is alive, install it. */
5608 { 5606 {
5609 w->buffer = p->buffer; 5607 w->buffer = p->buffer;
5610 w->start_at_line_beg = p->start_at_line_beg; 5608 w->start_at_line_beg = !NILP (p->start_at_line_beg);
5611 set_marker_restricted (w->start, p->start, w->buffer); 5609 set_marker_restricted (w->start, p->start, w->buffer);
5612 set_marker_restricted (w->pointm, p->pointm, w->buffer); 5610 set_marker_restricted (w->pointm, p->pointm, w->buffer);
5613 Fset_marker (BVAR (XBUFFER (w->buffer), mark), 5611 Fset_marker (BVAR (XBUFFER (w->buffer), mark),
@@ -5632,7 +5630,7 @@ the return value is nil. Otherwise the value is t. */)
5632 set_marker_restricted_both (w->pointm, w->buffer, 5630 set_marker_restricted_both (w->pointm, w->buffer,
5633 BUF_PT (XBUFFER (w->buffer)), 5631 BUF_PT (XBUFFER (w->buffer)),
5634 BUF_PT_BYTE (XBUFFER (w->buffer))); 5632 BUF_PT_BYTE (XBUFFER (w->buffer)));
5635 w->start_at_line_beg = Qt; 5633 w->start_at_line_beg = 1;
5636 } 5634 }
5637 else if (STRINGP (auto_buffer_name = 5635 else if (STRINGP (auto_buffer_name =
5638 Fwindow_parameter (window, Qauto_buffer_name)) 5636 Fwindow_parameter (window, Qauto_buffer_name))
@@ -5641,7 +5639,7 @@ the return value is nil. Otherwise the value is t. */)
5641 { 5639 {
5642 set_marker_restricted (w->start, make_number (0), w->buffer); 5640 set_marker_restricted (w->start, make_number (0), w->buffer);
5643 set_marker_restricted (w->pointm, make_number (0), w->buffer); 5641 set_marker_restricted (w->pointm, make_number (0), w->buffer);
5644 w->start_at_line_beg = Qt; 5642 w->start_at_line_beg = 1;
5645 } 5643 }
5646 else 5644 else
5647 /* Window has no live buffer, get one. */ 5645 /* Window has no live buffer, get one. */
@@ -5655,7 +5653,7 @@ the return value is nil. Otherwise the value is t. */)
5655 range. */ 5653 range. */
5656 set_marker_restricted (w->start, make_number (0), w->buffer); 5654 set_marker_restricted (w->start, make_number (0), w->buffer);
5657 set_marker_restricted (w->pointm, make_number (0), w->buffer); 5655 set_marker_restricted (w->pointm, make_number (0), w->buffer);
5658 w->start_at_line_beg = Qt; 5656 w->start_at_line_beg = 1;
5659 if (!NILP (w->dedicated)) 5657 if (!NILP (w->dedicated))
5660 /* Record this window as dead. */ 5658 /* Record this window as dead. */
5661 dead_windows = Fcons (window, dead_windows); 5659 dead_windows = Fcons (window, dead_windows);
@@ -5956,7 +5954,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5956 = !NILP (Vwindow_point_insertion_type); 5954 = !NILP (Vwindow_point_insertion_type);
5957 5955
5958 p->start = Fcopy_marker (w->start, Qnil); 5956 p->start = Fcopy_marker (w->start, Qnil);
5959 p->start_at_line_beg = w->start_at_line_beg; 5957 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;
5960 5958
5961 tem = BVAR (XBUFFER (w->buffer), mark); 5959 tem = BVAR (XBUFFER (w->buffer), mark);
5962 p->mark = Fcopy_marker (tem, Qnil); 5960 p->mark = Fcopy_marker (tem, Qnil);
diff --git a/src/window.h b/src/window.h
index 1524805579f..0d3910c8cb0 100644
--- a/src/window.h
+++ b/src/window.h
@@ -94,9 +94,6 @@ struct window
94 /* The frame this window is on. */ 94 /* The frame this window is on. */
95 Lisp_Object frame; 95 Lisp_Object frame;
96 96
97 /* t if this window is a minibuffer window. */
98 Lisp_Object mini_p;
99
100 /* Following (to right or down) and preceding (to left or up) child 97 /* Following (to right or down) and preceding (to left or up) child
101 at same level of tree. */ 98 at same level of tree. */
102 Lisp_Object next, prev; 99 Lisp_Object next, prev;
@@ -144,15 +141,6 @@ struct window
144 each one can have its own value of point. */ 141 each one can have its own value of point. */
145 Lisp_Object pointm; 142 Lisp_Object pointm;
146 143
147 /* Non-nil means next redisplay must use the value of start
148 set up for it in advance. Set by scrolling commands. */
149 Lisp_Object force_start;
150 /* Non-nil means we have explicitly changed the value of start,
151 but that the next redisplay is not obliged to use the new value.
152 This is used in Fdelete_other_windows to force a call to
153 Vwindow_scroll_functions; also by Frecenter with argument. */
154 Lisp_Object optional_new_start;
155
156 /* Number of columns display within the window is scrolled to the left. */ 144 /* Number of columns display within the window is scrolled to the left. */
157 Lisp_Object hscroll; 145 Lisp_Object hscroll;
158 /* Minimum hscroll for automatic hscrolling. This is the value 146 /* Minimum hscroll for automatic hscrolling. This is the value
@@ -176,9 +164,6 @@ struct window
176 Lisp_Object last_overlay_modified; 164 Lisp_Object last_overlay_modified;
177 /* Value of point at that time. */ 165 /* Value of point at that time. */
178 Lisp_Object last_point; 166 Lisp_Object last_point;
179 /* Non-nil if the buffer was "modified" when the window
180 was last updated. */
181 Lisp_Object last_had_star;
182 167
183 /* This window's vertical scroll bar. This field is only for use 168 /* This window's vertical scroll bar. This field is only for use
184 by the window-system-dependent code which implements the 169 by the window-system-dependent code which implements the
@@ -206,11 +191,6 @@ struct window
206 no scroll bar. A value of t means use frame value. */ 191 no scroll bar. A value of t means use frame value. */
207 Lisp_Object vertical_scroll_bar_type; 192 Lisp_Object vertical_scroll_bar_type;
208 193
209 /* Frame coords of mark as of last time display completed */
210 /* May be nil if mark does not exist or was not on frame */
211 Lisp_Object last_mark_x;
212 Lisp_Object last_mark_y;
213
214 /* Z - the buffer position of the last glyph in the current matrix 194 /* Z - the buffer position of the last glyph in the current matrix
215 of W. Only valid if WINDOW_END_VALID is not nil. */ 195 of W. Only valid if WINDOW_END_VALID is not nil. */
216 Lisp_Object window_end_pos; 196 Lisp_Object window_end_pos;
@@ -223,18 +203,13 @@ struct window
223 did not get onto the frame. */ 203 did not get onto the frame. */
224 Lisp_Object window_end_valid; 204 Lisp_Object window_end_valid;
225 205
226 /* Non-nil means must regenerate mode line of this window */
227 Lisp_Object update_mode_line;
228
229 /* Non-nil means current value of `start'
230 was the beginning of a line when it was chosen. */
231 Lisp_Object start_at_line_beg;
232
233 /* Display-table to use for displaying chars in this window. 206 /* Display-table to use for displaying chars in this window.
234 Nil means use the buffer's own display-table. */ 207 Nil means use the buffer's own display-table. */
235 Lisp_Object display_table; 208 Lisp_Object display_table;
236 209
237 /* Non-nil means window is marked as dedicated. */ 210 /* Non-nil usually means window is marked as dedicated.
211 Note Lisp code may set this to something beyond Qnil
212 and Qt, so bitfield can't be used here. */
238 Lisp_Object dedicated; 213 Lisp_Object dedicated;
239 214
240 /* Line number and position of a line somewhere above the top of the 215 /* Line number and position of a line somewhere above the top of the
@@ -302,6 +277,30 @@ struct window
302 /* This is handy for undrawing the cursor. */ 277 /* This is handy for undrawing the cursor. */
303 int phys_cursor_ascent, phys_cursor_height; 278 int phys_cursor_ascent, phys_cursor_height;
304 279
280 /* Non-zero if this window is a minibuffer window. */
281 unsigned mini : 1;
282
283 /* Non-zero means must regenerate mode line of this window */
284 unsigned update_mode_line : 1;
285
286 /* Non-nil if the buffer was "modified" when the window
287 was last updated. */
288 unsigned last_had_star : 1;
289
290 /* Non-zero means current value of `start'
291 was the beginning of a line when it was chosen. */
292 unsigned start_at_line_beg : 1;
293
294 /* Non-zero means next redisplay must use the value of start
295 set up for it in advance. Set by scrolling commands. */
296 unsigned force_start : 1;
297
298 /* Non-zero means we have explicitly changed the value of start,
299 but that the next redisplay is not obliged to use the new value.
300 This is used in Fdelete_other_windows to force a call to
301 Vwindow_scroll_functions; also by Frecenter with argument. */
302 unsigned optional_new_start : 1;
303
305 /* Non-zero means the cursor is currently displayed. This can be 304 /* Non-zero means the cursor is currently displayed. This can be
306 set to zero by functions overpainting the cursor image. */ 305 set to zero by functions overpainting the cursor image. */
307 unsigned phys_cursor_on_p : 1; 306 unsigned phys_cursor_on_p : 1;
@@ -337,7 +336,7 @@ struct window
337 336
338/* 1 if W is a minibuffer window. */ 337/* 1 if W is a minibuffer window. */
339 338
340#define MINI_WINDOW_P(W) (!NILP ((W)->mini_p)) 339#define MINI_WINDOW_P(W) ((W)->mini)
341 340
342/* General window layout: 341/* General window layout:
343 342
diff --git a/src/xdisp.c b/src/xdisp.c
index f5d17877d1c..0763fc19c73 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11169,7 +11169,7 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
11169 || update_mode_lines 11169 || update_mode_lines
11170 || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) 11170 || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
11171 < BUF_MODIFF (XBUFFER (w->buffer))) 11171 < BUF_MODIFF (XBUFFER (w->buffer)))
11172 != !NILP (w->last_had_star)) 11172 != w->last_had_star)
11173 || ((!NILP (Vtransient_mark_mode) 11173 || ((!NILP (Vtransient_mark_mode)
11174 && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) 11174 && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
11175 != !NILP (w->region_showing))) 11175 != !NILP (w->region_showing)))
@@ -11221,11 +11221,11 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
11221 else 11221 else
11222 /* On a terminal screen, the menu bar is an ordinary screen 11222 /* On a terminal screen, the menu bar is an ordinary screen
11223 line, and this makes it get updated. */ 11223 line, and this makes it get updated. */
11224 w->update_mode_line = Qt; 11224 w->update_mode_line = 1;
11225#else /* ! (USE_X_TOOLKIT || HAVE_NTGUI || HAVE_NS || USE_GTK) */ 11225#else /* ! (USE_X_TOOLKIT || HAVE_NTGUI || HAVE_NS || USE_GTK) */
11226 /* In the non-toolkit version, the menu bar is an ordinary screen 11226 /* In the non-toolkit version, the menu bar is an ordinary screen
11227 line, and this makes it get updated. */ 11227 line, and this makes it get updated. */
11228 w->update_mode_line = Qt; 11228 w->update_mode_line = 1;
11229#endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI || HAVE_NS || USE_GTK) */ 11229#endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI || HAVE_NS || USE_GTK) */
11230 11230
11231 unbind_to (count, Qnil); 11231 unbind_to (count, Qnil);
@@ -11363,11 +11363,11 @@ update_tool_bar (struct frame *f, int save_match_data)
11363 the rest of the redisplay algorithm is about the same as 11363 the rest of the redisplay algorithm is about the same as
11364 windows_or_buffers_changed anyway. */ 11364 windows_or_buffers_changed anyway. */
11365 if (windows_or_buffers_changed 11365 if (windows_or_buffers_changed
11366 || !NILP (w->update_mode_line) 11366 || w->update_mode_line
11367 || update_mode_lines 11367 || update_mode_lines
11368 || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) 11368 || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
11369 < BUF_MODIFF (XBUFFER (w->buffer))) 11369 < BUF_MODIFF (XBUFFER (w->buffer)))
11370 != !NILP (w->last_had_star)) 11370 != w->last_had_star)
11371 || ((!NILP (Vtransient_mark_mode) 11371 || ((!NILP (Vtransient_mark_mode)
11372 && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) 11372 && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
11373 != !NILP (w->region_showing))) 11373 != !NILP (w->region_showing)))
@@ -11418,7 +11418,7 @@ update_tool_bar (struct frame *f, int save_match_data)
11418 BLOCK_INPUT; 11418 BLOCK_INPUT;
11419 f->tool_bar_items = new_tool_bar; 11419 f->tool_bar_items = new_tool_bar;
11420 f->n_tool_bar_items = new_n_tool_bar; 11420 f->n_tool_bar_items = new_n_tool_bar;
11421 w->update_mode_line = Qt; 11421 w->update_mode_line = 1;
11422 UNBLOCK_INPUT; 11422 UNBLOCK_INPUT;
11423 } 11423 }
11424 11424
@@ -12967,9 +12967,9 @@ redisplay_internal (void)
12967 update_mode_lines++; 12967 update_mode_lines++;
12968 12968
12969 /* Detect case that we need to write or remove a star in the mode line. */ 12969 /* Detect case that we need to write or remove a star in the mode line. */
12970 if ((SAVE_MODIFF < MODIFF) != !NILP (w->last_had_star)) 12970 if ((SAVE_MODIFF < MODIFF) != w->last_had_star)
12971 { 12971 {
12972 w->update_mode_line = Qt; 12972 w->update_mode_line = 1;
12973 if (buffer_shared > 1) 12973 if (buffer_shared > 1)
12974 update_mode_lines++; 12974 update_mode_lines++;
12975 } 12975 }
@@ -12986,7 +12986,7 @@ redisplay_internal (void)
12986 && XFASTINT (w->last_modified) >= MODIFF 12986 && XFASTINT (w->last_modified) >= MODIFF
12987 && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF) 12987 && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF)
12988 && (XFASTINT (w->column_number_displayed) != current_column ())) 12988 && (XFASTINT (w->column_number_displayed) != current_column ()))
12989 w->update_mode_line = Qt; 12989 w->update_mode_line = 1;
12990 12990
12991 unbind_to (count1, Qnil); 12991 unbind_to (count1, Qnil);
12992 12992
@@ -13089,7 +13089,7 @@ redisplay_internal (void)
13089 tlendpos = this_line_end_pos; 13089 tlendpos = this_line_end_pos;
13090 if (!consider_all_windows_p 13090 if (!consider_all_windows_p
13091 && CHARPOS (tlbufpos) > 0 13091 && CHARPOS (tlbufpos) > 0
13092 && NILP (w->update_mode_line) 13092 && !w->update_mode_line
13093 && !current_buffer->clip_changed 13093 && !current_buffer->clip_changed
13094 && !current_buffer->prevent_redisplay_optimizations_p 13094 && !current_buffer->prevent_redisplay_optimizations_p
13095 && FRAME_VISIBLE_P (XFRAME (w->frame)) 13095 && FRAME_VISIBLE_P (XFRAME (w->frame))
@@ -13097,8 +13097,8 @@ redisplay_internal (void)
13097 /* Make sure recorded data applies to current buffer, etc. */ 13097 /* Make sure recorded data applies to current buffer, etc. */
13098 && this_line_buffer == current_buffer 13098 && this_line_buffer == current_buffer
13099 && current_buffer == XBUFFER (w->buffer) 13099 && current_buffer == XBUFFER (w->buffer)
13100 && NILP (w->force_start) 13100 && !w->force_start
13101 && NILP (w->optional_new_start) 13101 && !w->optional_new_start
13102 /* Point must be on the line that we have info recorded about. */ 13102 /* Point must be on the line that we have info recorded about. */
13103 && PT >= CHARPOS (tlbufpos) 13103 && PT >= CHARPOS (tlbufpos)
13104 && PT <= Z - CHARPOS (tlendpos) 13104 && PT <= Z - CHARPOS (tlendpos)
@@ -13633,7 +13633,7 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
13633 w->last_overlay_modified 13633 w->last_overlay_modified
13634 = make_number (accurate_p ? BUF_OVERLAY_MODIFF (b) : 0); 13634 = make_number (accurate_p ? BUF_OVERLAY_MODIFF (b) : 0);
13635 w->last_had_star 13635 w->last_had_star
13636 = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b) ? Qt : Qnil; 13636 = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b);
13637 13637
13638 if (accurate_p) 13638 if (accurate_p)
13639 { 13639 {
@@ -13662,7 +13662,7 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
13662 if (accurate_p) 13662 if (accurate_p)
13663 { 13663 {
13664 w->window_end_valid = w->buffer; 13664 w->window_end_valid = w->buffer;
13665 w->update_mode_line = Qnil; 13665 w->update_mode_line = 0;
13666 } 13666 }
13667} 13667}
13668 13668
@@ -15291,7 +15291,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15291 reconsider_clip_changes (w, buffer); 15291 reconsider_clip_changes (w, buffer);
15292 15292
15293 /* Has the mode line to be updated? */ 15293 /* Has the mode line to be updated? */
15294 update_mode_line = (!NILP (w->update_mode_line) 15294 update_mode_line = (w->update_mode_line
15295 || update_mode_lines 15295 || update_mode_lines
15296 || buffer->clip_changed 15296 || buffer->clip_changed
15297 || buffer->prevent_redisplay_optimizations_p); 15297 || buffer->prevent_redisplay_optimizations_p);
@@ -15463,32 +15463,31 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15463 15463
15464 /* If someone specified a new starting point but did not insist, 15464 /* If someone specified a new starting point but did not insist,
15465 check whether it can be used. */ 15465 check whether it can be used. */
15466 if (!NILP (w->optional_new_start) 15466 if (w->optional_new_start
15467 && CHARPOS (startp) >= BEGV 15467 && CHARPOS (startp) >= BEGV
15468 && CHARPOS (startp) <= ZV) 15468 && CHARPOS (startp) <= ZV)
15469 { 15469 {
15470 w->optional_new_start = Qnil; 15470 w->optional_new_start = 0;
15471 start_display (&it, w, startp); 15471 start_display (&it, w, startp);
15472 move_it_to (&it, PT, 0, it.last_visible_y, -1, 15472 move_it_to (&it, PT, 0, it.last_visible_y, -1,
15473 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); 15473 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
15474 if (IT_CHARPOS (it) == PT) 15474 if (IT_CHARPOS (it) == PT)
15475 w->force_start = Qt; 15475 w->force_start = 1;
15476 /* IT may overshoot PT if text at PT is invisible. */ 15476 /* IT may overshoot PT if text at PT is invisible. */
15477 else if (IT_CHARPOS (it) > PT && CHARPOS (startp) <= PT) 15477 else if (IT_CHARPOS (it) > PT && CHARPOS (startp) <= PT)
15478 w->force_start = Qt; 15478 w->force_start = 1;
15479 } 15479 }
15480 15480
15481 force_start: 15481 force_start:
15482 15482
15483 /* Handle case where place to start displaying has been specified, 15483 /* Handle case where place to start displaying has been specified,
15484 unless the specified location is outside the accessible range. */ 15484 unless the specified location is outside the accessible range. */
15485 if (!NILP (w->force_start) 15485 if (w->force_start || w->frozen_window_start_p)
15486 || w->frozen_window_start_p)
15487 { 15486 {
15488 /* We set this later on if we have to adjust point. */ 15487 /* We set this later on if we have to adjust point. */
15489 int new_vpos = -1; 15488 int new_vpos = -1;
15490 15489
15491 w->force_start = Qnil; 15490 w->force_start = 0;
15492 w->vscroll = 0; 15491 w->vscroll = 0;
15493 w->window_end_valid = Qnil; 15492 w->window_end_valid = Qnil;
15494 15493
@@ -15507,7 +15506,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15507 || ! NILP (Vwindow_scroll_functions)) 15506 || ! NILP (Vwindow_scroll_functions))
15508 { 15507 {
15509 update_mode_line = 1; 15508 update_mode_line = 1;
15510 w->update_mode_line = Qt; 15509 w->update_mode_line = 1;
15511 startp = run_window_scroll_functions (window, startp); 15510 startp = run_window_scroll_functions (window, startp);
15512 } 15511 }
15513 15512
@@ -15525,7 +15524,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15525 the scroll margin (bug#148) -- cyd */ 15524 the scroll margin (bug#148) -- cyd */
15526 if (!try_window (window, startp, 0)) 15525 if (!try_window (window, startp, 0))
15527 { 15526 {
15528 w->force_start = Qt; 15527 w->force_start = 1;
15529 clear_glyph_matrix (w->desired_matrix); 15528 clear_glyph_matrix (w->desired_matrix);
15530 goto need_larger_matrices; 15529 goto need_larger_matrices;
15531 } 15530 }
@@ -15604,7 +15603,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15604 } 15603 }
15605 /* If current starting point was originally the beginning of a line 15604 /* If current starting point was originally the beginning of a line
15606 but no longer is, find a new starting point. */ 15605 but no longer is, find a new starting point. */
15607 else if (!NILP (w->start_at_line_beg) 15606 else if (w->start_at_line_beg
15608 && !(CHARPOS (startp) <= BEGV 15607 && !(CHARPOS (startp) <= BEGV
15609 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n')) 15608 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n'))
15610 { 15609 {
@@ -15651,7 +15650,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15651 new window start, since that would change the position under 15650 new window start, since that would change the position under
15652 the mouse, resulting in an unwanted mouse-movement rather 15651 the mouse, resulting in an unwanted mouse-movement rather
15653 than a simple mouse-click. */ 15652 than a simple mouse-click. */
15654 if (NILP (w->start_at_line_beg) 15653 if (!w->start_at_line_beg
15655 && NILP (do_mouse_tracking) 15654 && NILP (do_mouse_tracking)
15656 && CHARPOS (startp) > BEGV 15655 && CHARPOS (startp) > BEGV
15657 && CHARPOS (startp) > BEG + beg_unchanged 15656 && CHARPOS (startp) > BEG + beg_unchanged
@@ -15671,7 +15670,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15671 See bug#9324. */ 15670 See bug#9324. */
15672 && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) 15671 && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6))
15673 { 15672 {
15674 w->force_start = Qt; 15673 w->force_start = 1;
15675 SET_TEXT_POS_FROM_MARKER (startp, w->start); 15674 SET_TEXT_POS_FROM_MARKER (startp, w->start);
15676 goto force_start; 15675 goto force_start;
15677 } 15676 }
@@ -15732,7 +15731,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15732 if (!update_mode_line) 15731 if (!update_mode_line)
15733 { 15732 {
15734 update_mode_line = 1; 15733 update_mode_line = 1;
15735 w->update_mode_line = Qt; 15734 w->update_mode_line = 1;
15736 } 15735 }
15737 15736
15738 /* Try to scroll by specified few lines. */ 15737 /* Try to scroll by specified few lines. */
@@ -15987,9 +15986,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15987 done: 15986 done:
15988 15987
15989 SET_TEXT_POS_FROM_MARKER (startp, w->start); 15988 SET_TEXT_POS_FROM_MARKER (startp, w->start);
15990 w->start_at_line_beg = ((CHARPOS (startp) == BEGV 15989 w->start_at_line_beg = (CHARPOS (startp) == BEGV
15991 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n') 15990 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n');
15992 ? Qt : Qnil);
15993 15991
15994 /* Display the mode line, if we must. */ 15992 /* Display the mode line, if we must. */
15995 if ((update_mode_line 15993 if ((update_mode_line
@@ -16206,7 +16204,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16206 /* If bottom moved off end of frame, change mode line percentage. */ 16204 /* If bottom moved off end of frame, change mode line percentage. */
16207 if (XFASTINT (w->window_end_pos) <= 0 16205 if (XFASTINT (w->window_end_pos) <= 0
16208 && Z != IT_CHARPOS (it)) 16206 && Z != IT_CHARPOS (it))
16209 w->update_mode_line = Qt; 16207 w->update_mode_line = 1;
16210 16208
16211 /* Set window_end_pos to the offset of the last character displayed 16209 /* Set window_end_pos to the offset of the last character displayed
16212 on the window from the end of current_buffer. Set 16210 on the window from the end of current_buffer. Set
diff --git a/src/xfns.c b/src/xfns.c
index 1f1d3d3ef0c..b8ea9137a75 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1207,7 +1207,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1207 FRAME_EXTERNAL_MENU_BAR (f) = 1; 1207 FRAME_EXTERNAL_MENU_BAR (f) = 1;
1208 if (FRAME_X_P (f) && f->output_data.x->menubar_widget == 0) 1208 if (FRAME_X_P (f) && f->output_data.x->menubar_widget == 0)
1209 /* Make sure next redisplay shows the menu bar. */ 1209 /* Make sure next redisplay shows the menu bar. */
1210 XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt; 1210 XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = 1;
1211 } 1211 }
1212 else 1212 else
1213 { 1213 {