From a579739e2b3f3c7218b14a7e41b78e7ddbded06c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 8 Aug 2023 04:53:08 +0200 Subject: [PATCH] Make XEmacs compat aliases for timers obsolete * lisp/emacs-lisp/timer.el (disable-timeout, add-timeout): Make XEmacs compat aliases obsolete. Update all callers. --- lisp/emacs-lisp/timer.el | 9 +++++---- 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 @@ ;;; 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) 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." (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."