* 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.
(cherry picked from commit
e56e4b345a25194bc7adb83523e8d886b718c9fa)
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
(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))
;; Since idle timers created when Emacs is already in the idle
;; state don't get activated until Emacs _next_ becomes idle, we
;; need to force our timer to be considered active now. We do
- ;; this by being naughty and poking the timer internals directly
- ;; (element 0 of the vector is nil if the timer is active).
- (aset mail-source-report-new-mail-idle-timer 0 nil)))
+ ;; this by being naughty and poking the timer internals directly.
+ (setf (timer--triggered mail-source-report-new-mail-idle-timer) nil)))
(declare-function display-time-event-handler "time" ())
(defun gamegrid-set-timer (delay)
(if gamegrid-timer
- (timer-set-time gamegrid-timer
- (list (aref gamegrid-timer 1)
- (aref gamegrid-timer 2)
- (aref gamegrid-timer 3))
- delay)))
+ (timer-set-time gamegrid-timer (timer--time gamegrid-timer) delay)))
(defun gamegrid-kill-timer ()
(if gamegrid-timer
(if (fboundp 'start-itimer)
(start-itimer "vhdl-mode" function secs repeat t)
;; explicitly activate timer (necessary when Emacs is already idle)
- (aset (run-with-idle-timer secs repeat function) 0 nil)))
+ (setf (timer--triggered (run-with-idle-timer secs repeat function)) nil)))
(defun vhdl-warning-when-idle (&rest args)
"Wait until idle, then print out warning STRING and beep."
(if timer
;; The timer is already running. See if it's due to expire
;; within the next five seconds.
- (let ((time (list (aref timer 1) (aref timer 2)
- (aref timer 3))))
+ (let ((time (timer--time timer)))
(unless (<= (time-convert (time-subtract time nil)
'integer)
5)
(timer display-time-timer)
;; Compute the time when this timer will run again, next.
(next-time (timer-relative-time
- (list (aref timer 1) (aref timer 2) (aref timer 3))
- (* 5 (aref timer 4)) 0)))
+ (timer--time timer)
+ (* 5 (timer--repeat-delay timer)) 0)))
;; If the activation time is not in the future,
;; skip executions until we reach a time in the future.
;; This avoids a long pause if Emacs has been suspended for hours.