Subject: bug#73291: 31.0.50; `clean-buffer-list' activates `midnight-mode'

From: Stefan Kangas <[email-masked]>
Date: Wed, 18 Sep 2024 16:52:25 -0700

Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

> I think the following patch does the trick.

Previously, putting this in your init file enabled midnight-mode:

    (require 'midnight)

Now, one needs to say this instead:

    (midnight-mode +1)

Right?  If yes, this change is backwards-incompatible and should be
called out in NEWS.

I still think this is worth doing, because we want to avoid side-effects
like enabling modes just from loading an Emacs Lisp library.  This is
one of few such places that we have left.  Not having midnight-mode on
should also usually not be a very big problem.

Since the latter will work on previous versions of Emacs all the way
back to 25.1, I think we might as well install the below documentation
patch on the emacs-30 branch too.

diff --git a/lisp/midnight.el b/lisp/midnight.el
index bfa99d6a7a8..cc9150ccc9e 100644
--- a/lisp/midnight.el
+++ b/lisp/midnight.el
@@ -23,7 +23,7 @@

 ;;; Commentary:

-;; To use the file, put (require 'midnight) into your .emacs.  Then, at
+;; To use the file, put (midnight-mode) into your .emacs.  Then, at
 ;; midnight, Emacs will run the normal hook `midnight-hook'.  You can
 ;; put whatever you like there, say, `calendar'; by default there is
 ;; only one function there - `clean-buffer-list'.  It will kill the