From e56e4b345a25194bc7adb83523e8d886b718c9fa Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Thu, 25 Jul 2024 12:37:34 +0200 Subject: Use timer accessors instead of aref/aset * lisp/emacs-lisp/timer-list.el (list-timers): * lisp/gnus/mail-source.el (mail-source-start-idle-timer): * lisp/play/gamegrid.el (gamegrid-set-timer): * lisp/progmodes/vhdl-mode.el (vhdl-run-when-idle): * lisp/simple.el (analyze-text-conversion): * lisp/time.el (display-time-event-handler): Use timer accessors. --- lisp/emacs-lisp/timer-list.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el index 52309a247c0..c237eeb52af 100644 --- a/lisp/emacs-lisp/timer-list.el +++ b/lisp/emacs-lisp/timer-list.el @@ -41,23 +41,21 @@ nil `[ ;; Idle. ,(propertize - (if (aref timer 7) " *" " ") + (if (timer--idle-delay timer) " *" " ") 'help-echo "* marks idle timers" 'timer timer) ;; Next time. ,(propertize - (let ((time (list (aref timer 1) - (aref timer 2) - (aref timer 3)))) + (let ((time (timer--time timer))) (format "%12s" (format-seconds "%dd %hh %mm %z%,1ss" (float-time - (if (aref timer 7) + (if (timer--idle-delay timer) time (time-subtract time nil)))))) 'help-echo "Time until next invocation") ;; Repeat. - ,(let ((repeat (aref timer 4))) + ,(let ((repeat (timer--repeat-delay timer))) (cond ((numberp repeat) (propertize @@ -73,7 +71,7 @@ (let ((cl-print-compiled 'static) (cl-print-compiled-button nil) (print-escape-newlines t)) - (cl-prin1-to-string (aref timer 5))) + (cl-prin1-to-string (timer--function timer))) 'help-echo "Function called by timer")])) (append timer-list timer-idle-list))) (tabulated-list-print)) -- cgit v1.2.3