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: Thu, 6 Dec 2007 14:56:12 +0000 (GMT) Message-ID: References: <8763zjfe0v.fsf@jurta.org> <87bq97l7vc.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 1196953006 31940 80.91.229.12 (6 Dec 2007 14:56:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2007 14:56:46 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 06 15:56:51 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 1J0I9e-00022q-SO for ged-emacs-devel@m.gmane.org; Thu, 06 Dec 2007 15:56:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0I9O-0006qi-40 for ged-emacs-devel@m.gmane.org; Thu, 06 Dec 2007 09:56:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J0I9K-0006ok-HX for emacs-devel@gnu.org; Thu, 06 Dec 2007 09:56:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J0I9H-0006iv-SI for emacs-devel@gnu.org; Thu, 06 Dec 2007 09:56:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0I9H-0006iT-Io for emacs-devel@gnu.org; Thu, 06 Dec 2007 09:56:23 -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 1J0I9D-0002Dx-US; Thu, 06 Dec 2007 09:56:20 -0500 DomainKey-Signature: a=rsa-sha1; s=key1024; d=sc3d.org; c=nofws; q=dns; b=pzaaKgxrDuFNtOuU9JTzInO+lW2XJBuyNJEyusGHbScfyN67JwoltQQP0XX2K/yB4o6S45RK95wD/6ASksyoJ8m7vqE47nkOZnsDPW1SMpxtS/yJzLej6Cfn6TsPeojWD1QIppwivEHSTATC5GBw6TDU12F5ebPP/pPujWEfCH8= Original-Received: from localhost (cpc4-hitc1-0-0-cust477.lutn.cable.ntl.com [86.11.13.222]) by pelican.sc3d.org (pf ESMTP spamd IP-based SPAM blocker) with ASMTP (SSL) id LAK15615; Thu, 06 Dec 2007 09:56:15 -0500 X-X-Sender: rrt@localhost.localdomain In-Reply-To: <87bq97l7vc.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:84791 Archived-At: On Tue, 4 Dec 2007, Juri Linkov wrote: >>> I use in .emacs: >>> (defun my-desktop-save () >>> (interactive) >>> ;; `desktop-owner' is a new function in Emacs 22.1.50 to check >>> ;; for conflicts between two running Emacs instances. >>> ;; We don't want automatic saving in the second Emacs process. >>> (if (and (fboundp 'desktop-owner) (eq (desktop-owner) (emacs-pid))) >>> (desktop-save "~"))) >> >> Why did you not use desktop-save-in-desktop-dir? > > This was enough for .emacs, but for desktop.el a proper variable > to save the desktop in is surely `desktop-dirname'. Even though > `desktop-save-in-desktop-dir' is a method that does this, I think we > can't use it, because when `desktop-dirname' is nil initially, it asks > in the minibuffer where to save the desktop (by using `call-interactively'), > but this is not a good thing to do in a function called by a timer. > Perhaps it should do nothing when called by a timer and `desktop-dirname' > is nil. Seems sensible, but can't you achieve this result by having the timer call my-desktop-save non-interactively? -- http://rrt.sc3d.org/ | Astrophysics: it's not exactly rocket science