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.
This commit is contained in:
Mattias Engdegård 2024-07-25 12:37:34 +02:00
parent d2cb9f2bf6
commit e56e4b345a
6 changed files with 12 additions and 20 deletions

View file

@ -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))