aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2022-10-18 18:43:50 -0400
committerStefan Monnier2022-10-18 18:43:50 -0400
commit155ddde4dd3f6246814ab76bc2f54f4d571bbd15 (patch)
tree284a73e46d13a1f426fea2655e7bbe601e4b5ca7
parent2cca6408fde59e57a0937e561675d181f7fa226e (diff)
downloademacs-155ddde4dd3f6246814ab76bc2f54f4d571bbd15.tar.gz
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.
-rw-r--r--lisp/eshell/esh-util.el2
-rw-r--r--lisp/play/zone.el8
-rw-r--r--lisp/subr.el9
3 files changed, 13 insertions, 6 deletions
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 9b464a0a137..f47373c115f 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -455,7 +455,7 @@ list."
455 ;; runs while point is in the minibuffer and the users attempt 455 ;; runs while point is in the minibuffer and the users attempt
456 ;; to use completion. Don't ask me. 456 ;; to use completion. Don't ask me.
457 (condition-case nil 457 (condition-case nil
458 (sit-for 0 0) 458 (sit-for 0)
459 (error nil))) 459 (error nil)))
460 460
461(defun eshell-read-passwd-file (file) 461(defun eshell-read-passwd-file (file)
diff --git a/lisp/play/zone.el b/lisp/play/zone.el
index 5ea5bbc9267..e3a9507f1cc 100644
--- a/lisp/play/zone.el
+++ b/lisp/play/zone.el
@@ -139,7 +139,7 @@ run a specific program. The program must be a member of
139 (untabify (point-min) (point-max)) 139 (untabify (point-min) (point-max))
140 (set-window-start (selected-window) (point-min)) 140 (set-window-start (selected-window) (point-min))
141 (set-window-point (selected-window) wp) 141 (set-window-point (selected-window) wp)
142 (sit-for 0 500) 142 (sit-for 0.500)
143 (let ((ct (and f (frame-parameter f 'cursor-type))) 143 (let ((ct (and f (frame-parameter f 'cursor-type)))
144 (show-trailing-whitespace nil) 144 (show-trailing-whitespace nil)
145 restore) 145 restore)
@@ -249,7 +249,7 @@ run a specific program. The program must be a member of
249 (while (not (input-pending-p)) 249 (while (not (input-pending-p))
250 (funcall (elt ops (random (length ops)))) 250 (funcall (elt ops (random (length ops))))
251 (goto-char (point-min)) 251 (goto-char (point-min))
252 (sit-for 0 10)))) 252 (sit-for 0.01))))
253 253
254 254
255;;;; whacking chars 255;;;; whacking chars
@@ -262,7 +262,7 @@ run a specific program. The program must be a member of
262 (aset tbl i (+ 48 (random (- 123 48)))) 262 (aset tbl i (+ 48 (random (- 123 48))))
263 (setq i (1+ i))) 263 (setq i (1+ i)))
264 (translate-region (point-min) (point-max) tbl) 264 (translate-region (point-min) (point-max) tbl)
265 (sit-for 0 2))))) 265 (sit-for 0.002)))))
266 266
267(put 'zone-pgm-whack-chars 'wc-tbl 267(put 'zone-pgm-whack-chars 'wc-tbl
268 (let ((tbl (make-string 128 ?x)) 268 (let ((tbl (make-string 128 ?x))
@@ -290,7 +290,7 @@ run a specific program. The program must be a member of
290 (delete-char 1) 290 (delete-char 1)
291 (insert " "))) 291 (insert " ")))
292 (forward-char 1)))) 292 (forward-char 1))))
293 (sit-for 0 2)))) 293 (sit-for 0.002))))
294 294
295(defun zone-pgm-dissolve () 295(defun zone-pgm-dissolve ()
296 (zone-remove-text) 296 (zone-remove-text)
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
3270where the optional arg MILLISECONDS specifies an additional wait period, 3270where the optional arg MILLISECONDS specifies an additional wait period,
3271in milliseconds; this was useful when Emacs was built without 3271in milliseconds; this was useful when Emacs was built without
3272floating point support." 3272floating point support."
3273 (declare (advertised-calling-convention (seconds &optional nodisp) "22.1")) 3273 (declare (advertised-calling-convention (seconds &optional nodisp) "22.1")
3274 (compiler-macro
3275 (lambda (form)
3276 (if (not (or (numberp nodisp) obsolete)) form
3277 (macroexp-warn-and-return
3278 "Obsolete calling convention for 'sit-for'"
3279 `(,(car form) (+ ,seconds (/ (or ,nodisp 0) 1000.0)) ,obsolete)
3280 '(obsolete sit-for))))))
3274 ;; This used to be implemented in C until the following discussion: 3281 ;; This used to be implemented in C until the following discussion:
3275 ;; https://lists.gnu.org/r/emacs-devel/2006-07/msg00401.html 3282 ;; https://lists.gnu.org/r/emacs-devel/2006-07/msg00401.html
3276 ;; Then it was moved here using an implementation based on an idle timer, 3283 ;; Then it was moved here using an implementation based on an idle timer,