ITADN

Emacs 32: timers scheduled ~57 years out, no theme ever switches

#42Openagzam 创建于 8 天前
A
agzamcommented
## Summary On Emacs 32 (master), circadian schedules exactly one theme switch at setup time and puts it roughly 57 years into the future. No switch ever happens. Measured on Emacs 32.0.50, circadian 1.0.2, with a fixed-time `circadian-themes`: ```elisp (format-time-string "%F %H:%M" (timer--time circadian-next-timer)) ;; => "2083-04-07 09:54" ;; today is 2026-08-19 ``` ## Cause `circadian-encode-time` ends in: ```elisp (encode-time 0 min hour day month year nil -1 nil) ``` Emacs 32 changed the default of `current-time-list` to nil. From its NEWS: > ** The transition variable 'current-time-list' now defaults to nil. > Therefore, timestamps now default to '(TICKS . HZ)' form instead of the > older '(HIGH LOW USEC PSEC)' form. At 1 Hz that form is a plain integer, so `encode-time` now returns `1787184000` where it used to return `(27269 50048)`. `run-at-time` distinguishes an absolute moment from a delay by type, and a number means a delay: ```elisp (run-at-time 1787184000 nil #'ignore) ;; => fires 2026-08-19 + 1787184000s = 2083 (run-at-time '(27269 50048) nil #'ignore) ;; => fires 2026-08-19 19:00 ``` ## Suggested fix Normalise the return value in `circadian-encode-time`: ```elisp (time-convert (encode-time 0 min hour day month year nil -1 nil) 'list) ``` `time-convert` is Emacs 27.1, so this keeps the current `(emacs "27.2")` floor. It is also a no-op on Emacs versions where `current-time-list` is still t. ## Note `circadian-enable-theme` wraps its whole body in ```elisp (condition-case nil (progn ...) (error "[circadian.el/ERROR] → Problem loading theme %s" theme)) ``` The handler body is a string followed by `theme`, so it evaluates to `theme` and signals nothing. Every error inside the function is swallowed silently, which makes failures like this one invisible.
2 条评论