aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2015-10-24 18:41:32 +0300
committerEli Zaretskii2015-10-24 18:41:32 +0300
commit41518e5b6354cf6aa946de2e5b02b728f7b15b8c (patch)
tree2a13dc43196c3679d7000827f4a9d3bda58f9f34 /src
parent7a6968b45f2b93d984c5c3fcd5fce68d6e5b6ea9 (diff)
downloademacs-41518e5b6354cf6aa946de2e5b02b728f7b15b8c.tar.gz
emacs-41518e5b6354cf6aa946de2e5b02b728f7b15b8c.zip
Update frame title when scrolling the selected window
* src/window.c (wset_update_mode_line): New function, sets either the window's update_mode_line flag or the global update_mode_lines variable. (Fset_window_start, set_window_buffer, window_scroll_pixel_based) (window_scroll_line_based): Call it instead of only setting the window's update_mode_line flag.
Diffstat (limited to 'src')
-rw-r--r--src/window.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/window.c b/src/window.c
index a8605ee628c..7c95ff9b16f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -205,6 +205,20 @@ wset_combination (struct window *w, bool horflag, Lisp_Object val)
205 w->horizontal = horflag; 205 w->horizontal = horflag;
206} 206}
207 207
208static void
209wset_update_mode_line (struct window *w)
210{
211 /* If this window is the selected window on its frame, set the
212 global variable update_mode_lines, so that x_consider_frame_title
213 will consider this frame's title for rtedisplay. */
214 Lisp_Object fselected_window = XFRAME (WINDOW_FRAME (w))->selected_window;
215
216 if (WINDOWP (fselected_window) && XWINDOW (fselected_window) == w)
217 update_mode_lines = 42;
218 else
219 w->update_mode_line = true;
220}
221
208/* True if leaf window W doesn't reflect the actual state 222/* True if leaf window W doesn't reflect the actual state
209 of displayed buffer due to its text or overlays change. */ 223 of displayed buffer due to its text or overlays change. */
210 224
@@ -1666,7 +1680,7 @@ overriding motion of point in order to display at this exact start. */)
1666 w->start_at_line_beg = false; 1680 w->start_at_line_beg = false;
1667 if (NILP (noforce)) 1681 if (NILP (noforce))
1668 w->force_start = true; 1682 w->force_start = true;
1669 w->update_mode_line = true; 1683 wset_update_mode_line (w);
1670 /* Bug#15957. */ 1684 /* Bug#15957. */
1671 w->window_end_valid = false; 1685 w->window_end_valid = false;
1672 wset_redisplay (w); 1686 wset_redisplay (w);
@@ -3271,14 +3285,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
3271 /* Maybe we could move this into the `if' but it's not obviously safe and 3285 /* Maybe we could move this into the `if' but it's not obviously safe and
3272 I doubt it's worth the trouble. */ 3286 I doubt it's worth the trouble. */
3273 wset_redisplay (w); 3287 wset_redisplay (w);
3274 /* If this window is the selected window on its frame, set the 3288
3275 global variable update_mode_lines, so that x_consider_frame_title 3289 wset_update_mode_line (w);
3276 will consider this frame's title for rtedisplay. */
3277 Lisp_Object fselected_window = XFRAME (WINDOW_FRAME (w))->selected_window;
3278 if (WINDOWP (fselected_window) && XWINDOW (fselected_window) == w)
3279 update_mode_lines = 42;
3280 else
3281 w->update_mode_line = true;
3282 3290
3283 /* We must select BUFFER to run the window-scroll-functions and to look up 3291 /* We must select BUFFER to run the window-scroll-functions and to look up
3284 the buffer-local value of Vwindow_point_insertion_type. */ 3292 the buffer-local value of Vwindow_point_insertion_type. */
@@ -4829,7 +4837,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
4829 set_marker_restricted (w->start, make_number (spos), 4837 set_marker_restricted (w->start, make_number (spos),
4830 w->contents); 4838 w->contents);
4831 w->start_at_line_beg = true; 4839 w->start_at_line_beg = true;
4832 w->update_mode_line = true; 4840 wset_update_mode_line (w);
4833 /* Set force_start so that redisplay_window will run the 4841 /* Set force_start so that redisplay_window will run the
4834 window-scroll-functions. */ 4842 window-scroll-functions. */
4835 w->force_start = true; 4843 w->force_start = true;
@@ -4977,7 +4985,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
4977 IT_BYTEPOS (it)); 4985 IT_BYTEPOS (it));
4978 bytepos = marker_byte_position (w->start); 4986 bytepos = marker_byte_position (w->start);
4979 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); 4987 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
4980 w->update_mode_line = true; 4988 wset_update_mode_line (w);
4981 /* Set force_start so that redisplay_window will run the 4989 /* Set force_start so that redisplay_window will run the
4982 window-scroll-functions. */ 4990 window-scroll-functions. */
4983 w->force_start = true; 4991 w->force_start = true;
@@ -5211,7 +5219,7 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, bool noerror)
5211 5219
5212 set_marker_restricted_both (w->start, w->contents, pos, pos_byte); 5220 set_marker_restricted_both (w->start, w->contents, pos, pos_byte);
5213 w->start_at_line_beg = !NILP (bolp); 5221 w->start_at_line_beg = !NILP (bolp);
5214 w->update_mode_line = true; 5222 wset_update_mode_line (w);
5215 /* Set force_start so that redisplay_window will run 5223 /* Set force_start so that redisplay_window will run
5216 the window-scroll-functions. */ 5224 the window-scroll-functions. */
5217 w->force_start = true; 5225 w->force_start = true;