aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2013-11-29 23:04:18 -0500
committerStefan Monnier2013-11-29 23:04:18 -0500
commit44ad1cf76039dc5a2a94e82a6b6eb13124c3cc92 (patch)
treea53d87186d083b79974f8bfaba75fbeaa5e06e6f /src
parentf9b697ddaa60742d4a60b1fa4ab37efc2c3cb1e1 (diff)
downloademacs-44ad1cf76039dc5a2a94e82a6b6eb13124c3cc92.tar.gz
emacs-44ad1cf76039dc5a2a94e82a6b6eb13124c3cc92.zip
* src/xdisp.c (redisplay_internal): Don't call set_window_update_flags.
Set invisible frames's `redisplay' when a full redisplay is requested. (redisplay_window): Set must_be_updated_p instead. (redisplay_mode_lines): Don't set must_be_updated_p any more. (display_mode_lines): Set it here instead. * src/dispextern.h (set_window_update_flags): Remove. * src/dispnew.c (set_window_update_flags): Remove `b' argument; make static. Fixes: debbugs:15999
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/dispextern.h1
-rw-r--r--src/dispnew.c28
-rw-r--r--src/lisp.h2
-rw-r--r--src/xdisp.c137
-rw-r--r--src/xterm.c2
6 files changed, 97 insertions, 85 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a626c2b1963..058597586e5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12013-11-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xdisp.c (redisplay_internal): Don't call set_window_update_flags.
4 Set invisible frames's `redisplay' when a full redisplay is requested.
5 (redisplay_window): Set must_be_updated_p instead (bug#15999).
6 (redisplay_mode_lines): Don't set must_be_updated_p any more.
7 (display_mode_lines): Set it here instead.
8
9 * dispnew.c (set_window_update_flags): Remove `b' argument; make static.
10
11 * dispextern.h (set_window_update_flags): Remove.
12
12013-11-29 Stefan Monnier <monnier@iro.umontreal.ca> 132013-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
2 14
3 * fns.c (internal_equal): Add a hash_table argument to handle cycles. 15 * fns.c (internal_equal): Add a hash_table argument to handle cycles.
diff --git a/src/dispextern.h b/src/dispextern.h
index d40febd207a..6f162316242 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3462,7 +3462,6 @@ void blank_row (struct window *, struct glyph_row *, int);
3462void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); 3462void clear_glyph_matrix_rows (struct glyph_matrix *, int, int);
3463void clear_glyph_row (struct glyph_row *); 3463void clear_glyph_row (struct glyph_row *);
3464void prepare_desired_row (struct glyph_row *); 3464void prepare_desired_row (struct glyph_row *);
3465void set_window_update_flags (struct window *, struct buffer *, bool);
3466void update_single_window (struct window *, bool); 3465void update_single_window (struct window *, bool);
3467void do_pending_window_change (bool); 3466void do_pending_window_change (bool);
3468void change_frame_size (struct frame *, int, int, bool, bool, bool); 3467void change_frame_size (struct frame *, int, int, bool, bool, bool);
diff --git a/src/dispnew.c b/src/dispnew.c
index 3207f4a0018..b68cc2e54f8 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -97,6 +97,7 @@ static bool scrolling (struct frame *);
97static void set_window_cursor_after_update (struct window *); 97static void set_window_cursor_after_update (struct window *);
98static void adjust_frame_glyphs_for_window_redisplay (struct frame *); 98static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
99static void adjust_frame_glyphs_for_frame_redisplay (struct frame *); 99static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
100static void set_window_update_flags (struct window *w, bool on_p);
100 101
101/* True means last display completed. False means it was preempted. */ 102/* True means last display completed. False means it was preempted. */
102 103
@@ -2944,8 +2945,8 @@ redraw_frame (struct frame *f)
2944 /* Mark all windows as inaccurate, so that every window will have 2945 /* Mark all windows as inaccurate, so that every window will have
2945 its redisplay done. */ 2946 its redisplay done. */
2946 mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0); 2947 mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0);
2947 set_window_update_flags (XWINDOW (FRAME_ROOT_WINDOW (f)), NULL, 1); 2948 set_window_update_flags (XWINDOW (FRAME_ROOT_WINDOW (f)), true);
2948 f->garbaged = 0; 2949 f->garbaged = false;
2949} 2950}
2950 2951
2951DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 0, 1, 0, 2952DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 0, 1, 0,
@@ -3029,7 +3030,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3029 Lisp_Object tem; 3030 Lisp_Object tem;
3030 3031
3031 update_window (w, 1); 3032 update_window (w, 1);
3032 w->must_be_updated_p = 0; 3033 w->must_be_updated_p = false;
3033 3034
3034 /* Swap tool-bar strings. We swap because we want to 3035 /* Swap tool-bar strings. We swap because we want to
3035 reuse strings. */ 3036 reuse strings. */
@@ -3075,7 +3076,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3075 3076
3076 do_pause: 3077 do_pause:
3077 /* Reset flags indicating that a window should be updated. */ 3078 /* Reset flags indicating that a window should be updated. */
3078 set_window_update_flags (root_window, NULL, 0); 3079 set_window_update_flags (root_window, false);
3079 3080
3080 display_completed = !paused_p; 3081 display_completed = !paused_p;
3081 return paused_p; 3082 return paused_p;
@@ -3098,7 +3099,7 @@ update_frame_with_menu (struct frame *f)
3098 frame matrix we operate. */ 3099 frame matrix we operate. */
3099 set_frame_matrix_frame (f); 3100 set_frame_matrix_frame (f);
3100 3101
3101 /* Update the display */ 3102 /* Update the display. */
3102 update_begin (f); 3103 update_begin (f);
3103 /* Force update_frame_1 not to stop due to pending input, and not 3104 /* Force update_frame_1 not to stop due to pending input, and not
3104 try scrolling. */ 3105 try scrolling. */
@@ -3122,7 +3123,7 @@ update_frame_with_menu (struct frame *f)
3122#endif 3123#endif
3123 3124
3124 /* Reset flags indicating that a window should be updated. */ 3125 /* Reset flags indicating that a window should be updated. */
3125 set_window_update_flags (root_window, NULL, 0); 3126 set_window_update_flags (root_window, false);
3126} 3127}
3127 3128
3128 3129
@@ -3174,7 +3175,7 @@ update_single_window (struct window *w, bool force_p)
3174 update_end (f); 3175 update_end (f);
3175 3176
3176 /* Reset flag in W. */ 3177 /* Reset flag in W. */
3177 w->must_be_updated_p = 0; 3178 w->must_be_updated_p = false;
3178 } 3179 }
3179} 3180}
3180 3181
@@ -3897,18 +3898,17 @@ set_window_cursor_after_update (struct window *w)
3897} 3898}
3898 3899
3899 3900
3900/* If B is NULL, set WINDOW->must_be_updated_p to ON_P for all windows in 3901/* Set WINDOW->must_be_updated_p to ON_P for all windows in
3901 the window tree rooted at W. Otherwise set WINDOW->must_be_updated_p 3902 the window tree rooted at W. */
3902 to ON_P only for windows that displays B. */
3903 3903
3904void 3904static void
3905set_window_update_flags (struct window *w, struct buffer *b, bool on_p) 3905set_window_update_flags (struct window *w, bool on_p)
3906{ 3906{
3907 while (w) 3907 while (w)
3908 { 3908 {
3909 if (WINDOWP (w->contents)) 3909 if (WINDOWP (w->contents))
3910 set_window_update_flags (XWINDOW (w->contents), b, on_p); 3910 set_window_update_flags (XWINDOW (w->contents), on_p);
3911 else if (!(b && b != XBUFFER (w->contents))) 3911 else
3912 w->must_be_updated_p = on_p; 3912 w->must_be_updated_p = on_p;
3913 3913
3914 w = NILP (w->next) ? 0 : XWINDOW (w->next); 3914 w = NILP (w->next) ? 0 : XWINDOW (w->next);
diff --git a/src/lisp.h b/src/lisp.h
index 376235a402d..52b20b73ae1 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3523,7 +3523,7 @@ extern void pop_message_unwind (void);
3523extern Lisp_Object restore_message_unwind (Lisp_Object); 3523extern Lisp_Object restore_message_unwind (Lisp_Object);
3524extern void restore_message (void); 3524extern void restore_message (void);
3525extern Lisp_Object current_message (void); 3525extern Lisp_Object current_message (void);
3526extern void clear_message (int, int); 3526extern void clear_message (bool, bool);
3527extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); 3527extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
3528extern void message1 (const char *); 3528extern void message1 (const char *);
3529extern void message1_nolog (const char *); 3529extern void message1_nolog (const char *);
diff --git a/src/xdisp.c b/src/xdisp.c
index 0311d5d2d75..28da6bffb92 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -835,7 +835,7 @@ static int single_display_spec_string_p (Lisp_Object, Lisp_Object);
835static int display_prop_string_p (Lisp_Object, Lisp_Object); 835static int display_prop_string_p (Lisp_Object, Lisp_Object);
836static int row_for_charpos_p (struct glyph_row *, ptrdiff_t); 836static int row_for_charpos_p (struct glyph_row *, ptrdiff_t);
837static int cursor_row_p (struct glyph_row *); 837static int cursor_row_p (struct glyph_row *);
838static int redisplay_mode_lines (Lisp_Object, int); 838static int redisplay_mode_lines (Lisp_Object, bool);
839static char *decode_mode_spec_coding (Lisp_Object, char *, int); 839static char *decode_mode_spec_coding (Lisp_Object, char *, int);
840 840
841static Lisp_Object get_it_property (struct it *it, Lisp_Object prop); 841static Lisp_Object get_it_property (struct it *it, Lisp_Object prop);
@@ -889,7 +889,7 @@ static void sync_frame_with_window_matrix_rows (struct window *);
889static void redisplay_internal (void); 889static void redisplay_internal (void);
890static int echo_area_display (int); 890static int echo_area_display (int);
891static void redisplay_windows (Lisp_Object); 891static void redisplay_windows (Lisp_Object);
892static void redisplay_window (Lisp_Object, int); 892static void redisplay_window (Lisp_Object, bool);
893static Lisp_Object redisplay_window_error (Lisp_Object); 893static Lisp_Object redisplay_window_error (Lisp_Object);
894static Lisp_Object redisplay_window_0 (Lisp_Object); 894static Lisp_Object redisplay_window_0 (Lisp_Object);
895static Lisp_Object redisplay_window_1 (Lisp_Object); 895static Lisp_Object redisplay_window_1 (Lisp_Object);
@@ -1429,7 +1429,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1429 if (top_y < window_top_y) 1429 if (top_y < window_top_y)
1430 visible_p = bottom_y > window_top_y; 1430 visible_p = bottom_y > window_top_y;
1431 else if (top_y < it.last_visible_y) 1431 else if (top_y < it.last_visible_y)
1432 visible_p = 1; 1432 visible_p = true;
1433 if (bottom_y >= it.last_visible_y 1433 if (bottom_y >= it.last_visible_y
1434 && it.bidi_p && it.bidi_it.scan_dir == -1 1434 && it.bidi_p && it.bidi_it.scan_dir == -1
1435 && IT_CHARPOS (it) < charpos) 1435 && IT_CHARPOS (it) < charpos)
@@ -1667,7 +1667,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1667 if (charpos < IT_CHARPOS (it) 1667 if (charpos < IT_CHARPOS (it)
1668 || (it.what == IT_EOB && charpos == IT_CHARPOS (it))) 1668 || (it.what == IT_EOB && charpos == IT_CHARPOS (it)))
1669 { 1669 {
1670 visible_p = 1; 1670 visible_p = true;
1671 RESTORE_IT (&it2, &it2, it2data); 1671 RESTORE_IT (&it2, &it2, it2data);
1672 move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS); 1672 move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS);
1673 *x = it2.current_x; 1673 *x = it2.current_x;
@@ -2913,7 +2913,7 @@ init_iterator (struct it *it, struct window *w,
2913 with a left box line. */ 2913 with a left box line. */
2914 face = FACE_FROM_ID (it->f, remapped_base_face_id); 2914 face = FACE_FROM_ID (it->f, remapped_base_face_id);
2915 if (face->box != FACE_NO_BOX) 2915 if (face->box != FACE_NO_BOX)
2916 it->start_of_box_run_p = 1; 2916 it->start_of_box_run_p = true;
2917 } 2917 }
2918 2918
2919 /* If a buffer position was specified, set the iterator there, 2919 /* If a buffer position was specified, set the iterator there,
@@ -3341,7 +3341,7 @@ handle_stop (struct it *it)
3341 pop_it (it); 3341 pop_it (it);
3342 else 3342 else
3343 { 3343 {
3344 it->ignore_overlay_strings_at_pos_p = 1; 3344 it->ignore_overlay_strings_at_pos_p = true;
3345 it->string_from_display_prop_p = 0; 3345 it->string_from_display_prop_p = 0;
3346 it->from_disp_prop_p = 0; 3346 it->from_disp_prop_p = 0;
3347 handle_overlay_change_p = 0; 3347 handle_overlay_change_p = 0;
@@ -4206,13 +4206,13 @@ handle_invisible_prop (struct it *it)
4206 prop = Fget_text_property (end_charpos, Qinvisible, it->string); 4206 prop = Fget_text_property (end_charpos, Qinvisible, it->string);
4207 invis_p = TEXT_PROP_MEANS_INVISIBLE (prop); 4207 invis_p = TEXT_PROP_MEANS_INVISIBLE (prop);
4208 if (invis_p == 2) 4208 if (invis_p == 2)
4209 display_ellipsis_p = 1; 4209 display_ellipsis_p = true;
4210 } 4210 }
4211 } 4211 }
4212 while (invis_p && endpos < len); 4212 while (invis_p && endpos < len);
4213 4213
4214 if (display_ellipsis_p) 4214 if (display_ellipsis_p)
4215 it->ellipsis_p = 1; 4215 it->ellipsis_p = true;
4216 4216
4217 if (endpos < len) 4217 if (endpos < len)
4218 { 4218 {
@@ -4324,9 +4324,9 @@ handle_invisible_prop (struct it *it)
4324 tem = next_stop; 4324 tem = next_stop;
4325 4325
4326 /* If there are adjacent invisible texts, don't lose the 4326 /* If there are adjacent invisible texts, don't lose the
4327 second one's ellipsis. */ 4327 second one's ellipsis. */
4328 if (invis_p == 2) 4328 if (invis_p == 2)
4329 display_ellipsis_p = 1; 4329 display_ellipsis_p = true;
4330 } 4330 }
4331 while (invis_p); 4331 while (invis_p);
4332 4332
@@ -4334,10 +4334,10 @@ handle_invisible_prop (struct it *it)
4334 if (it->bidi_p) 4334 if (it->bidi_p)
4335 { 4335 {
4336 ptrdiff_t bpos = CHAR_TO_BYTE (newpos); 4336 ptrdiff_t bpos = CHAR_TO_BYTE (newpos);
4337 int on_newline = 4337 int on_newline
4338 bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n'; 4338 = bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n';
4339 int after_newline = 4339 int after_newline
4340 newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n'; 4340 = newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
4341 4341
4342 /* If the invisible text ends on a newline or on a 4342 /* If the invisible text ends on a newline or on a
4343 character after a newline, we can avoid the costly, 4343 character after a newline, we can avoid the costly,
@@ -4444,7 +4444,7 @@ handle_invisible_prop (struct it *it)
4444 it->position.charpos = newpos - 1; 4444 it->position.charpos = newpos - 1;
4445 it->position.bytepos = CHAR_TO_BYTE (it->position.charpos); 4445 it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
4446 } 4446 }
4447 it->ellipsis_p = 1; 4447 it->ellipsis_p = true;
4448 /* Let the ellipsis display before 4448 /* Let the ellipsis display before
4449 considering any properties of the following char. 4449 considering any properties of the following char.
4450 Fixes jasonr@gnu.org 01 Oct 07 bug. */ 4450 Fixes jasonr@gnu.org 01 Oct 07 bug. */
@@ -4489,7 +4489,7 @@ setup_for_ellipsis (struct it *it, int len)
4489 it->saved_face_id = it->face_id = DEFAULT_FACE_ID; 4489 it->saved_face_id = it->face_id = DEFAULT_FACE_ID;
4490 4490
4491 it->method = GET_FROM_DISPLAY_VECTOR; 4491 it->method = GET_FROM_DISPLAY_VECTOR;
4492 it->ellipsis_p = 1; 4492 it->ellipsis_p = true;
4493} 4493}
4494 4494
4495 4495
@@ -4958,7 +4958,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
4958 it->method = GET_FROM_IMAGE; 4958 it->method = GET_FROM_IMAGE;
4959 it->from_overlay = Qnil; 4959 it->from_overlay = Qnil;
4960 it->face_id = face_id; 4960 it->face_id = face_id;
4961 it->from_disp_prop_p = 1; 4961 it->from_disp_prop_p = true;
4962 4962
4963 /* Say that we haven't consumed the characters with 4963 /* Say that we haven't consumed the characters with
4964 `display' property yet. The call to pop_it in 4964 `display' property yet. The call to pop_it in
@@ -5040,7 +5040,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
5040 when we are finished with the glyph property value. */ 5040 when we are finished with the glyph property value. */
5041 push_it (it, position); 5041 push_it (it, position);
5042 it->from_overlay = overlay; 5042 it->from_overlay = overlay;
5043 it->from_disp_prop_p = 1; 5043 it->from_disp_prop_p = true;
5044 5044
5045 if (NILP (location)) 5045 if (NILP (location))
5046 it->area = TEXT_AREA; 5046 it->area = TEXT_AREA;
@@ -5060,7 +5060,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
5060 it->stop_charpos = 0; 5060 it->stop_charpos = 0;
5061 it->prev_stop = 0; 5061 it->prev_stop = 0;
5062 it->base_level_stop = 0; 5062 it->base_level_stop = 0;
5063 it->string_from_display_prop_p = 1; 5063 it->string_from_display_prop_p = true;
5064 /* Say that we haven't consumed the characters with 5064 /* Say that we haven't consumed the characters with
5065 `display' property yet. The call to pop_it in 5065 `display' property yet. The call to pop_it in
5066 set_iterator_to_next will clean this up. */ 5066 set_iterator_to_next will clean this up. */
@@ -5426,7 +5426,7 @@ next_overlay_string (struct it *it)
5426 processed the overlay strings there already, so that 5426 processed the overlay strings there already, so that
5427 next_element_from_buffer doesn't try it again. */ 5427 next_element_from_buffer doesn't try it again. */
5428 if (NILP (it->string) && IT_CHARPOS (*it) >= it->end_charpos) 5428 if (NILP (it->string) && IT_CHARPOS (*it) >= it->end_charpos)
5429 it->overlay_strings_at_end_processed_p = 1; 5429 it->overlay_strings_at_end_processed_p = true;
5430 } 5430 }
5431 else 5431 else
5432 { 5432 {
@@ -6109,7 +6109,7 @@ forward_to_next_line_start (struct it *it, int *skipped_p,
6109 if (bidi_it_prev) 6109 if (bidi_it_prev)
6110 *bidi_it_prev = bprev; 6110 *bidi_it_prev = bprev;
6111 } 6111 }
6112 *skipped_p = newline_found_p = 1; 6112 *skipped_p = newline_found_p = true;
6113 } 6113 }
6114 else 6114 else
6115 { 6115 {
@@ -6799,9 +6799,9 @@ get_next_display_element (struct it *it)
6799 if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display)) 6799 if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display))
6800 { 6800 {
6801 if (c == 0xA0) 6801 if (c == 0xA0)
6802 nonascii_space_p = 1; 6802 nonascii_space_p = true;
6803 else if (c == 0xAD || c == 0x2010 || c == 0x2011) 6803 else if (c == 0xAD || c == 0x2010 || c == 0x2011)
6804 nonascii_hyphen_p = 1; 6804 nonascii_hyphen_p = true;
6805 } 6805 }
6806 6806
6807 /* Translate control characters into `\003' or `^C' form. 6807 /* Translate control characters into `\003' or `^C' form.
@@ -7260,12 +7260,12 @@ set_iterator_to_next (struct it *it, int reseat_p)
7260 if (it->method == GET_FROM_STRING 7260 if (it->method == GET_FROM_STRING
7261 && it->current.overlay_string_index >= 0 7261 && it->current.overlay_string_index >= 0
7262 && it->n_overlay_strings > 0) 7262 && it->n_overlay_strings > 0)
7263 it->ignore_overlay_strings_at_pos_p = 1; 7263 it->ignore_overlay_strings_at_pos_p = true;
7264 it->len = it->dpvec_char_len; 7264 it->len = it->dpvec_char_len;
7265 set_iterator_to_next (it, reseat_p); 7265 set_iterator_to_next (it, reseat_p);
7266 } 7266 }
7267 7267
7268 /* Maybe recheck faces after display vector */ 7268 /* Maybe recheck faces after display vector. */
7269 if (recheck_faces) 7269 if (recheck_faces)
7270 it->stop_charpos = IT_CHARPOS (*it); 7270 it->stop_charpos = IT_CHARPOS (*it);
7271 } 7271 }
@@ -7290,7 +7290,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
7290 else 7290 else
7291 { 7291 {
7292 /* Not an overlay string. There could be padding, so test 7292 /* Not an overlay string. There could be padding, so test
7293 against it->end_charpos . */ 7293 against it->end_charpos. */
7294 if (IT_STRING_CHARPOS (*it) >= it->end_charpos) 7294 if (IT_STRING_CHARPOS (*it) >= it->end_charpos)
7295 goto consider_string_end; 7295 goto consider_string_end;
7296 } 7296 }
@@ -7802,7 +7802,7 @@ next_element_from_string (struct it *it)
7802static int 7802static int
7803next_element_from_c_string (struct it *it) 7803next_element_from_c_string (struct it *it)
7804{ 7804{
7805 int success_p = 1; 7805 bool success_p = true;
7806 7806
7807 eassert (it->s); 7807 eassert (it->s);
7808 eassert (!it->bidi_p || it->s == it->bidi_it.string.s); 7808 eassert (!it->bidi_p || it->s == it->bidi_it.string.s);
@@ -7861,7 +7861,7 @@ next_element_from_ellipsis (struct it *it)
7861 it->method = GET_FROM_BUFFER; 7861 it->method = GET_FROM_BUFFER;
7862 it->object = it->w->contents; 7862 it->object = it->w->contents;
7863 reseat_at_next_visible_line_start (it, 1); 7863 reseat_at_next_visible_line_start (it, 1);
7864 it->face_before_selective_p = 1; 7864 it->face_before_selective_p = true;
7865 } 7865 }
7866 7866
7867 return GET_NEXT_DISPLAY_ELEMENT (it); 7867 return GET_NEXT_DISPLAY_ELEMENT (it);
@@ -7930,7 +7930,7 @@ compute_stop_pos_backwards (struct it *it)
7930 it->prev_stop = it->stop_charpos; 7930 it->prev_stop = it->stop_charpos;
7931 else 7931 else
7932 it->prev_stop = BEGV; 7932 it->prev_stop = BEGV;
7933 it->bidi_p = 1; 7933 it->bidi_p = true;
7934 it->current = save_current; 7934 it->current = save_current;
7935 it->position = save_position; 7935 it->position = save_position;
7936 it->stop_charpos = save_stop_pos; 7936 it->stop_charpos = save_stop_pos;
@@ -7976,7 +7976,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos)
7976 } 7976 }
7977 while (charpos <= where_we_are); 7977 while (charpos <= where_we_are);
7978 7978
7979 it->bidi_p = 1; 7979 it->bidi_p = true;
7980 it->current = save_current; 7980 it->current = save_current;
7981 it->position = save_position; 7981 it->position = save_position;
7982 next_stop = it->stop_charpos; 7982 next_stop = it->stop_charpos;
@@ -7993,7 +7993,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos)
7993static int 7993static int
7994next_element_from_buffer (struct it *it) 7994next_element_from_buffer (struct it *it)
7995{ 7995{
7996 int success_p = 1; 7996 bool success_p = true;
7997 7997
7998 eassert (IT_CHARPOS (*it) >= BEGV); 7998 eassert (IT_CHARPOS (*it) >= BEGV);
7999 eassert (NILP (it->string) && !it->s); 7999 eassert (NILP (it->string) && !it->s);
@@ -8023,7 +8023,7 @@ next_element_from_buffer (struct it *it)
8023 overlay_strings_follow_p = 0; 8023 overlay_strings_follow_p = 0;
8024 else 8024 else
8025 { 8025 {
8026 it->overlay_strings_at_end_processed_p = 1; 8026 it->overlay_strings_at_end_processed_p = true;
8027 overlay_strings_follow_p = get_overlay_strings (it, 0); 8027 overlay_strings_follow_p = get_overlay_strings (it, 0);
8028 } 8028 }
8029 8029
@@ -9746,7 +9746,7 @@ message3 (Lisp_Object m)
9746 struct gcpro gcpro1; 9746 struct gcpro gcpro1;
9747 9747
9748 GCPRO1 (m); 9748 GCPRO1 (m);
9749 clear_message (1,1); 9749 clear_message (true, true);
9750 cancel_echoing (); 9750 cancel_echoing ();
9751 9751
9752 /* First flush out any partial line written with print. */ 9752 /* First flush out any partial line written with print. */
@@ -9816,7 +9816,7 @@ message3_nolog (Lisp_Object m)
9816 echo_message_buffer = Qnil; 9816 echo_message_buffer = Qnil;
9817 } 9817 }
9818 else 9818 else
9819 clear_message (1, 1); 9819 clear_message (true, true);
9820 9820
9821 do_pending_window_change (0); 9821 do_pending_window_change (0);
9822 echo_area_display (1); 9822 echo_area_display (1);
@@ -10089,7 +10089,7 @@ with_echo_area_buffer (struct window *w, int which,
10089 else 10089 else
10090 { 10090 {
10091 this_one = 0, the_other = 1; 10091 this_one = 0, the_other = 1;
10092 clear_buffer_p = 1; 10092 clear_buffer_p = true;
10093 10093
10094 /* We need a fresh one in case the current echo buffer equals 10094 /* We need a fresh one in case the current echo buffer equals
10095 the one containing the last displayed echo area message. */ 10095 the one containing the last displayed echo area message. */
@@ -10106,7 +10106,7 @@ with_echo_area_buffer (struct window *w, int which,
10106 = (EQ (echo_area_buffer[the_other], echo_buffer[this_one]) 10106 = (EQ (echo_area_buffer[the_other], echo_buffer[this_one])
10107 ? echo_buffer[the_other] 10107 ? echo_buffer[the_other]
10108 : echo_buffer[this_one]); 10108 : echo_buffer[this_one]);
10109 clear_buffer_p = 1; 10109 clear_buffer_p = true;
10110 } 10110 }
10111 10111
10112 buffer = echo_area_buffer[this_one]; 10112 buffer = echo_area_buffer[this_one];
@@ -10732,12 +10732,12 @@ set_message_1 (ptrdiff_t a1, Lisp_Object string)
10732 last displayed. */ 10732 last displayed. */
10733 10733
10734void 10734void
10735clear_message (int current_p, int last_displayed_p) 10735clear_message (bool current_p, bool last_displayed_p)
10736{ 10736{
10737 if (current_p) 10737 if (current_p)
10738 { 10738 {
10739 echo_area_buffer[0] = Qnil; 10739 echo_area_buffer[0] = Qnil;
10740 message_cleared_p = 1; 10740 message_cleared_p = true;
10741 } 10741 }
10742 10742
10743 if (last_displayed_p) 10743 if (last_displayed_p)
@@ -10819,7 +10819,7 @@ echo_area_display (int update_frame_p)
10819 { 10819 {
10820 echo_area_window = mini_window; 10820 echo_area_window = mini_window;
10821 window_height_changed_p = display_echo_area (w); 10821 window_height_changed_p = display_echo_area (w);
10822 w->must_be_updated_p = 1; 10822 w->must_be_updated_p = true;
10823 10823
10824 /* Update the display, unless called from redisplay_internal. 10824 /* Update the display, unless called from redisplay_internal.
10825 Also don't update the screen during redisplay itself. The 10825 Also don't update the screen during redisplay itself. The
@@ -10835,7 +10835,7 @@ echo_area_display (int update_frame_p)
10835 been called, so that mode lines above the echo area are 10835 been called, so that mode lines above the echo area are
10836 garbaged. This looks odd, so we prevent it here. */ 10836 garbaged. This looks odd, so we prevent it here. */
10837 if (!display_completed) 10837 if (!display_completed)
10838 n = redisplay_mode_lines (FRAME_ROOT_WINDOW (f), 0); 10838 n = redisplay_mode_lines (FRAME_ROOT_WINDOW (f), false);
10839 10839
10840 if (window_height_changed_p 10840 if (window_height_changed_p
10841 /* Don't do this if Emacs is shutting down. Redisplay 10841 /* Don't do this if Emacs is shutting down. Redisplay
@@ -12453,7 +12453,7 @@ hscroll_window_tree (Lisp_Object window)
12453 /* For left-to-right rows, hscroll when cursor is either 12453 /* For left-to-right rows, hscroll when cursor is either
12454 (i) inside the right hscroll margin, or (ii) if it is 12454 (i) inside the right hscroll margin, or (ii) if it is
12455 inside the left margin and the window is already 12455 inside the left margin and the window is already
12456 hscrolled. */ 12456 hscrolled. */
12457 && ((!row_r2l_p 12457 && ((!row_r2l_p
12458 && ((w->hscroll 12458 && ((w->hscroll
12459 && w->cursor.x <= h_margin) 12459 && w->cursor.x <= h_margin)
@@ -12470,7 +12470,7 @@ hscroll_window_tree (Lisp_Object window)
12470 && ((cursor_row->enabled_p 12470 && ((cursor_row->enabled_p
12471 /* FIXME: It is confusing to set the 12471 /* FIXME: It is confusing to set the
12472 truncated_on_right_p flag when R2L rows 12472 truncated_on_right_p flag when R2L rows
12473 are actually truncated on the left. */ 12473 are actually truncated on the left. */
12474 && cursor_row->truncated_on_right_p 12474 && cursor_row->truncated_on_right_p
12475 && w->cursor.x <= h_margin) 12475 && w->cursor.x <= h_margin)
12476 || (w->hscroll 12476 || (w->hscroll
@@ -13425,6 +13425,10 @@ redisplay_internal (void)
13425 13425
13426 if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) 13426 if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
13427 redisplay_windows (FRAME_ROOT_WINDOW (f)); 13427 redisplay_windows (FRAME_ROOT_WINDOW (f));
13428 /* Remember that the invisible frames need to be redisplayed next
13429 time they're visible. */
13430 else if (!REDISPLAY_SOME_P ())
13431 f->redisplay = true;
13428 13432
13429 /* The X error handler may have deleted that frame. */ 13433 /* The X error handler may have deleted that frame. */
13430 if (!FRAME_LIVE_P (f)) 13434 if (!FRAME_LIVE_P (f))
@@ -13455,19 +13459,11 @@ redisplay_internal (void)
13455 13459
13456 /* Prevent various kinds of signals during display 13460 /* Prevent various kinds of signals during display
13457 update. stdio is not robust about handling 13461 update. stdio is not robust about handling
13458 signals, which can cause an apparent I/O 13462 signals, which can cause an apparent I/O error. */
13459 error. */
13460 if (interrupt_input) 13463 if (interrupt_input)
13461 unrequest_sigio (); 13464 unrequest_sigio ();
13462 STOP_POLLING; 13465 STOP_POLLING;
13463 13466
13464 /* Mark windows on frame F to update. If we decide to
13465 update all frames but windows_or_buffers_changed is
13466 zero, we assume that only the windows that shows
13467 current buffer should be really updated. */
13468 set_window_update_flags
13469 (XWINDOW (f->root_window),
13470 (windows_or_buffers_changed ? NULL : current_buffer), 1);
13471 pending |= update_frame (f, 0, 0); 13467 pending |= update_frame (f, 0, 0);
13472 f->cursor_type_changed = 0; 13468 f->cursor_type_changed = 0;
13473 f->updated_p = 1; 13469 f->updated_p = 1;
@@ -13530,7 +13526,7 @@ redisplay_internal (void)
13530 if (hscroll_windows (selected_window)) 13526 if (hscroll_windows (selected_window))
13531 goto retry; 13527 goto retry;
13532 13528
13533 XWINDOW (selected_window)->must_be_updated_p = 1; 13529 XWINDOW (selected_window)->must_be_updated_p = true;
13534 pending = update_frame (sf, 0, 0); 13530 pending = update_frame (sf, 0, 0);
13535 sf->cursor_type_changed = 0; 13531 sf->cursor_type_changed = 0;
13536 } 13532 }
@@ -13545,7 +13541,7 @@ redisplay_internal (void)
13545 13541
13546 if (mini_frame != sf && FRAME_WINDOW_P (mini_frame)) 13542 if (mini_frame != sf && FRAME_WINDOW_P (mini_frame))
13547 { 13543 {
13548 XWINDOW (mini_window)->must_be_updated_p = 1; 13544 XWINDOW (mini_window)->must_be_updated_p = true;
13549 pending |= update_frame (mini_frame, 0, 0); 13545 pending |= update_frame (mini_frame, 0, 0);
13550 mini_frame->cursor_type_changed = 0; 13546 mini_frame->cursor_type_changed = 0;
13551 if (!pending && hscroll_windows (mini_window)) 13547 if (!pending && hscroll_windows (mini_window))
@@ -13846,7 +13842,7 @@ static Lisp_Object
13846redisplay_window_0 (Lisp_Object window) 13842redisplay_window_0 (Lisp_Object window)
13847{ 13843{
13848 if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer)) 13844 if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer))
13849 redisplay_window (window, 0); 13845 redisplay_window (window, false);
13850 return Qnil; 13846 return Qnil;
13851} 13847}
13852 13848
@@ -13854,7 +13850,7 @@ static Lisp_Object
13854redisplay_window_1 (Lisp_Object window) 13850redisplay_window_1 (Lisp_Object window)
13855{ 13851{
13856 if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer)) 13852 if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer))
13857 redisplay_window (window, 1); 13853 redisplay_window (window, true);
13858 return Qnil; 13854 return Qnil;
13859} 13855}
13860 13856
@@ -15380,7 +15376,7 @@ set_vertical_scroll_bar (struct window *w)
15380 changed on window's frame. In that case, redisplay_internal will retry. */ 15376 changed on window's frame. In that case, redisplay_internal will retry. */
15381 15377
15382static void 15378static void
15383redisplay_window (Lisp_Object window, int just_this_one_p) 15379redisplay_window (Lisp_Object window, bool just_this_one_p)
15384{ 15380{
15385 struct window *w = XWINDOW (window); 15381 struct window *w = XWINDOW (window);
15386 struct frame *f = XFRAME (w->frame); 15382 struct frame *f = XFRAME (w->frame);
@@ -15391,11 +15387,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15391 int tem; 15387 int tem;
15392 struct it it; 15388 struct it it;
15393 /* Record it now because it's overwritten. */ 15389 /* Record it now because it's overwritten. */
15394 int current_matrix_up_to_date_p = 0; 15390 bool current_matrix_up_to_date_p = false;
15395 int used_current_matrix_p = 0; 15391 bool used_current_matrix_p = false;
15396 /* This is less strict than current_matrix_up_to_date_p. 15392 /* This is less strict than current_matrix_up_to_date_p.
15397 It indicates that the buffer contents and narrowing are unchanged. */ 15393 It indicates that the buffer contents and narrowing are unchanged. */
15398 int buffer_unchanged_p = 0; 15394 bool buffer_unchanged_p = false;
15399 int temp_scroll_step = 0; 15395 int temp_scroll_step = 0;
15400 ptrdiff_t count = SPECPDL_INDEX (); 15396 ptrdiff_t count = SPECPDL_INDEX ();
15401 int rc; 15397 int rc;
@@ -15432,6 +15428,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15432 || buffer->clip_changed 15428 || buffer->clip_changed
15433 || buffer->prevent_redisplay_optimizations_p); 15429 || buffer->prevent_redisplay_optimizations_p);
15434 15430
15431 if (!just_this_one_p)
15432 /* If `just_this_one_p' is set, we apparently set must_be_updated_p more
15433 cleverly elsewhere. */
15434 w->must_be_updated_p = true;
15435
15435 if (MINI_WINDOW_P (w)) 15436 if (MINI_WINDOW_P (w))
15436 { 15437 {
15437 if (w == XWINDOW (echo_area_window) 15438 if (w == XWINDOW (echo_area_window)
@@ -15512,10 +15513,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15512 if (XMARKER (w->start)->buffer == current_buffer) 15513 if (XMARKER (w->start)->buffer == current_buffer)
15513 compute_window_start_on_continuation_line (w); 15514 compute_window_start_on_continuation_line (w);
15514 15515
15515 w->window_end_valid = 0; 15516 w->window_end_valid = false;
15516 /* If so, we also can't rely on current matrix 15517 /* If so, we also can't rely on current matrix
15517 and should not fool try_cursor_movement below. */ 15518 and should not fool try_cursor_movement below. */
15518 current_matrix_up_to_date_p = 0; 15519 current_matrix_up_to_date_p = false;
15519 } 15520 }
15520 15521
15521 /* Some sanity checks. */ 15522 /* Some sanity checks. */
@@ -16133,7 +16134,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16133 16134
16134 SET_TEXT_POS_FROM_MARKER (startp, w->start); 16135 SET_TEXT_POS_FROM_MARKER (startp, w->start);
16135 w->start_at_line_beg = (CHARPOS (startp) == BEGV 16136 w->start_at_line_beg = (CHARPOS (startp) == BEGV
16136 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n'); 16137 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n');
16137 16138
16138 /* Display the mode line, if we must. */ 16139 /* Display the mode line, if we must. */
16139 if ((update_mode_line 16140 if ((update_mode_line
@@ -16153,6 +16154,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16153 && (WINDOW_WANTS_MODELINE_P (w) 16154 && (WINDOW_WANTS_MODELINE_P (w)
16154 || WINDOW_WANTS_HEADER_LINE_P (w))) 16155 || WINDOW_WANTS_HEADER_LINE_P (w)))
16155 { 16156 {
16157
16156 display_mode_lines (w); 16158 display_mode_lines (w);
16157 16159
16158 /* If mode line height has changed, arrange for a thorough 16160 /* If mode line height has changed, arrange for a thorough
@@ -16273,7 +16275,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16273 16275
16274 set_buffer_internal_1 (old); 16276 set_buffer_internal_1 (old);
16275 /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become 16277 /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become
16276 shorter. This can be caused by log truncation in *Messages*. */ 16278 shorter. This can be caused by log truncation in *Messages*. */
16277 if (CHARPOS (lpoint) <= ZV) 16279 if (CHARPOS (lpoint) <= ZV)
16278 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); 16280 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
16279 16281
@@ -20740,7 +20742,7 @@ display_tty_menu_item (const char *item_text, int width, int face_id,
20740 the number of windows whose mode lines were redisplayed. */ 20742 the number of windows whose mode lines were redisplayed. */
20741 20743
20742static int 20744static int
20743redisplay_mode_lines (Lisp_Object window, int force) 20745redisplay_mode_lines (Lisp_Object window, bool force)
20744{ 20746{
20745 int nwindows = 0; 20747 int nwindows = 0;
20746 20748
@@ -20774,10 +20776,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
20774 /* Display mode lines. */ 20776 /* Display mode lines. */
20775 clear_glyph_matrix (w->desired_matrix); 20777 clear_glyph_matrix (w->desired_matrix);
20776 if (display_mode_lines (w)) 20778 if (display_mode_lines (w))
20777 { 20779 ++nwindows;
20778 ++nwindows;
20779 w->must_be_updated_p = 1;
20780 }
20781 20780
20782 /* Restore old settings. */ 20781 /* Restore old settings. */
20783 set_buffer_internal_1 (old); 20782 set_buffer_internal_1 (old);
@@ -20833,6 +20832,8 @@ display_mode_lines (struct window *w)
20833 XFRAME (new_frame)->selected_window = old_frame_selected_window; 20832 XFRAME (new_frame)->selected_window = old_frame_selected_window;
20834 selected_frame = old_selected_frame; 20833 selected_frame = old_selected_frame;
20835 selected_window = old_selected_window; 20834 selected_window = old_selected_window;
20835 if (n > 0)
20836 w->must_be_updated_p = true;
20836 return n; 20837 return n;
20837} 20838}
20838 20839
diff --git a/src/xterm.c b/src/xterm.c
index b4c2b6aabf6..e80212a6adb 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -98,7 +98,7 @@ extern void _XEditResCheckMessages (Widget, XtPointer, XEvent *, Boolean *);
98 98
99#ifdef USE_TOOLKIT_SCROLL_BARS 99#ifdef USE_TOOLKIT_SCROLL_BARS
100#if defined USE_MOTIF 100#if defined USE_MOTIF
101#include <Xm/Xm.h> /* for LESSTIF_VERSION */ 101#include <Xm/Xm.h> /* For LESSTIF_VERSION */
102#include <Xm/ScrollBar.h> 102#include <Xm/ScrollBar.h>
103#else /* !USE_MOTIF i.e. use Xaw */ 103#else /* !USE_MOTIF i.e. use Xaw */
104 104