diff options
| author | Stefan Kangas | 2023-08-08 04:53:08 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2023-08-08 04:53:08 +0200 |
| commit | a579739e2b3f3c7218b14a7e41b78e7ddbded06c (patch) | |
| tree | 7082f5cc920bed7e1843f08a4de44961eef66e8a | |
| parent | 301e6a747acc31f9bcc5b7c2429dbcfa806d48f5 (diff) | |
| download | emacs-a579739e2b3f3c7218b14a7e41b78e7ddbded06c.tar.gz emacs-a579739e2b3f3c7218b14a7e41b78e7ddbded06c.zip | |
Make XEmacs compat aliases for timers obsolete
* lisp/emacs-lisp/timer.el (disable-timeout, add-timeout): Make
XEmacs compat aliases obsolete. Update all callers.
| -rw-r--r-- | lisp/emacs-lisp/timer.el | 9 | ||||
| -rw-r--r-- | lisp/tooltip.el | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 7544279d8aa..468c46519fd 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; timer.el --- run a function with args at some time in future -*- lexical-binding: t -*- | 1 | ;;; timer.el --- run a function with args at some time in future -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996, 2001-2023 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1996-2023 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Maintainer: emacs-devel@gnu.org | 5 | ;; Maintainer: emacs-devel@gnu.org |
| 6 | ;; Package: emacs | 6 | ;; Package: emacs |
| @@ -226,8 +226,6 @@ the time of the current timer. That's because the activated | |||
| 226 | timer will fire right away." | 226 | timer will fire right away." |
| 227 | (timer--activate timer (not dont-wait) reuse-cell 'idle)) | 227 | (timer--activate timer (not dont-wait) reuse-cell 'idle)) |
| 228 | 228 | ||
| 229 | (defalias 'disable-timeout #'cancel-timer) | ||
| 230 | |||
| 231 | (defun cancel-timer (timer) | 229 | (defun cancel-timer (timer) |
| 232 | "Remove TIMER from the list of active timers." | 230 | "Remove TIMER from the list of active timers." |
| 233 | (timer--check timer) | 231 | (timer--check timer) |
| @@ -348,7 +346,6 @@ This function is called, by name, directly by the C code." | |||
| 348 | (memq timer timer-list)) | 346 | (memq timer timer-list)) |
| 349 | (setf (timer--triggered timer) nil)))))) | 347 | (setf (timer--triggered timer) nil)))))) |
| 350 | 348 | ||
| 351 | ;; This function is incompatible with the one in levents.el. | ||
| 352 | (defun timeout-event-p (event) | 349 | (defun timeout-event-p (event) |
| 353 | "Non-nil if EVENT is a timeout event." | 350 | "Non-nil if EVENT is a timeout event." |
| 354 | (and (listp event) (eq (car event) 'timer-event))) | 351 | (and (listp event) (eq (car event) 'timer-event))) |
| @@ -448,6 +445,7 @@ If REPEAT is non-nil, repeat the timer every REPEAT seconds. | |||
| 448 | 445 | ||
| 449 | This function returns a timer object which you can use in `cancel-timer'. | 446 | This function returns a timer object which you can use in `cancel-timer'. |
| 450 | This function is for compatibility; see also `run-with-timer'." | 447 | This function is for compatibility; see also `run-with-timer'." |
| 448 | (declare (obsolete run-with-timer "30.1")) | ||
| 451 | (run-with-timer secs repeat function object)) | 449 | (run-with-timer secs repeat function object)) |
| 452 | 450 | ||
| 453 | (defun run-with-idle-timer (secs repeat function &rest args) | 451 | (defun run-with-idle-timer (secs repeat function &rest args) |
| @@ -580,6 +578,9 @@ If the user does not answer after SECONDS seconds, return DEFAULT-VALUE." | |||
| 580 | (dolist (timer timer-idle-list) | 578 | (dolist (timer timer-idle-list) |
| 581 | (if (timerp timer) ;; FIXME: Why test? | 579 | (if (timerp timer) ;; FIXME: Why test? |
| 582 | (setf (timer--triggered timer) nil)))) | 580 | (setf (timer--triggered timer) nil)))) |
| 581 | |||
| 582 | (define-obsolete-function-alias 'disable-timeout #'cancel-timer "30.1") | ||
| 583 | |||
| 583 | 584 | ||
| 584 | (provide 'timer) | 585 | (provide 'timer) |
| 585 | 586 | ||
diff --git a/lisp/tooltip.el b/lisp/tooltip.el index 8d92caed08e..0881a7c7bf9 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el | |||
| @@ -194,13 +194,13 @@ This might return nil if the event did not occur over a buffer." | |||
| 194 | (defun tooltip-cancel-delayed-tip () | 194 | (defun tooltip-cancel-delayed-tip () |
| 195 | "Disable the tooltip timeout." | 195 | "Disable the tooltip timeout." |
| 196 | (when tooltip-timeout-id | 196 | (when tooltip-timeout-id |
| 197 | (disable-timeout tooltip-timeout-id) | 197 | (cancel-timer tooltip-timeout-id) |
| 198 | (setq tooltip-timeout-id nil))) | 198 | (setq tooltip-timeout-id nil))) |
| 199 | 199 | ||
| 200 | (defun tooltip-start-delayed-tip () | 200 | (defun tooltip-start-delayed-tip () |
| 201 | "Add a one-shot timeout to call function `tooltip-timeout'." | 201 | "Add a one-shot timeout to call function `tooltip-timeout'." |
| 202 | (setq tooltip-timeout-id | 202 | (setq tooltip-timeout-id |
| 203 | (add-timeout (tooltip-delay) 'tooltip-timeout nil))) | 203 | (run-with-timer (tooltip-delay) 'tooltip-timeout nil))) |
| 204 | 204 | ||
| 205 | (defun tooltip-timeout (_object) | 205 | (defun tooltip-timeout (_object) |
| 206 | "Function called when timer with id `tooltip-timeout-id' fires." | 206 | "Function called when timer with id `tooltip-timeout-id' fires." |