diff options
| author | Stefan Monnier | 2021-04-13 23:55:47 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2021-04-13 23:55:47 -0400 |
| commit | 844b8949a71f180d395a237c768b22d91cf91ded (patch) | |
| tree | 336a7fb79a67d1729a456c837dffa6406eda375e /src | |
| parent | 839a9e74e0263f4e75a0c34df39c2e0a57c49438 (diff) | |
| download | emacs-844b8949a71f180d395a237c768b22d91cf91ded.tar.gz emacs-844b8949a71f180d395a237c768b22d91cf91ded.zip | |
* src/xdisp.c (wset_update_mode_line): Move from `src/window.c`
Move that function next to its siblings. Also simplify it, since
after careful analysis it is now clear that the frame's title's update
is already handled elsewhere (in `prepare_menu_bars` and `redisplay_window`)
so we just need to make sure the `redisplay` bit is set.
* src/window.c (wset_update_mode_line): Move to `src/xdisp.c`.
* src/window.h (wset_update_mode_line): Declare.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 14 | ||||
| -rw-r--r-- | src/window.h | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 12 |
3 files changed, 13 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c index 4d5c7e763ec..caf9df6c138 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -215,20 +215,6 @@ wset_combination (struct window *w, bool horflag, Lisp_Object val) | |||
| 215 | w->horizontal = horflag; | 215 | w->horizontal = horflag; |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | static void | ||
| 219 | wset_update_mode_line (struct window *w) | ||
| 220 | { | ||
| 221 | /* If this window is the selected window on its frame, set the | ||
| 222 | global variable update_mode_lines, so that gui_consider_frame_title | ||
| 223 | will consider this frame's title for redisplay. */ | ||
| 224 | Lisp_Object fselected_window = XFRAME (WINDOW_FRAME (w))->selected_window; | ||
| 225 | |||
| 226 | if (WINDOWP (fselected_window) && XWINDOW (fselected_window) == w) | ||
| 227 | update_mode_lines = 42; | ||
| 228 | else | ||
| 229 | w->update_mode_line = true; | ||
| 230 | } | ||
| 231 | |||
| 232 | /* True if leaf window W doesn't reflect the actual state | 218 | /* True if leaf window W doesn't reflect the actual state |
| 233 | of displayed buffer due to its text or overlays change. */ | 219 | of displayed buffer due to its text or overlays change. */ |
| 234 | 220 | ||
diff --git a/src/window.h b/src/window.h index b6f88e8f55f..2400c422c15 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -1141,6 +1141,7 @@ extern void wset_redisplay (struct window *w); | |||
| 1141 | extern void fset_redisplay (struct frame *f); | 1141 | extern void fset_redisplay (struct frame *f); |
| 1142 | extern void bset_redisplay (struct buffer *b); | 1142 | extern void bset_redisplay (struct buffer *b); |
| 1143 | extern void bset_update_mode_line (struct buffer *b); | 1143 | extern void bset_update_mode_line (struct buffer *b); |
| 1144 | extern void wset_update_mode_line (struct window *w); | ||
| 1144 | /* Call this to tell redisplay to look for other windows than selected-window | 1145 | /* Call this to tell redisplay to look for other windows than selected-window |
| 1145 | that need to be redisplayed. Calling one of the *set_redisplay functions | 1146 | that need to be redisplayed. Calling one of the *set_redisplay functions |
| 1146 | above already does it, so it's only needed in unusual cases. */ | 1147 | above already does it, so it's only needed in unusual cases. */ |
diff --git a/src/xdisp.c b/src/xdisp.c index 8f7180381b4..9e5516602b4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -869,6 +869,18 @@ bset_update_mode_line (struct buffer *b) | |||
| 869 | b->text->redisplay = true; | 869 | b->text->redisplay = true; |
| 870 | } | 870 | } |
| 871 | 871 | ||
| 872 | void | ||
| 873 | wset_update_mode_line (struct window *w) | ||
| 874 | { | ||
| 875 | w->update_mode_line = true; | ||
| 876 | /* When a window's mode line needs to be updated, the window's frame's | ||
| 877 | title may also need to be updated, but we don't need to worry about it | ||
| 878 | here. Instead, `gui_consider_frame_title` is automatically called | ||
| 879 | whenever w->update_mode_line is set for that frame's selected window. | ||
| 880 | But for this to work reliably, we have to make sure the window | ||
| 881 | is considered, so we have to mark it for redisplay. */ | ||
| 882 | wset_redisplay (w); } | ||
| 883 | |||
| 872 | DEFUN ("set-buffer-redisplay", Fset_buffer_redisplay, | 884 | DEFUN ("set-buffer-redisplay", Fset_buffer_redisplay, |
| 873 | Sset_buffer_redisplay, 4, 4, 0, | 885 | Sset_buffer_redisplay, 4, 4, 0, |
| 874 | doc: /* Mark the current buffer for redisplay. | 886 | doc: /* Mark the current buffer for redisplay. |