Don't start the 'midnight' timer twice
* lisp/midnight.el (midnight-mode): Avoid starting the midnight timer twice when activating the mode the first time. (Bug#23123)
This commit is contained in:
parent
278c8a7ef7
commit
c8b868b1e2
1 changed files with 6 additions and 2 deletions
|
@ -53,8 +53,12 @@ the time when it is run.")
|
||||||
"Non-nil means run `midnight-hook' at midnight."
|
"Non-nil means run `midnight-hook' at midnight."
|
||||||
:global t
|
:global t
|
||||||
:initialize #'custom-initialize-default
|
:initialize #'custom-initialize-default
|
||||||
(if midnight-mode (timer-activate midnight-timer)
|
;; Disable first, since the ':initialize' function above already
|
||||||
(cancel-timer midnight-timer)))
|
;; starts the timer when the mode is turned on for the first time,
|
||||||
|
;; via setting 'midnight-delay', which calls 'midnight-delay-set',
|
||||||
|
;; which starts the timer.
|
||||||
|
(when (timerp midnight-timer) (cancel-timer midnight-timer))
|
||||||
|
(if midnight-mode (timer-activate midnight-timer)))
|
||||||
|
|
||||||
;;; time conversion
|
;;; time conversion
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue