From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73291: 31.0.50; `clean-buffer-list' activates `midnight-mode' Date: Sat, 21 Sep 2024 14:55:05 +0200 Message-ID: <87v7ypxj2u.fsf@ledu-giraud.fr> References: <87plp4vy08.fsf@ledu-giraud.fr> <86ikuvd9tp.fsf@gnu.org> <87frpyofoi.fsf@ledu-giraud.fr> <87frpyh11i.fsf@web.de> <868qvqbdgl.fsf@gnu.org> <87bk0mgkvb.fsf@web.de> <86y13q9j41.fsf@gnu.org> <87a5g5l49z.fsf@ledu-giraud.fr> <865xqs9okd.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1156"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: michael_heerdegen@web.de, Eli Zaretskii , 73291@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 21 14:56:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1srzej-000AdI-7r for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Sep 2024 14:56:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srzeL-0001rq-TE; Sat, 21 Sep 2024 08:55:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srzeK-0001rF-1O for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 08:55:44 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srzeI-00042I-Vb for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 08:55:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=J+tHovthmvZI7YsQnTKIPu/BXR6N/tQgomunB/YOLag=; b=sVxwd+xWSi56RZG9bp+GJcdShL+iTfdG1ActozOTcs0CcOetVqqYSBAxy/cfSazKDGairzKWPjuFg0o2BkuhfiWLcpx8pt6CSWaCRWBop+NFkSSUBlBTs6NUhQqHXuRIvKS9kCROOVbfOHBJBE7xdSEPORcB29hTcjDtRxPwxO1ZDwtDYFelv8Fpz5czVl2b/YKGlJ/FVKCpiSqfF1C0E2iPwSMbuP01OZGl0gVr6vDbMVKhmX/VaHbJo2uF2H0fr+sgKsd093JUYImuCFknijh0lmqxmJN1A/NNEaNkV1KY2DeRYwR6qGDmxKf9m1c2JpXMw2y5NzjrXc7FWlREEg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srzec-0005jD-KU for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 08:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Sep 2024 12:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73291 X-GNU-PR-Package: emacs Original-Received: via spool by 73291-submit@debbugs.gnu.org id=B73291.172692333221632 (code B ref 73291); Sat, 21 Sep 2024 12:56:02 +0000 Original-Received: (at 73291) by debbugs.gnu.org; 21 Sep 2024 12:55:32 +0000 Original-Received: from localhost ([127.0.0.1]:37557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srze8-0005ca-0B for submit@debbugs.gnu.org; Sat, 21 Sep 2024 08:55:32 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:34270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srze5-0005aJ-AK for 73291@debbugs.gnu.org; Sat, 21 Sep 2024 08:55:30 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=FLOgRPg6 2HDi7CQQwkMWHSARnHmU0i9EzMOoesfpjH8=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=PXu7DF6a2ATERIDcETbLbW0cUV+g9f e98ByLkaPXlXRj1AczP+UKF+vWH9kpx7xzcUGBhtRJ6NcUmq8oqX/9AA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=FLOgRPg62HDi7CQQ wkMWHSARnHmU0i9EzMOoesfpjH8=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=osqWE7uEsqhceZ5lDtZoICO3ZNTHKsStgU4KuG pjB6a710KfDgwsiClbtGTLLXpcokEks3yTRKW22rDlqMIdpYFQxRIw/4lscmjVi4FnxJ4H Tb2Z84iD65pKej8yyjH3r4DJU0lEIaSYweIJzbdp3iBBigkRcYNM3tnkwqDpXmPbyR7gYp rzf32tFqfdZqkVpkya6SzRw0ARAOIEo7aosSd/q1NzJ3FjpO0Si7jJK5W5dn621acD8lGJ W99yEk50s7tZuGeW0Ge7KbCgoVjLn31jPAvXP4xqqlZRDlwm/FjmeNFNJ8R/GrC4Uujazj 2oo4ZDlHJYTnpLJMcCSlJHpg== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 633ae95d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 21 Sep 2024 14:55:06 +0200 (CEST) In-Reply-To: (Stefan Kangas's message of "Fri, 20 Sep 2024 17:27:05 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292186 Archived-At: --=-=-= Content-Type: text/plain Stefan Kangas writes: > Eli Zaretskii writes: > >> So please install all the other changes on master and this one on the >> release branch. > > I did the second part. > > Manuel, could you please resubmit your patch as formatted by Here. I also add the NEWS entry as suggested by Eli. Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-clean-buffer-list-don-t-activate-midnight-mode.patch >From 8d668972fad20b1baba3d7a56f3612e0d7689e25 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 21 Sep 2024 14:51:21 +0200 Subject: [PATCH] clean-buffer-list don't activate midnight-mode Bug#73291 * lisp/midnight.el (midnight-mode): Call `midnight-delay-set' again when mode is activated. (midnight-delay-set): Only start the timer if the mode is turned on. * etc/NEWS: Document the change in behaviour. --- etc/NEWS | 7 +++++++ lisp/midnight.el | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 6c97ffacd15..46abc908c6e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -390,6 +390,13 @@ functionality of the standard 'xref' commands in TeX buffers. You can 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. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/midnight.el b/lisp/midnight.el index ea30f5462f2..e5dd7221591 100644 --- a/lisp/midnight.el +++ b/lisp/midnight.el @@ -52,12 +52,11 @@ midnight-mode "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 @@ -207,9 +206,11 @@ midnight-delay-set "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. -- 2.46.0 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--