diff options
| author | Eli Zaretskii | 2012-09-22 16:16:03 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-09-22 16:16:03 +0300 |
| commit | df9685f3961022245b9ab73b62023aa573862001 (patch) | |
| tree | dc572840dcc97dd6abe4a9cfe7e279525211a124 /doc | |
| parent | 8e17c9ba1443c2f21c5801f0c4660ac08dccc837 (diff) | |
| download | emacs-df9685f3961022245b9ab73b62023aa573862001.tar.gz emacs-df9685f3961022245b9ab73b62023aa573862001.zip | |
Fix bugs #12447 and #12326 with infloop causes by idle timers, update docs.
src/keyboard.c (timer_check_2): Move calculation of 'timers' and
'idle_timers' from here ...
(timer_check): ... to here. Use Fcopy_sequence to copy the timer
lists, to avoid infloops when the timer does something stupid,
like reinvoke itself with the same or smaller time-out.
lisp/emacs-lisp/timer.el (run-with-idle-timer)
(timer-activate-when-idle): Warn against reinvoking an idle timer
from within its own timer action.
doc/lispref/os.texi (Idle Timers): Warn against reinvoking an idle timer
from within its own timer action.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index f1ae632267b..8acd12d82a8 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-09-22 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * os.texi (Idle Timers): Warn against reinvoking an idle timer | ||
| 4 | from within its own timer action. (Bug#12447) | ||
| 5 | |||
| 1 | 2012-09-22 Chong Yidong <cyd@gnu.org> | 6 | 2012-09-22 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * frames.texi (Pop-Up Menus): Minor clarification (Bug#11148). | 8 | * frames.texi (Pop-Up Menus): Minor clarification (Bug#11148). |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 6431ac8bead..68e53c78972 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -1864,6 +1864,13 @@ It blocks out any idle timers that ought to run during that time. | |||
| 1864 | @end itemize | 1864 | @end itemize |
| 1865 | 1865 | ||
| 1866 | @noindent | 1866 | @noindent |
| 1867 | For similar reasons, do not write an idle timer function that sets | ||
| 1868 | up another idle time (including the same idle timer) with the | ||
| 1869 | @var{secs} argument less or equal to the current idleness time. Such | ||
| 1870 | a timer will run almost immediately, and continue running again and | ||
| 1871 | again, instead of waiting for the next time Emacs becomes idle. | ||
| 1872 | |||
| 1873 | @noindent | ||
| 1867 | The correct approach is for the idle timer to reschedule itself after | 1874 | The correct approach is for the idle timer to reschedule itself after |
| 1868 | a brief pause, using the method in the @code{timer-function} example | 1875 | a brief pause, using the method in the @code{timer-function} example |
| 1869 | above. | 1876 | above. |