I have a timer I want to run every day at 4am. Thus, I put something like this in my configuration.
(defvar my/timer nil)
(unless my/timer
(setq my/timer (run-at-time "04:00am" (* 24 60 60) #'my/function)))
This works as expected, except that each time this snippet is evaluated for the first time (e.g., when launching emacs), my/function
is executed immediately. In fact, evaluating (run-at-time "04:00am" (* 24 60 60) #'my/function)
at any time in the day causes this effect.
Maybe I have a misunderstanding, but isn't it supposed to run only at the specified time ?