From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28945: 25.2; desktop auto save timer does not work Date: Sun, 22 Oct 2017 20:11:53 +0300 Message-ID: <8360b7ayzq.fsf@gnu.org> References: <87k1znuphh.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1508692398 18516 195.159.176.226 (22 Oct 2017 17:13:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Oct 2017 17:13:18 +0000 (UTC) Cc: 28945@debbugs.gnu.org To: Peter Neidhardt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 22 19:13:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6JoB-0003Mi-O1 for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Oct 2017 19:13:07 +0200 Original-Received: from localhost ([::1]:33679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6JoJ-0004f1-0a for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Oct 2017 13:13:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6Jo9-0004dW-7G for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 13:13:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6Jo5-0003Hf-Up for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 13:13:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6Jo5-0003HW-RL for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 13:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e6Jo5-00042x-K3 for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 13:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2017 17:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28945 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28945-submit@debbugs.gnu.org id=B28945.150869232915493 (code B ref 28945); Sun, 22 Oct 2017 17:13:01 +0000 Original-Received: (at 28945) by debbugs.gnu.org; 22 Oct 2017 17:12:09 +0000 Original-Received: from localhost ([127.0.0.1]:56145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6JnF-00041o-Et for submit@debbugs.gnu.org; Sun, 22 Oct 2017 13:12:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6JnD-00041b-JX for 28945@debbugs.gnu.org; Sun, 22 Oct 2017 13:12:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6Jn4-0002zQ-PU for 28945@debbugs.gnu.org; Sun, 22 Oct 2017 13:12:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6Jn4-0002zE-M9; Sun, 22 Oct 2017 13:11:58 -0400 Original-Received: from [176.228.60.248] (port=1697 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e6Jn4-0000nd-1r; Sun, 22 Oct 2017 13:11:58 -0400 In-reply-to: <87k1znuphh.fsf@gmail.com> (message from Peter Neidhardt on Sun, 22 Oct 2017 17:19:07 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138860 Archived-At: > From: Peter Neidhardt > 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.