From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reuben Thomas Newsgroups: gmane.emacs.devel Subject: Re: desktop.el: autosave? Date: Sun, 9 Dec 2007 20:35:57 +0000 (GMT) Message-ID: References: <8763zjfe0v.fsf@jurta.org> <87mysridxt.fsf@jurta.org> <20071206153806.GA20731@www.trapp.net> <87d4tjbh0g.fsf@jurta.org> <87abon5q1f.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1197232584 4597 80.91.229.12 (9 Dec 2007 20:36:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2007 20:36:24 +0000 (UTC) Cc: tomas@tuxteam.de, rms@gnu.org, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 09 21:36:33 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J1St5-000760-Tj for ged-emacs-devel@m.gmane.org; Sun, 09 Dec 2007 21:36:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1Sso-0007ue-FO for ged-emacs-devel@m.gmane.org; Sun, 09 Dec 2007 15:36:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1Ssj-0007sR-CX for emacs-devel@gnu.org; Sun, 09 Dec 2007 15:36:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1Ssi-0007rJ-8Y for emacs-devel@gnu.org; Sun, 09 Dec 2007 15:36:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1Ssh-0007rB-Vz for emacs-devel@gnu.org; Sun, 09 Dec 2007 15:36:08 -0500 Original-Received: from pelican.sc3d.org ([216.184.201.86]) by monty-python.gnu.org with esmtps (SSL 3.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J1Ssd-0007Y9-7D; Sun, 09 Dec 2007 15:36:03 -0500 DomainKey-Signature: a=rsa-sha1; s=key1024; d=sc3d.org; c=nofws; q=dns; b=wqYykmNAEi14VoyRN2JRFsrrLCaEGWp3FnOXZrRdgoROPgWYqUikFg9DLfM1Gj5nW9gIRRo8JznkN5Rr2WuW2GoQQnCNVl1YD6FOkG4Mudoav4kMHDlFsUhjNLUTj3SYYquk9pEdnVv/k9RoIhwpVqYMZWd/329a4gdM4NYMjhY= Original-Received: from drom (cpc1-popl1-0-0-cust343.popl.cable.ntl.com [81.106.81.88]) by pelican.sc3d.org (pf ESMTP spamd IP-based SPAM blocker) with ASMTP (SSL) id OGT95300; Sun, 09 Dec 2007 15:36:00 -0500 X-X-Sender: rrt@localhost.localdomain In-Reply-To: <87abon5q1f.fsf@jurta.org> User-Agent: Alpine 0.99999 (DEB 796 2007-11-08) X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84928 Archived-At: On Fri, 7 Dec 2007, Juri Linkov wrote: >>> Saving a buffer's file is fast operation comparing to saving the desktop >>> that takes more time because it is a cpu-intensive task that collects >>> information from all buffers and some possibly long lists and writes >>> to the usually large desktop file. The default timeout for auto-save >>> is 30 sec which is ok for auto-saving normal files, but I don't see a >>> need to waste resources to save the desktop so often. >> >> It's easy to argue about this, but numbers are more convincing. I don't >> know anything about instrumenting functions in Emacs; how can I find out >> how long Emacs spends running desktop-save over a particular time period? > > You can evaluate: > > (let ((start (float-time))) (desktop-save desktop-dirname) (- (float-time) start)) After about 30 hours, saving the desktop had accumulated about 50s of time this way. That seems a reasonable amount to me. I have 137 buffers in my session, and my desktop file is about 38,000 bytes long. Hence, I suggest that a simple feature "Auto-save desktop" which adds desktop-save-in-desktop-dir to auto-save-hook, would satisfy most people likely to use this feature. Furthermore those concerned about power usage and disk spin-up only have to worry about the same Emacs feature (auto-save-hook), and not add another hook or function to their list of things to tweak. To ensure that this doesn't make auto-save-hook ask for input interactively, desktop-save-in-desktop-dir should be made only to prompt for the desktop-dir (when it's not set) if it's being run interactively. -- http://rrt.sc3d.org/ | priest, n. an unpaid lawyer (q.v.)