GNU bug report logs - #75834
[PATCH] Add missing custom :set to savehist-autosave-interval

Previous Next

Package: emacs;

Reported by: Ship Mints <shipmints <at> gmail.com>

Date: Sat, 25 Jan 2025 18:22:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75834 in the body.
You can then email your comments to 75834 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 25 Jan 2025 18:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ship Mints <shipmints <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 25 Jan 2025 18:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add missing custom :set to savehist-autosave-interval
Date: Sat, 25 Jan 2025 13:19:11 -0500
[Message part 1 (text/plain, inline)]
* lisp/savehist.el (savehist-autosave-interval):
Correctly reset 'savehist-timer' when savehist-autosave-interval changes
via setopt or a Customize command.

An open question is should the timer be an idle timer or not. Currently,
the timer is a regular timer. I'd prefer an idle timer. Not sure how many
people would care if this changed.
[Message part 2 (text/html, inline)]
[0001-Add-missing-custom-set-to-savehist-autosave-interval.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 11:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 01 Feb 2025 13:12:43 +0200
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 25 Jan 2025 13:19:11 -0500
> 
> * lisp/savehist.el (savehist-autosave-interval):
> Correctly reset 'savehist-timer' when savehist-autosave-interval changes
> via setopt or a Customize command.

What does this do when the user loads savehist.el due to some
Customize command, but doesn't activate savehist-mode?  Does it start
the timer, for example?

> An open question is should the timer be an idle timer or not. Currently, the timer is a regular timer. I'd prefer
> an idle timer. Not sure how many people would care if this changed.

Why do you think an idle timer would be better?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 13:25:01 GMT) Full text and rfc822 format available.

Message #11 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 1 Feb 2025 08:21:59 -0500
[Message part 1 (text/plain, inline)]
On Sat, Feb 1, 2025 at 6:12 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Ship Mints <shipmints <at> gmail.com>
> > Date: Sat, 25 Jan 2025 13:19:11 -0500
> >
> > * lisp/savehist.el (savehist-autosave-interval):
> > Correctly reset 'savehist-timer' when savehist-autosave-interval changes
> > via setopt or a Customize command.
>
> What does this do when the user loads savehist.el due to some
> Customize command, but doesn't activate savehist-mode?  Does it start
> the timer, for example?
>

The timer is established only when savehist mode is enabled and the
interval is non-nil.

> An open question is should the timer be an idle timer or not. Currently,
> the timer is a regular timer. I'd prefer
> > an idle timer. Not sure how many people would care if this changed.
>
> Why do you think an idle timer would be better?
>

I prefer idle timers for this kind of thing as I find auto saving while I'm
working to be distracting, and occasionally slows me down at least on my
slow computer, and barely noticeable on my fast one. As not everyone has
super fast modern equipment, I'm guessing we prefer to be respectful of
older setups. I have three autosave timers set up in my configuration, and
even one is distracting enough.

The timer I put in save-place is an idle timer, and now is a good time to
debate idle vs. absolute timers for these.

-Stephane
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 13:29:02 GMT) Full text and rfc822 format available.

Message #14 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 01 Feb 2025 15:28:35 +0200
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 1 Feb 2025 08:21:59 -0500
> Cc: 75834 <at> debbugs.gnu.org
> 
> On Sat, Feb 1, 2025 at 6:12 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>  > From: Ship Mints <shipmints <at> gmail.com>
>  > Date: Sat, 25 Jan 2025 13:19:11 -0500
>  > 
>  > * lisp/savehist.el (savehist-autosave-interval):
>  > Correctly reset 'savehist-timer' when savehist-autosave-interval changes
>  > via setopt or a Customize command.
> 
>  What does this do when the user loads savehist.el due to some
>  Customize command, but doesn't activate savehist-mode?  Does it start
>  the timer, for example?
> 
> The timer is established only when savehist mode is enabled and the interval is non-nil.

OK, thanks.

