diff options
| author | Barry O'Reilly | 2013-10-18 00:27:34 -0400 |
|---|---|---|
| committer | Barry O'Reilly | 2013-10-18 00:27:34 -0400 |
| commit | ef566920352fea106b283bcfeba1e61f3969f541 (patch) | |
| tree | 36744e23acb0c8efc1be773e79f90d11bf06bc39 /src | |
| parent | 29df8a0b10233b25319c1710753a08f2ffd5d310 (diff) | |
| download | emacs-ef566920352fea106b283bcfeba1e61f3969f541.tar.gz emacs-ef566920352fea106b283bcfeba1e61f3969f541.zip | |
Don't run timers in input-pending-p. Its new check-timers param
provides the prior behavior..
* src/keyboard.c (Finput_pending_p): Accept optional check-timers
param.
* lisp/subr.el (sit-for): Call (input-pending-p t) so as to behave
as before.
* test/automated/timer-tests.el: New file. Tests that (sit-for 0)
allows another timer to run.
Fixes: debbugs:15045
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/keyboard.c | 12 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a0df4425844..0dae87bd69a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-10-17 Barry O'Reilly <gundaetiapo@gmail.com> | ||
| 2 | |||
| 3 | Don't run timers in input-pending-p. Its new check-timers param | ||
| 4 | provides the prior behavior. (Bug#15045). | ||
| 5 | * src/keyboard.c (Finput_pending_p): Accept optional check-timers | ||
| 6 | param. | ||
| 7 | |||
| 1 | 2013-10-17 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2013-10-17 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | Make some functions static in non-Microsoft builds. | 10 | Make some functions static in non-Microsoft builds. |
diff --git a/src/keyboard.c b/src/keyboard.c index a776720b807..6b39dfe1019 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -9950,12 +9950,13 @@ requeued_events_pending_p (void) | |||
| 9950 | return (!NILP (Vunread_command_events)); | 9950 | return (!NILP (Vunread_command_events)); |
| 9951 | } | 9951 | } |
| 9952 | 9952 | ||
| 9953 | 9953 | DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 1, 0, | |
| 9954 | DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 0, 0, | ||
| 9955 | doc: /* Return t if command input is currently available with no wait. | 9954 | doc: /* Return t if command input is currently available with no wait. |
| 9956 | Actually, the value is nil only if we can be sure that no input is available; | 9955 | Actually, the value is nil only if we can be sure that no input is available; |
| 9957 | if there is a doubt, the value is t. */) | 9956 | if there is a doubt, the value is t. |
| 9958 | (void) | 9957 | |
| 9958 | If CHECK-TIMERS is non-nil, timers that are ready to run will do so. */) | ||
| 9959 | (Lisp_Object check_timers) | ||
| 9959 | { | 9960 | { |
| 9960 | if (!NILP (Vunread_command_events) | 9961 | if (!NILP (Vunread_command_events) |
| 9961 | || !NILP (Vunread_post_input_method_events) | 9962 | || !NILP (Vunread_post_input_method_events) |
| @@ -9965,7 +9966,8 @@ if there is a doubt, the value is t. */) | |||
| 9965 | /* Process non-user-visible events (Bug#10195). */ | 9966 | /* Process non-user-visible events (Bug#10195). */ |
| 9966 | process_special_events (); | 9967 | process_special_events (); |
| 9967 | 9968 | ||
| 9968 | return (get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW | 9969 | return (get_input_pending ((NILP (check_timers) |
| 9970 | ? 0 : READABLE_EVENTS_DO_TIMERS_NOW) | ||
| 9969 | | READABLE_EVENTS_FILTER_EVENTS) | 9971 | | READABLE_EVENTS_FILTER_EVENTS) |
| 9970 | ? Qt : Qnil); | 9972 | ? Qt : Qnil); |
| 9971 | } | 9973 | } |