From 11be475eeebe957ba3a4640e59c9ab41ddbf74b2 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 12 Aug 2023 15:29:09 +0200 Subject: [PATCH] Remove compat code for XEmacs' itimer.el * lisp/progmodes/idlwave.el (idlwave-update-routine-info) (idlwave-start-load-rinfo-timer): * lisp/type-break.el (type-break-cancel-function-timers) (type-break-run-at-time): Remove XEmacs compat code. --- lisp/progmodes/idlwave.el | 10 ++-------- lisp/type-break.el | 25 ++++++------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 488e6aa3d2d..7bdaa6b1b6f 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -4311,10 +4311,7 @@ automatically when called interactively. When you need routine information updated immediately, leave NO-CONCATENATE nil." (interactive "P\np") ;; Stop any idle processing - (if (or (and (fboundp 'itimerp) - (itimerp idlwave-load-rinfo-idle-timer)) - (and (fboundp 'timerp) - (timerp idlwave-load-rinfo-idle-timer))) + (if (timerp idlwave-load-rinfo-idle-timer) (cancel-timer idlwave-load-rinfo-idle-timer)) (cond ((equal arg '(64)) @@ -4388,10 +4385,7 @@ information updated immediately, leave NO-CONCATENATE nil." (defvar idlwave-load-rinfo-steps-done (make-vector 6 nil)) (defvar idlwave-load-rinfo-idle-timer nil) (defun idlwave-start-load-rinfo-timer () - (if (or (and (fboundp 'itimerp) - (itimerp idlwave-load-rinfo-idle-timer)) - (and (fboundp 'timerp) - (timerp idlwave-load-rinfo-idle-timer))) + (if (timerp idlwave-load-rinfo-idle-timer) (cancel-timer idlwave-load-rinfo-idle-timer)) (setq idlwave-load-rinfo-steps-done (make-vector 6 nil)) (setq idlwave-load-rinfo-idle-timer nil) diff --git a/lisp/type-break.el b/lisp/type-break.el index 1aa2b9d2997..494ed80c496 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -584,13 +584,13 @@ INTERVAL is the full length of an interval (defaults to TIME)." (type-break-check-post-command-hook) (type-break-cancel-schedule) (type-break-time-warning-schedule time 'reset) - (type-break-run-at-time (max 1 time) nil 'type-break-alarm) + (run-at-time (max 1 time) nil 'type-break-alarm) (setq type-break-time-next-break (type-break-time-sum start (or interval time)))) (defun type-break-cancel-schedule () (type-break-cancel-time-warning-schedule) - (type-break-cancel-function-timers 'type-break-alarm) + (cancel-function-timers 'type-break-alarm) (setq type-break-alarm-p nil) (setq type-break-time-next-break nil)) @@ -621,7 +621,7 @@ INTERVAL is the full length of an interval (defaults to TIME)." ;(let (type-break-current-time-warning-interval) ; (type-break-cancel-time-warning-schedule)) - (type-break-run-at-time (max 1 time) nil 'type-break-time-warning-alarm) + (run-at-time (max 1 time) nil 'type-break-time-warning-alarm) (cond (resetp @@ -631,7 +631,7 @@ INTERVAL is the full length of an interval (defaults to TIME)." (setq type-break-warning-countdown-string-type "seconds")))))))) (defun type-break-cancel-time-warning-schedule () - (type-break-cancel-function-timers 'type-break-time-warning-alarm) + (cancel-function-timers 'type-break-time-warning-alarm) (remove-hook 'type-break-post-command-hook 'type-break-time-warning) (setq type-break-current-time-warning-interval type-break-time-warning-intervals) @@ -983,21 +983,6 @@ With optional non-nil ALL, force redisplay of all mode-lines." (defun type-break-check-post-command-hook () (add-hook 'post-command-hook 'type-break-run-tb-post-command-hook 'append)) - -;;; Timer wrapper functions -;; -;; These shield type-break from variations in the interval timer packages -;; for different versions of Emacs. - -(defun type-break-run-at-time (time repeat function) - (condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) - (run-at-time time repeat function)) - -(defvar timer-dont-exit) -(defun type-break-cancel-function-timers (function) - (let ((timer-dont-exit t)) - (cancel-function-timers function))) - ;;; Demo wrappers @@ -1144,6 +1129,8 @@ With optional non-nil ALL, force redisplay of all mode-lines." (kill-buffer buffer-name)))))) (define-obsolete-function-alias 'timep 'type-break-timep "29.1") +(define-obsolete-function-alias 'type-break-run-at-time #'run-at-time "30.1") +(define-obsolete-function-alias 'type-break-cancel-function-timers #'cancel-function-timers "30.1") (provide 'type-break) -- 2.39.2