>  > An open question is should the timer be an idle timer or not. Currently, the timer is a regular timer. I'd
>  prefer
>  > an idle timer. Not sure how many people would care if this changed.
> 
>  Why do you think an idle timer would be better?
> 
> I prefer idle timers for this kind of thing as I find auto saving while I'm working to be distracting, and
> occasionally slows me down at least on my slow computer, and barely noticeable on my fast one. As not
> everyone has super fast modern equipment, I'm guessing we prefer to be respectful of older setups. I have
> three autosave timers set up in my configuration, and even one is distracting enough.
> 
> The timer I put in save-place is an idle timer, and now is a good time to debate idle vs. absolute timers for
> these.

A disadvantage of idle timers is that they can miss changes.  This
might be more significant for the save-place case, since by the time
Emacs is idle, the file you visited might no longer be visited in any
buffer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 13:38:02 GMT) Full text and rfc822 format available.

Message #17 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 1 Feb 2025 08:35:09 -0500
[Message part 1 (text/plain, inline)]
On Sat, Feb 1, 2025 at 8:28 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> >
> >  Why do you think an idle timer would be better?
> >
> > I prefer idle timers for this kind of thing as I find auto saving while
> I'm working to be distracting, and
> > occasionally slows me down at least on my slow computer, and barely
> noticeable on my fast one. As not
> > everyone has super fast modern equipment, I'm guessing we prefer to be
> respectful of older setups. I have
> > three autosave timers set up in my configuration, and even one is
> distracting enough.
> >
> > The timer I put in save-place is an idle timer, and now is a good time
> to debate idle vs. absolute timers for
> > these.
>
> A disadvantage of idle timers is that they can miss changes.  This
> might be more significant for the save-place case, since by the time
> Emacs is idle, the file you visited might no longer be visited in any
> buffer.
>

Changes to the save-place-alist in memory are not lost unless there is an
Emacs crash or an abnormal Emacs shutdown. Same
for savehist-minibuffer-history-variables which are accumulated in memory
until persisted.

It's the interval to persist the save-place-alist that we're talking about.
I think using an idle timer in both saveplace and savehist will not cause a
real-world issue. If people are truly concerned about persisting they
should set a very short timer and idleness occurs frequently, in practice.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 13:58:02 GMT) Full text and rfc822 format available.

Message #20 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 01 Feb 2025 15:57:46 +0200
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 1 Feb 2025 08:35:09 -0500
> Cc: 75834 <at> debbugs.gnu.org
> 
> On Sat, Feb 1, 2025 at 8:28 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>  A disadvantage of idle timers is that they can miss changes.  This
>  might be more significant for the save-place case, since by the time
>  Emacs is idle, the file you visited might no longer be visited in any
>  buffer.
> 
> Changes to the save-place-alist in memory are not lost unless there is an Emacs crash or an abnormal
> Emacs shutdown. Same for savehist-minibuffer-history-variables which are accumulated in memory until
> persisted.

But saving with a timer _is_ for the case of abnormal shutdown or
crash, isn't it?  Because otherwise we could just save at exit, right?

So if you are using an idle timer of 5 min, and is Emacs never idle
for 5 min before it crashes, the data will be lost.

> It's the interval to persist the save-place-alist that we're talking about. I think using an idle timer in both
> saveplace and savehist will not cause a real-world issue. If people are truly concerned about persisting they
> should set a very short timer and idleness occurs frequently, in practice.

It's not just any idleness, it's 5 min of idleness.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 14:15:02 GMT) Full text and rfc822 format available.

