restore the standard 'etags' backend with the 'M-x xref-etags-mode'
toggle.
+** Midnight mode
+
+---
+*** Change for activating the mode
+Putting (require 'midnight) in your init file no longer activates the
+mode. Now, one needs to say (midnight-mode +1) instead.
+
\f
* New Modes and Packages in Emacs 31.1
"Non-nil means run `midnight-hook' at midnight."
:global t
:initialize #'custom-initialize-default
- ;; Disable first, since the ':initialize' function above already
- ;; 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)))
+ ;; Call `midnight-delay-set' again because it takes care of starting
+ ;; the timer if the mode is on. The ':initialize' function above
+ ;; (which ends up calling `midnight-delay-set') did not know yet if
+ ;; the mode was on or not.
+ (midnight-delay-set 'midnight-delay midnight-delay))
;;; clean-buffer-list stuff
"Invalid argument to `midnight-delay-set': `%s'")
(set symb tm)
(when (timerp midnight-timer) (cancel-timer midnight-timer))
- (setq midnight-timer
- (run-at-time (if (numberp tm) (+ (midnight-next) tm) tm)
- midnight-period #'run-hooks 'midnight-hook)))
+ ;; Only start the timer if the mode is turned on.
+ (when midnight-mode
+ (setq midnight-timer
+ (run-at-time (if (numberp tm) (+ (midnight-next) tm) tm)
+ midnight-period #'run-hooks 'midnight-hook))))
(defcustom midnight-delay 3600
"The number of seconds after the midnight when the `midnight-timer' is run.