From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: desktop.el: autosave? Date: Fri, 07 Dec 2007 01:29:29 +0200 Organization: JURTA Message-ID: <87hciv78aj.fsf@jurta.org> References: <8763zjfe0v.fsf@jurta.org> <87mysridxt.fsf@jurta.org> <47550419.2080503@gmx.at> <47566942.9090208@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196984419 16783 80.91.229.12 (6 Dec 2007 23:40:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2007 23:40:19 +0000 (UTC) Cc: martin rudalics , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 07 00:40:27 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 1J0QKR-0006ud-8k for ged-emacs-devel@m.gmane.org; Fri, 07 Dec 2007 00:40:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0QKA-0004tH-3S for ged-emacs-devel@m.gmane.org; Thu, 06 Dec 2007 18:40:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J0QJc-0004VI-T3 for emacs-devel@gnu.org; Thu, 06 Dec 2007 18:39:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J0QJb-0004UC-6h for emacs-devel@gnu.org; Thu, 06 Dec 2007 18:39:36 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0QJa-0004U6-Q4 for emacs-devel@gnu.org; Thu, 06 Dec 2007 18:39:34 -0500 Original-Received: from relay03.kiev.sovam.com ([62.64.120.201]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J0QJT-0004q4-QZ; Thu, 06 Dec 2007 18:39:28 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1J0QJD-0005kW-JD; Fri, 07 Dec 2007 01:39:25 +0200 In-Reply-To: (Richard Stallman's message of "Wed, 05 Dec 2007 21:11:56 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-Scanner-Signature: 0a21689c2f1d2e94d8aa83f1a1b60733 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 1860 [Dec 06 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 19 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) 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:84815 Archived-At: > It occurred to me because Juri wanted to auto-save the desktop only > every hour. Hence, I'd first wait for an hour and then until Emacs > has become idle for at least five minutes. > > One cannot argue with tastes, but one drawback is that if he never > takes a 5-minute break, it will never auto-save the desktop. Martin's idea would work if the idle timer's timeout is proportional to the time required to save the desktop (a few seconds). So the algorithm would be the following: at large intervals (tens of minutes) a non-idle timer will start an idle timer to wait for appropriate time within the next few seconds of idle time. The reason is that when saving the desktop requires e.g. 1 sec then after 5 sec of idle time it is likely that it finishes saving before the user notices the delay caused by saving. > That's why I suggest auto-saving whenever Emacs is idle for N minutes > _or_ H hours have elapsed since the last save. If you take breaks > often enough, it will save in the breaks and only in the breaks. > But if you don't take breaks, it will eventually save anyway. If the idea above is not acceptable then having two separate timers with separately configured timeouts is not bad, because when necessary the user can disable one of the two timers. -- Juri Linkov http://www.jurta.org/emacs/