Message #23 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 1 Feb 2025 09:12:26 -0500
[Message part 1 (text/plain, inline)]
On Sat, Feb 1, 2025 at 8:57 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Ship Mints <shipmints <at> gmail.com>
> > Date: Sat, 1 Feb 2025 08:35:09 -0500
> > Cc: 75834 <at> debbugs.gnu.org
> >
> > On Sat, Feb 1, 2025 at 8:28 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> >  A disadvantage of idle timers is that they can miss changes.  This
> >  might be more significant for the save-place case, since by the time
> >  Emacs is idle, the file you visited might no longer be visited in any
> >  buffer.
> >
> > Changes to the save-place-alist in memory are not lost unless there is
> an Emacs crash or an abnormal
> > Emacs shutdown. Same for savehist-minibuffer-history-variables which are
> accumulated in memory until
> > persisted.
>
> But saving with a timer _is_ for the case of abnormal shutdown or
> crash, isn't it?  Because otherwise we could just save at exit, right?
>
> So if you are using an idle timer of 5 min, and is Emacs never idle
> for 5 min before it crashes, the data will be lost.
>
> > It's the interval to persist the save-place-alist that we're talking
> about. I think using an idle timer in both
> > saveplace and savehist will not cause a real-world issue. If people are
> truly concerned about persisting they
> > should set a very short timer and idleness occurs frequently, in
> practice.
>
> It's not just any idleness, it's 5 min of idleness.
>

That's right. And could be 10 seconds of idleness if a user wants. Since
idle timers don't rerun until the next idleness, it seems more optimal than
saving these structures every time the timer fires without knowing if
they've changed (not an optimization I'm inclined to put in, but could).

I wind up starting multiple versions of Emacs throughout the day, as I'm
sure many of you do, and having nearly up to date hist/places is helpful
beyond waiting for a long-lived Emacs to exit.

How about we offer the user to decide idle or regular timer? However, if a
timer was already in saveplace, I'd just have used what was there, so if
you feel strongly about a regular timer, I'll change saveplace to a regular
timer as savehist uses. I might be persuaded to change the idle timer I put
in a package I help maintain, too.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 14:24:02 GMT) Full text and rfc822 format available.

Message #26 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 01 Feb 2025 16:23:27 +0200
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 1 Feb 2025 09:12:26 -0500
> Cc: 75834 <at> debbugs.gnu.org
> 
>  It's not just any idleness, it's 5 min of idleness.
> 
> That's right. And could be 10 seconds of idleness if a user wants. Since idle timers don't rerun until the next
> idleness, it seems more optimal than saving these structures every time the timer fires without knowing if
> they've changed (not an optimization I'm inclined to put in, but could).
> 
> I wind up starting multiple versions of Emacs throughout the day, as I'm sure many of you do, and having
> nearly up to date hist/places is helpful beyond waiting for a long-lived Emacs to exit.
> 
> How about we offer the user to decide idle or regular timer? However, if a timer was already in saveplace, I'd
> just have used what was there, so if you feel strongly about a regular timer, I'll change saveplace to a
> regular timer as savehist uses. I might be persuaded to change the idle timer I put in a package I help
> maintain, too.

I prefer to avoid such complexity.

What exactly is the problem with using normal non-idle timers in both
these cases?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 14:27:02 GMT) Full text and rfc822 format available.

Message #29 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 1 Feb 2025 09:24:17 -0500
[Message part 1 (text/plain, inline)]
On Sat, Feb 1, 2025 at 9:23 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> What exactly is the problem with using normal non-idle timers in both
> these cases?
>

I prefer timers such as these not to run while I'm typing, even slowly, or
otherwise navigating. That's all. As I said, if saveplace already had a
regular timer in place, I'd just have used that even if I prefer idle. I
could ask you the same question. Why you prefer to be interrupted for these
kinds of things vs. idleness, even with a short after-idle interval.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 14:52:01 GMT) Full text and rfc822 format available.

Message #32 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 01 Feb 2025 16:51:48 +0200
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 1 Feb 2025 09:24:17 -0500
> Cc: 75834 <at> debbugs.gnu.org
> 
> On Sat, Feb 1, 2025 at 9:23 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>  What exactly is the problem with using normal non-idle timers in both
>  these cases?
> 
> I prefer timers such as these not to run while I'm typing, even slowly, or otherwise navigating.

If you type fast enough, they never will.

> That's all. As I
> said, if saveplace already had a regular timer in place, I'd just have used that even if I prefer idle. I could ask
> you the same question. Why you prefer to be interrupted for these kinds of things vs. idleness, even with a
> short after-idle interval.

