aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2008-11-30 17:33:36 +0000
committerChong Yidong2008-11-30 17:33:36 +0000
commitdd649c4915fa187f5ef76b9f0c43823f130949d1 (patch)
tree99d2084e2a030924df4220889cab90c288bf8053 /src
parent379c17e7440b689de99cd50ab248c7f4743b6cb7 (diff)
downloademacs-dd649c4915fa187f5ef76b9f0c43823f130949d1.tar.gz
emacs-dd649c4915fa187f5ef76b9f0c43823f130949d1.zip
(timer_check): After a timer runs, ensure that the selected window's
buffer is current.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index bac830d692c..d81f62c6763 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4584,12 +4584,8 @@ timer_check (do_it_now)
4584 { 4584 {
4585 int count = SPECPDL_INDEX (); 4585 int count = SPECPDL_INDEX ();
4586 Lisp_Object old_deactivate_mark = Vdeactivate_mark; 4586 Lisp_Object old_deactivate_mark = Vdeactivate_mark;
4587 struct buffer *b;
4587 4588
4588#if 0 /* This shouldn't be necessary anymore. --lorentey */
4589 /* On unbind_to, resume allowing input from any kboard, if that
4590 was true before. */
4591 record_single_kboard_state ();
4592#endif
4593 /* Mark the timer as triggered to prevent problems if the lisp 4589 /* Mark the timer as triggered to prevent problems if the lisp
4594 code fails to reschedule it right. */ 4590 code fails to reschedule it right. */
4595 vector[0] = Qt; 4591 vector[0] = Qt;
@@ -4601,6 +4597,13 @@ timer_check (do_it_now)
4601 timers_run++; 4597 timers_run++;
4602 unbind_to (count, Qnil); 4598 unbind_to (count, Qnil);
4603 4599
4600 /* We must ensure that the current buffer is the same as
4601 the selected window's buffer, because the timers may
4602 have made another buffer current (bug#1458). */
4603 b = XBUFFER (XWINDOW (selected_window)->buffer);
4604 if (b != current_buffer)
4605 set_buffer_internal (b);
4606
4604 /* Since we have handled the event, 4607 /* Since we have handled the event,
4605 we don't need to tell the caller to wake up and do it. */ 4608 we don't need to tell the caller to wake up and do it. */
4606 } 4609 }