aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2023-10-13 19:28:30 -0400
committerStefan Monnier2023-10-13 19:28:30 -0400
commit9ecb595dea56ed1149b60245d021cb5e6d7dd73f (patch)
treeb646110c1b55982546dc2544bb708c4819467989
parenta5789198b34d83413674e596887c089a651f7cf4 (diff)
downloademacs-9ecb595dea56ed1149b60245d021cb5e6d7dd73f.tar.gz
emacs-9ecb595dea56ed1149b60245d021cb5e6d7dd73f.zip
(sit-for): Remove support for old calling convention
* lisp/subr.el (sit-for): Remove support for old calling convention * doc/lispref/functions.texi (Obsolete Functions): Adjust wording now that we don't support `sit-for`s old convention any more. * doc/lispref/commands.texi (Waiting): Remove mention of old calling convention for `sit-for`.
-rw-r--r--doc/lispref/commands.texi4
-rw-r--r--doc/lispref/functions.texi4
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/subr.el22
4 files changed, 7 insertions, 26 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 6601135cb85..fdf5ec1d7fe 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -3967,10 +3967,6 @@ the timeout elapses).
3967In batch mode (@pxref{Batch Mode}), @code{sit-for} cannot be 3967In batch mode (@pxref{Batch Mode}), @code{sit-for} cannot be
3968interrupted, even by input from the standard input descriptor. It is 3968interrupted, even by input from the standard input descriptor. It is
3969thus equivalent to @code{sleep-for}, which is described below. 3969thus equivalent to @code{sleep-for}, which is described below.
3970
3971It is also possible to call @code{sit-for} with three arguments,
3972as @code{(sit-for @var{seconds} @var{millisec} @var{nodisp})},
3973but that is considered obsolete.
3974@end defun 3970@end defun
3975 3971
3976@defun sleep-for seconds &optional millisec 3972@defun sleep-for seconds &optional millisec
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 236b823e7e6..ba0d919549b 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -2364,8 +2364,8 @@ accepted three arguments, like this
2364 (sit-for seconds milliseconds nodisp) 2364 (sit-for seconds milliseconds nodisp)
2365@end example 2365@end example
2366 2366
2367However, calling @code{sit-for} this way is considered obsolete 2367During a transition period, the function accepted those three
2368(@pxref{Waiting}). The old calling convention is deprecated like 2368arguments, but declared this old calling convention as deprecated like
2369this: 2369this:
2370 2370
2371@example 2371@example
diff --git a/etc/NEWS b/etc/NEWS
index a8d028afc9d..3bd47a0112b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1022,6 +1022,9 @@ The compatibility aliases 'x-defined-colors', 'x-color-defined-p',
1022** 'easy-mmode-define-{minor,global}-mode' aliases are now obsolete. 1022** 'easy-mmode-define-{minor,global}-mode' aliases are now obsolete.
1023Use 'define-minor-mode' and 'define-globalized-minor-mode' instead. 1023Use 'define-minor-mode' and 'define-globalized-minor-mode' instead.
1024 1024
1025** The obsolete calling convention of 'sit-for' has been removed.
1026That convention was: (sit-for SECONDS MILLISEC &optional NODISP)
1027
1025 1028
1026* Lisp Changes in Emacs 30.1 1029* Lisp Changes in Emacs 30.1
1027 1030
diff --git a/lisp/subr.el b/lisp/subr.el
index e88815fa58c..58274987d71 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3408,7 +3408,7 @@ causes it to evaluate `help-form' and display the result."
3408 (message "%s%s" prompt (char-to-string char)) 3408 (message "%s%s" prompt (char-to-string char))
3409 char)) 3409 char))
3410 3410
3411(defun sit-for (seconds &optional nodisp obsolete) 3411(defun sit-for (seconds &optional nodisp)
3412 "Redisplay, then wait for SECONDS seconds. Stop when input is available. 3412 "Redisplay, then wait for SECONDS seconds. Stop when input is available.
3413SECONDS may be a floating-point value. 3413SECONDS may be a floating-point value.
3414\(On operating systems that do not support waiting for fractions of a 3414\(On operating systems that do not support waiting for fractions of a
@@ -3417,29 +3417,11 @@ second, floating-point values are rounded down to the nearest integer.)
3417If optional arg NODISP is t, don't redisplay, just wait for input. 3417If optional arg NODISP is t, don't redisplay, just wait for input.
3418Redisplay does not happen if input is available before it starts. 3418Redisplay does not happen if input is available before it starts.
3419 3419
3420Value is t if waited the full time with no input arriving, and nil otherwise. 3420Value is t if waited the full time with no input arriving, and nil otherwise."
3421
3422An obsolete, but still supported form is
3423\(sit-for SECONDS &optional MILLISECONDS NODISP)
3424where the optional arg MILLISECONDS specifies an additional wait period,
3425in milliseconds; this was useful when Emacs was built without
3426floating point support."
3427 (declare (advertised-calling-convention (seconds &optional nodisp) "22.1")
3428 (compiler-macro
3429 (lambda (form)
3430 (if (not (or (numberp nodisp) obsolete)) form
3431 (macroexp-warn-and-return
3432 (format-message "Obsolete calling convention for `sit-for'")
3433 `(,(car form) (+ ,seconds (/ (or ,nodisp 0) 1000.0)) ,obsolete)
3434 '(obsolete sit-for))))))
3435 ;; This used to be implemented in C until the following discussion: 3421 ;; This used to be implemented in C until the following discussion:
3436 ;; https://lists.gnu.org/r/emacs-devel/2006-07/msg00401.html 3422 ;; https://lists.gnu.org/r/emacs-devel/2006-07/msg00401.html
3437 ;; Then it was moved here using an implementation based on an idle timer, 3423 ;; Then it was moved here using an implementation based on an idle timer,
3438 ;; which was then replaced by the use of read-event. 3424 ;; which was then replaced by the use of read-event.
3439 (if (numberp nodisp)
3440 (setq seconds (+ seconds (* 1e-3 nodisp))
3441 nodisp obsolete)
3442 (if obsolete (setq nodisp obsolete)))
3443 (cond 3425 (cond
3444 (noninteractive 3426 (noninteractive
3445 (sleep-for seconds) 3427 (sleep-for seconds)