aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-09-04 15:07:32 +0000
committerRichard M. Stallman2006-09-04 15:07:32 +0000
commit0a369706ff1743a115dd39648df6487ebe2f5025 (patch)
tree7cd3b9a36bd083311e3ca82ebaf974dfdbd799e2
parentf39d6be01d06026a64e08009b773dc6b7c9d7a2b (diff)
downloademacs-0a369706ff1743a115dd39648df6487ebe2f5025.tar.gz
emacs-0a369706ff1743a115dd39648df6487ebe2f5025.zip
(Idle Timers): Explain why timer functions should not
loop until (input-pending-p).
-rw-r--r--lispref/os.texi19
1 files changed, 19 insertions, 0 deletions
diff --git a/lispref/os.texi b/lispref/os.texi
index f6682548e5b..edf5833bf42 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -1578,6 +1578,25 @@ Here's an example:
1578@end smallexample 1578@end smallexample
1579@end defun 1579@end defun
1580 1580
1581 Some idle timer functions in user Lisp packages have a loop that
1582does a certain amount of processing each time around, and exits when
1583@code{(input-pending-p)} is non-@code{nil}. That approach seems very
1584natural but has two problems:
1585
1586@itemize
1587@item
1588It blocks out all process output (since Emacs accepts process output
1589only while waiting).
1590
1591@item
1592It blocks out any idle timers that ought to run during that time.
1593@end itemize
1594
1595@noindent
1596To avoid these problems, don't use that technique. Instead, write
1597such idle timers to reschedule themselves after a brief pause, using
1598the method in the @code{timer-function} example above.
1599
1581@node Terminal Input 1600@node Terminal Input
1582@section Terminal Input 1601@section Terminal Input
1583@cindex terminal input 1602@cindex terminal input