bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28945: 25.2; desktop auto save timer does not work


From: Eli Zaretskii
Subject: bug#28945: 25.2; desktop auto save timer does not work
Date: Sun, 22 Oct 2017 20:11:53 +0300

> From: Peter Neidhardt <pe.neidhardt@googlemail.com>
> Date: Sun, 22 Oct 2017 17:19:07 +0100
> 
> Recipe:
> 
> - Add (desktop-save-mode) to your init.el.
> 
> - Start Emacs.  Check the value of `window-configuration-change-hook':
> the _global_ value should contain `desktop-auto-save-set-timer'.
> 
> - Save the desktop.
> 
> - Quit Emacs.
> 
> - Restart Emacs.
> 
> - Check `window-configuration-change-hook': the timer is gone.

Thank you for your report and analysis.  I need to read this
carefully, so for now just one comment about something that you only
touch tangentially:

> The actual logic is as follow:
> 
> - On every window configuration change, the timer is _reset_.
> 
> - When idle for `desktop-auto-save-timeout', the desktop is saved.  The
>   timer is run only _once_.
> 
> In practice, this means that the user actually be idle for 30 seconds or
> else it won't get saved at all.  Does this happen a lot in practice?
> I'm don't think so.  Considering the timer runs only once per window
> conf change, it does not run very often, in particular it runs only once
> when nothing is happening.
> 
> So I think it's wiser to set the default to something much lower, say 5
> or 10.

IME, that would be a mistake.  The problem with your logic is twofold:

  . "window configuration change" is actually something that happens a
    lot in a live Emacs session, because any change in windows layout,
    dimensions, the buffers they display, their values of point,
    etc. -- all of these constitute such a change.

  . saving a desktop in a large multi-frame session is expensive.

What this boils down to is that every automatic desktop-save produces
an annoying "hiccup" in Emacs responsiveness.  This is the main reason
why I disabled the desktop timer long ago, and save the desktop from a
midnight.el hook, once every day.  Yes, this means that I can lose
some of my configuration due to a crash, but (a) Emacs doesn't crash
so frequently, and (b) my sessions are organized in a way that makes
sure the loss is minimal, mainly some files that were visited will
need to be re-visited manually.

So if we are going to discuss the timer, I'd actually recommend making
the interval longer, not shorter, if only because auto-saving desktop
more often than we auto-save our edits (see auto-save-interval) makes
little sense to me.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]