1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-05 11:45:45 +00:00

Make XEmacs compat aliases for timers obsolete

* lisp/emacs-lisp/timer.el (disable-timeout, add-timeout): Make
XEmacs compat aliases obsolete.  Update all callers.
This commit is contained in:
Stefan Kangas 2023-08-08 04:53:08 +02:00
parent 301e6a747a
commit a579739e2b
2 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,6 @@
;;; 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
@ -226,8 +226,6 @@ the time of the current timer. That's because the activated
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)
@ -348,7 +346,6 @@ This function is called, by name, directly by the C code."
(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)))
@ -448,6 +445,7 @@ If REPEAT is non-nil, repeat the timer every REPEAT seconds.
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)
@ -580,6 +578,9 @@ If the user does not answer after SECONDS seconds, return DEFAULT-VALUE."
(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")
(provide 'timer)

View File

@ -194,13 +194,13 @@ This might return nil if the event did not occur over a buffer."
(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."