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: Mon, 10 Dec 2007 22:01:02 +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> <87lk835rb7.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: ger.gmane.org 1197324116 24148 80.91.229.12 (10 Dec 2007 22:01:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Dec 2007 22:01:56 +0000 (UTC) Cc: Juri Linkov , tomas@tuxteam.de, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 10 23:02:03 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 1J1qgv-0005D4-Rt for ged-emacs-devel@m.gmane.org; Mon, 10 Dec 2007 23:01:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1qge-0005We-BM for ged-emacs-devel@m.gmane.org; Mon, 10 Dec 2007 17:01:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1qgb-0005WZ-CN for emacs-devel@gnu.org; Mon, 10 Dec 2007 17:01:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1qgZ-0005WN-WF for emacs-devel@gnu.org; Mon, 10 Dec 2007 17:01:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1qgZ-0005WK-SC for emacs-devel@gnu.org; Mon, 10 Dec 2007 17:01:11 -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 1J1qgW-0002wK-7n; Mon, 10 Dec 2007 17:01:08 -0500 DomainKey-Signature: a=rsa-sha1; s=key1024; d=sc3d.org; c=nofws; q=dns; b=2+5w3heAu2VKvXgG2P67YJYfNLKySGXbEo997NaTQOGyYDe/PHwY6w2ijdi6xYwHfJ4oM0l+5Bee3ExijRI9UE/djILn2TpMJhndhuTBEu/n3kwfTUv/EvZQO21HjR6m+1+do6rrXYAEIOgzE3R8tSOe6uVzYPrqoOde/5Ef03E= 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 PIL60905; Mon, 10 Dec 2007 17:01:05 -0500 X-X-Sender: rrt@localhost.localdomain In-Reply-To: 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:84982 Archived-At: On Sun, 9 Dec 2007, Stefan Monnier wrote: >>> 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. > > BTW, how 'bout optimizing disk writes like savehist does: only save the > new desktop file if it's different from the previous one. That doesn't > save you from generating the new file's content in a buffer, of course, > but still. That sounds like a good idea. I think we can now collect the changes that need to be made: 1. A customizable preference, desktop-auto-save, which indicates whether desktop-save-in-desktop-dir should be added to auto-save-hook or not. Is the easiest way to do this to add a private function that desktop mode always adds to auto-save-hook and then have that private function test a boolean which is itself the customizable preference when it runs, to see whether to proceed or not? 2. Change desktop-save-in-desktop-dir so that it only prompts for a directory if it is called interactively. The normal way seems to be to add an optional argument as described in the help for interactive-p. 3. Change desktop-save-in-desktop-dir to be like savehist-mode, only actually writing the file when the history has changed since the last time. Does that sounds about right? -- http://rrt.sc3d.org/ | Brevity is the soul