aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dispnew.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 89dd32ad0fb..e0a64761904 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6057,6 +6057,8 @@ sit_for (Lisp_Object timeout, bool reading, int display_option)
6057 intmax_t sec; 6057 intmax_t sec;
6058 int nsec; 6058 int nsec;
6059 bool do_display = display_option > 0; 6059 bool do_display = display_option > 0;
6060 bool curbuf_eq_winbuf
6061 = (current_buffer == XBUFFER (XWINDOW (selected_window)->contents));
6060 6062
6061 swallow_events (do_display); 6063 swallow_events (do_display);
6062 6064
@@ -6111,6 +6113,13 @@ sit_for (Lisp_Object timeout, bool reading, int display_option)
6111 wait_reading_process_output (sec, nsec, reading ? -1 : 1, do_display, 6113 wait_reading_process_output (sec, nsec, reading ? -1 : 1, do_display,
6112 Qnil, NULL, 0); 6114 Qnil, NULL, 0);
6113 6115
6116 if (reading && curbuf_eq_winbuf)
6117 /* Timers and process filters/sentinels may have changed the selected
6118 window (e.g. in response to a connection from emacsclient), in which
6119 case we should follow it (unless we weren't in the selected-window's
6120 buffer to start with). */
6121 set_buffer_internal (XBUFFER (XWINDOW (selected_window)->contents));
6122
6114 return detect_input_pending () ? Qnil : Qt; 6123 return detect_input_pending () ? Qnil : Qt;
6115} 6124}
6116 6125