Mercurial > emacs
comparison src/keyboard.c @ 100075:9b936c1c7102
(timer_check): After a timer runs, ensure that the selected window's
buffer is current.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 30 Nov 2008 17:33:36 +0000 |
parents | cd9c652e34dd |
children | 173352468c0f |
comparison
equal
deleted
inserted
replaced
100074:621a2ff9faff | 100075:9b936c1c7102 |
---|---|
4582 { | 4582 { |
4583 if (NILP (vector[0])) | 4583 if (NILP (vector[0])) |
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 | 4587 struct buffer *b; |
4588 #if 0 /* This shouldn't be necessary anymore. --lorentey */ | 4588 |
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; |
4596 | 4592 |
4597 specbind (Qinhibit_quit, Qt); | 4593 specbind (Qinhibit_quit, Qt); |
4599 call1 (Qtimer_event_handler, chosen_timer); | 4595 call1 (Qtimer_event_handler, chosen_timer); |
4600 Vdeactivate_mark = old_deactivate_mark; | 4596 Vdeactivate_mark = old_deactivate_mark; |
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 } |
4607 } | 4610 } |
4608 else | 4611 else |