summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-10-18 18:43:50 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-10-18 18:43:50 -0400
commit155ddde4dd3f6246814ab76bc2f54f4d571bbd15 (patch)
tree284a73e46d13a1f426fea2655e7bbe601e4b5ca7 /lisp/subr.el
parent2cca6408fde59e57a0937e561675d181f7fa226e (diff)
downloademacs-155ddde4dd3f6246814ab76bc2f54f4d571bbd15.tar.gz
emacs-155ddde4dd3f6246814ab76bc2f54f4d571bbd15.tar.bz2
emacs-155ddde4dd3f6246814ab76bc2f54f4d571bbd15.zip
(sit-for): Add compiler-macro to warn about obsolete calling convention
* lisp/subr.el (sit-for): Add compiler-macro. * lisp/eshell/esh-util.el (eshell-redisplay): * lisp/play/zone.el (zone, zone-pgm-jitter, zone-pgm-whack-chars): (zone-remove-text): Avoid obsolete calling convention.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 08dfe7aa430..e49c22158f9 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3270,7 +3270,14 @@ An obsolete, but still supported form is
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"))
+ (declare (advertised-calling-convention (seconds &optional nodisp) "22.1")
+ (compiler-macro
+ (lambda (form)
+ (if (not (or (numberp nodisp) obsolete)) form
+ (macroexp-warn-and-return
+ "Obsolete calling convention for 'sit-for'"
+ `(,(car form) (+ ,seconds (/ (or ,nodisp 0) 1000.0)) ,obsolete)
+ '(obsolete sit-for))))))
;; 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,