;;; timer.el --- run a function with args at some time in future -*- lexical-binding: t -*-
-;; Copyright (C) 1996, 2001-2023 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2023 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Package: emacs
timer will fire right away."
(timer--activate timer (not dont-wait) reuse-cell 'idle))
-(defalias 'disable-timeout #'cancel-timer)
-
(defun cancel-timer (timer)
"Remove TIMER from the list of active timers."
(timer--check timer)
(memq timer timer-list))
(setf (timer--triggered timer) nil))))))
-;; This function is incompatible with the one in levents.el.
(defun timeout-event-p (event)
"Non-nil if EVENT is a timeout event."
(and (listp event) (eq (car event) 'timer-event)))
This function returns a timer object which you can use in `cancel-timer'.
This function is for compatibility; see also `run-with-timer'."
+ (declare (obsolete run-with-timer "30.1"))
(run-with-timer secs repeat function object))
(defun run-with-idle-timer (secs repeat function &rest args)
(dolist (timer timer-idle-list)
(if (timerp timer) ;; FIXME: Why test?
(setf (timer--triggered timer) nil))))
+
+(define-obsolete-function-alias 'disable-timeout #'cancel-timer "30.1")
+
\f
(provide 'timer)
(defun tooltip-cancel-delayed-tip ()
"Disable the tooltip timeout."
(when tooltip-timeout-id
- (disable-timeout tooltip-timeout-id)
+ (cancel-timer tooltip-timeout-id)
(setq tooltip-timeout-id nil)))
(defun tooltip-start-delayed-tip ()
"Add a one-shot timeout to call function `tooltip-timeout'."
(setq tooltip-timeout-id
- (add-timeout (tooltip-delay) 'tooltip-timeout nil)))
+ (run-with-timer (tooltip-delay) 'tooltip-timeout nil)))
(defun tooltip-timeout (_object)
"Function called when timer with id `tooltip-timeout-id' fires."