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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 17 Sep 2024 15:50:11 +0300

> From: Manuel Giraud <[email-masked]>
> Cc: [email-masked]
> Date: Tue, 17 Sep 2024 10:19:41 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Can you try this and see if it solves the problem, and doesn't break
> > the other uses of midnight-mode and or clean-buffer-list?
> 
> Thanks.  It solves the issue of activacting the midnight-mode: now
> `clean-buffer-list' is just done once and won't run the next day.  But
> now, when I do M-x midnight-mode, I get the following error:
> 
> --8<---------------cut here---------------start------------->8---
> timer--activate: Invalid or uninitialized timer
> --8<---------------cut here---------------end--------------->8---

So not only did it activate the timer when loading the package, it
also relied on that for the mode to work...

The fix is to add

  (midnight-delay-set 'midnight-delay midnight-delay)

to midnight-mode function.