aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-07-02 06:08:48 +0000
committerRichard M. Stallman1995-07-02 06:08:48 +0000
commit28995e670654d1e2924a476fdd45aaad23b0a2ce (patch)
treeab69a0861d8bd5dcb2c8ac55dc8cd4c211966978 /src
parent715bde06c9e5acd869e56193751285708886a58f (diff)
downloademacs-28995e670654d1e2924a476fdd45aaad23b0a2ce.tar.gz
emacs-28995e670654d1e2924a476fdd45aaad23b0a2ce.zip
(clip_changed): Variable deleted.
(prepare_menu_bars): Don't look at clip_changed. (redisplay): Don't set clip_changed. Do set b's clip_changed. (redisplay_window): Check clip_changed in current_buffer. (mark_window_display_accurate): Clear clip_changed in the window's buffer. (redisplay_window): Update individual window's mode line if %c calls for an update. (redisplay): Set update_mode_line for selected window only, if it needs this because of %c.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 8438a4e819b..bb238f26294 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -205,10 +205,6 @@ int end_unchanged;
205 contain no useful information */ 205 contain no useful information */
206int unchanged_modified; 206int unchanged_modified;
207 207
208/* Nonzero if head_clip or tail_clip of current buffer has changed
209 since last redisplay that finished */
210int clip_changed;
211
212/* Nonzero if window sizes or contents have changed 208/* Nonzero if window sizes or contents have changed
213 since last redisplay that finished */ 209 since last redisplay that finished */
214int windows_or_buffers_changed; 210int windows_or_buffers_changed;
@@ -684,7 +680,7 @@ prepare_menu_bars ()
684 struct gcpro gcpro1, gcpro2; 680 struct gcpro gcpro1, gcpro2;
685 681
686 all_windows = (update_mode_lines || buffer_shared > 1 682 all_windows = (update_mode_lines || buffer_shared > 1
687 || clip_changed || windows_or_buffers_changed); 683 || windows_or_buffers_changed);
688 684
689 /* Update all frame titles based on their buffer names, etc. 685 /* Update all frame titles based on their buffer names, etc.
690 We do this before the menu bars so that the buffer-menu 686 We do this before the menu bars so that the buffer-menu
@@ -812,9 +808,7 @@ redisplay ()
812 808
813 prepare_menu_bars (); 809 prepare_menu_bars ();
814 810
815 if (clip_changed || windows_or_buffers_changed 811 if (windows_or_buffers_changed)
816 || (!NILP (w->column_number_displayed)
817 && XFASTINT (w->column_number_displayed) != current_column ()))
818 update_mode_lines++; 812 update_mode_lines++;
819 813
820 /* Detect case that we need to write a star in the mode line. */ 814 /* Detect case that we need to write a star in the mode line. */
@@ -826,6 +820,15 @@ redisplay ()
826 update_mode_lines++; 820 update_mode_lines++;
827 } 821 }
828 822
823 /* If %c is in use, update it if needed. */
824 if (!NILP (w->column_number_displayed)
825 /* This alternative quickly identifies a common case
826 where no change is needed. */
827 && !(PT == XFASTINT (w->last_point)
828 && XFASTINT (w->last_modified) >= MODIFF)
829 && XFASTINT (w->column_number_displayed) != current_column ())
830 w->update_mode_line = Qt;
831
829 FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1; 832 FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1;
830 833
831 all_windows = update_mode_lines || buffer_shared > 1; 834 all_windows = update_mode_lines || buffer_shared > 1;
@@ -834,7 +837,7 @@ redisplay ()
834 to ensure we remove any arrow that should no longer exist. */ 837 to ensure we remove any arrow that should no longer exist. */
835 if (! EQ (Voverlay_arrow_position, last_arrow_position) 838 if (! EQ (Voverlay_arrow_position, last_arrow_position)
836 || ! EQ (Voverlay_arrow_string, last_arrow_string)) 839 || ! EQ (Voverlay_arrow_string, last_arrow_string))
837 all_windows = 1, clip_changed = 1; 840 all_windows = 1;
838 841
839 /* Normally the message* functions will have already displayed and 842 /* Normally the message* functions will have already displayed and
840 updated the echo area, but the frame may have been trashed, or 843 updated the echo area, but the frame may have been trashed, or
@@ -1109,7 +1112,6 @@ update:
1109 register struct buffer *b = XBUFFER (w->buffer); 1112 register struct buffer *b = XBUFFER (w->buffer);
1110 1113
1111 blank_end_of_window = 0; 1114 blank_end_of_window = 0;
1112 clip_changed = 0;
1113 unchanged_modified = BUF_MODIFF (b); 1115 unchanged_modified = BUF_MODIFF (b);
1114 beg_unchanged = BUF_GPT (b) - BUF_BEG (b); 1116 beg_unchanged = BUF_GPT (b) - BUF_BEG (b);
1115 end_unchanged = BUF_Z (b) - BUF_GPT (b); 1117 end_unchanged = BUF_Z (b) - BUF_GPT (b);
@@ -1122,6 +1124,7 @@ update:
1122 mark_window_display_accurate (FRAME_ROOT_WINDOW (selected_frame), 1); 1124 mark_window_display_accurate (FRAME_ROOT_WINDOW (selected_frame), 1);
1123 else 1125 else
1124 { 1126 {
1127 b->clip_changed = 0;
1125 w->update_mode_line = Qnil; 1128 w->update_mode_line = Qnil;
1126 XSETFASTINT (w->last_modified, BUF_MODIFF (b)); 1129 XSETFASTINT (w->last_modified, BUF_MODIFF (b));
1127 w->window_end_valid = w->buffer; 1130 w->window_end_valid = w->buffer;
@@ -1203,6 +1206,8 @@ mark_window_display_accurate (window, flag)
1203 1206
1204 w->window_end_valid = w->buffer; 1207 w->window_end_valid = w->buffer;
1205 w->update_mode_line = Qnil; 1208 w->update_mode_line = Qnil;
1209 if (!NILP (w->buffer))
1210 XBUFFER (w->buffer)->clip_changed = 0;
1206 1211
1207 if (!NILP (w->vchild)) 1212 if (!NILP (w->vchild))
1208 mark_window_display_accurate (w->vchild, flag); 1213 mark_window_display_accurate (w->vchild, flag);
@@ -1385,6 +1390,15 @@ redisplay_window (window, just_this_one)
1385 1390
1386 opoint = PT; 1391 opoint = PT;
1387 1392
1393 /* If %c is in mode line, update it if needed. */
1394 if (!NILP (w->column_number_displayed)
1395 /* This alternative quickly identifies a common case
1396 where no change is needed. */
1397 && !(PT == XFASTINT (w->last_point)
1398 && XFASTINT (w->last_modified) >= MODIFF)
1399 && XFASTINT (w->column_number_displayed) != current_column ())
1400 update_mode_line = 1;
1401
1388 /* Count number of windows showing the selected buffer. 1402 /* Count number of windows showing the selected buffer.
1389 An indirect buffer counts as its base buffer. */ 1403 An indirect buffer counts as its base buffer. */
1390 1404
@@ -1511,7 +1525,7 @@ redisplay_window (window, just_this_one)
1511 in redisplay handles the same cases. */ 1525 in redisplay handles the same cases. */
1512 1526
1513 if (XFASTINT (w->last_modified) >= MODIFF 1527 if (XFASTINT (w->last_modified) >= MODIFF
1514 && PT >= startp && !clip_changed 1528 && PT >= startp && current_buffer->clip_changed
1515 && (just_this_one || XFASTINT (w->width) == FRAME_WIDTH (f)) 1529 && (just_this_one || XFASTINT (w->width) == FRAME_WIDTH (f))
1516 /* If force-mode-line-update was called, really redisplay; 1530 /* If force-mode-line-update was called, really redisplay;
1517 that's how redisplay is forced after e.g. changing 1531 that's how redisplay is forced after e.g. changing
@@ -1565,7 +1579,7 @@ redisplay_window (window, just_this_one)
1565 /* or else vmotion on first line won't work. */ 1579 /* or else vmotion on first line won't work. */
1566 && ! NILP (w->start_at_line_beg) 1580 && ! NILP (w->start_at_line_beg)
1567 && ! EQ (w->window_end_valid, Qnil) 1581 && ! EQ (w->window_end_valid, Qnil)
1568 && do_id && !clip_changed 1582 && do_id && current_buffer->clip_changed
1569 && !blank_end_of_window 1583 && !blank_end_of_window
1570 && XFASTINT (w->width) == FRAME_WIDTH (f) 1584 && XFASTINT (w->width) == FRAME_WIDTH (f)
1571 /* Can't use this case if highlighting a region. */ 1585 /* Can't use this case if highlighting a region. */
@@ -1597,7 +1611,8 @@ redisplay_window (window, just_this_one)
1597 try_window (window, startp); 1611 try_window (window, startp);
1598 if (cursor_vpos >= 0) 1612 if (cursor_vpos >= 0)
1599 { 1613 {
1600 if (!just_this_one || clip_changed || beg_unchanged < startp) 1614 if (!just_this_one || current_buffer->clip_changed
1615 || beg_unchanged < startp)
1601 /* Forget any recorded base line for line number display. */ 1616 /* Forget any recorded base line for line number display. */
1602 w->base_line_number = Qnil; 1617 w->base_line_number = Qnil;
1603 goto done; 1618 goto done;
@@ -1618,7 +1633,7 @@ redisplay_window (window, just_this_one)
1618 1633
1619 /* Try to scroll by specified few lines */ 1634 /* Try to scroll by specified few lines */
1620 1635
1621 if (scroll_step && !clip_changed) 1636 if (scroll_step && !current_buffer->clip_changed)
1622 { 1637 {
1623 if (PT > startp) 1638 if (PT > startp)
1624 { 1639 {
@@ -1634,7 +1649,8 @@ redisplay_window (window, just_this_one)
1634 try_window (window, pos.bufpos); 1649 try_window (window, pos.bufpos);
1635 if (cursor_vpos >= 0) 1650 if (cursor_vpos >= 0)
1636 { 1651 {
1637 if (!just_this_one || clip_changed || beg_unchanged < startp) 1652 if (!just_this_one || current_buffer->clip_changed
1653 || beg_unchanged < startp)
1638 /* Forget any recorded base line for line number display. */ 1654 /* Forget any recorded base line for line number display. */
1639 w->base_line_number = Qnil; 1655 w->base_line_number = Qnil;
1640 goto done; 1656 goto done;