In batch mode (@pxref{Batch Mode}), @code{sit-for} cannot be
interrupted, even by input from the standard input descriptor. It is
thus equivalent to @code{sleep-for}, which is described below.
-
-It is also possible to call @code{sit-for} with three arguments,
-as @code{(sit-for @var{seconds} @var{millisec} @var{nodisp})},
-but that is considered obsolete.
@end defun
@defun sleep-for seconds &optional millisec
(sit-for seconds milliseconds nodisp)
@end example
-However, calling @code{sit-for} this way is considered obsolete
-(@pxref{Waiting}). The old calling convention is deprecated like
+During a transition period, the function accepted those three
+arguments, but declared this old calling convention as deprecated like
this:
@example
** 'easy-mmode-define-{minor,global}-mode' aliases are now obsolete.
Use 'define-minor-mode' and 'define-globalized-minor-mode' instead.
+** The obsolete calling convention of 'sit-for' has been removed.
+That convention was: (sit-for SECONDS MILLISEC &optional NODISP)
+
\f
* Lisp Changes in Emacs 30.1
(message "%s%s" prompt (char-to-string char))
char))
-(defun sit-for (seconds &optional nodisp obsolete)
+(defun sit-for (seconds &optional nodisp)
"Redisplay, then wait for SECONDS seconds. Stop when input is available.
SECONDS may be a floating-point value.
\(On operating systems that do not support waiting for fractions of a
If optional arg NODISP is t, don't redisplay, just wait for input.
Redisplay does not happen if input is available before it starts.
-Value is t if waited the full time with no input arriving, and nil otherwise.
-
-An obsolete, but still supported form is
-\(sit-for SECONDS &optional MILLISECONDS NODISP)
-where the optional arg MILLISECONDS specifies an additional wait period,
-in milliseconds; this was useful when Emacs was built without
-floating point support."
- (declare (advertised-calling-convention (seconds &optional nodisp) "22.1")
- (compiler-macro
- (lambda (form)
- (if (not (or (numberp nodisp) obsolete)) form
- (macroexp-warn-and-return
- (format-message "Obsolete calling convention for `sit-for'")
- `(,(car form) (+ ,seconds (/ (or ,nodisp 0) 1000.0)) ,obsolete)
- '(obsolete sit-for))))))
+Value is t if waited the full time with no input arriving, and nil otherwise."
;; This used to be implemented in C until the following discussion:
;; https://lists.gnu.org/r/emacs-devel/2006-07/msg00401.html
;; Then it was moved here using an implementation based on an idle timer,
;; which was then replaced by the use of read-event.
- (if (numberp nodisp)
- (setq seconds (+ seconds (* 1e-3 nodisp))
- nodisp obsolete)
- (if obsolete (setq nodisp obsolete)))
(cond
(noninteractive
(sleep-for seconds)