I prefer normal timers because their invocation frequency is more
reliable than that of idle timers.  And reliability is important when
we are talking about features that at least in some cases are intended
to save the day if Emacs crashes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 14:55:02 GMT) Full text and rfc822 format available.

Message #35 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 1 Feb 2025 09:52:23 -0500
[Message part 1 (text/plain, inline)]
On Sat, Feb 1, 2025 at 9:51 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Ship Mints <shipmints <at> gmail.com>
> > Date: Sat, 1 Feb 2025 09:24:17 -0500
> > Cc: 75834 <at> debbugs.gnu.org
> >
> > On Sat, Feb 1, 2025 at 9:23 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> >  What exactly is the problem with using normal non-idle timers in both
> >  these cases?
> >
> > I prefer timers such as these not to run while I'm typing, even slowly,
> or otherwise navigating.
>
> If you type fast enough, they never will.
>
> > That's all. As I
> > said, if saveplace already had a regular timer in place, I'd just have
> used that even if I prefer idle. I could ask
> > you the same question. Why you prefer to be interrupted for these kinds
> of things vs. idleness, even with a
> > short after-idle interval.
>
> I prefer normal timers because their invocation frequency is more
> reliable than that of idle timers.  And reliability is important when
> we are talking about features that at least in some cases are intended
> to save the day if Emacs crashes.
>

Let's go with regular timers, then. I'll revise the saveplace patch and we
can retire the discussion about savehist idle timer.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75834; Package emacs. (Sat, 01 Feb 2025 15:31:01 GMT) Full text and rfc822 format available.

Message #38 received at 75834 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 75834 <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 01 Feb 2025 17:29:51 +0200
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 1 Feb 2025 09:52:23 -0500
> Cc: 75834 <at> debbugs.gnu.org
> 
> On Sat, Feb 1, 2025 at 9:51 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>  > From: Ship Mints <shipmints <at> gmail.com>
>  > Date: Sat, 1 Feb 2025 09:24:17 -0500
>  > Cc: 75834 <at> debbugs.gnu.org
>  > 
>  > On Sat, Feb 1, 2025 at 9:23 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>  > 
>  >  What exactly is the problem with using normal non-idle timers in both
>  >  these cases?
>  > 
>  > I prefer timers such as these not to run while I'm typing, even slowly, or otherwise navigating.
> 
>  If you type fast enough, they never will.
> 
>  > That's all. As I
>  > said, if saveplace already had a regular timer in place, I'd just have used that even if I prefer idle. I
>  could ask
>  > you the same question. Why you prefer to be interrupted for these kinds of things vs. idleness, even
>  with a
>  > short after-idle interval.
> 
>  I prefer normal timers because their invocation frequency is more
>  reliable than that of idle timers.  And reliability is important when
>  we are talking about features that at least in some cases are intended
>  to save the day if Emacs crashes.
> 
> Let's go with regular timers, then. I'll revise the saveplace patch and we can retire the discussion about
> savehist idle timer. 

Thank you.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 01 Feb 2025 20:10:02 GMT) Full text and rfc822 format available.

Notification sent to Ship Mints <shipmints <at> gmail.com>:
bug acknowledged by developer. (Sat, 01 Feb 2025 20:10:02 GMT) Full text and rfc822 format available.

Message #43 received at 75834-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 75834-done <at> debbugs.gnu.org
Subject: Re: bug#75834: [PATCH] Add missing custom :set to
 savehist-autosave-interval
Date: Sat, 01 Feb 2025 22:09:30 +0200
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 25 Jan 2025 13:19:11 -0500
> 
> * lisp/savehist.el (savehist-autosave-interval):
> Correctly reset 'savehist-timer' when savehist-autosave-interval changes
> via setopt or a Customize command.

Thanks, installed on the master branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Mar 2025 12:24:18 GMT) Full text and rfc822 format available.

This bug report was last modified 107 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.