From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stuart D. Herring" Newsgroups: gmane.emacs.devel Subject: Re: A few questions about desktop.el Date: Thu, 4 May 2006 09:17:30 -0700 (PDT) Message-ID: <36950.128.165.123.132.1146759450.squirrel@webmail.lanl.gov> References: <58643.128.165.123.132.1146179153.squirrel@webmail.lanl.gov> <877j55gb6p.fsf@jurta.org> Reply-To: herring@lanl.gov NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1146759507 16888 80.91.229.2 (4 May 2006 16:18:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 May 2006 16:18:27 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 04 18:18:24 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FbgWg-0007zg-W6 for ged-emacs-devel@m.gmane.org; Thu, 04 May 2006 18:18:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbgWg-0002YZ-CW for ged-emacs-devel@m.gmane.org; Thu, 04 May 2006 12:18:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FbgWH-0002RT-Ji for emacs-devel@gnu.org; Thu, 04 May 2006 12:17:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FbgWG-0002R0-FL for emacs-devel@gnu.org; Thu, 04 May 2006 12:17:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbgWG-0002Qr-94 for emacs-devel@gnu.org; Thu, 04 May 2006 12:17:36 -0400 Original-Received: from [192.65.95.54] (helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FbgWt-0001wC-ND for emacs-devel@gnu.org; Thu, 04 May 2006 12:18:16 -0400 Original-Received: from mailrelay3.lanl.gov (mailrelay3.lanl.gov [128.165.4.104]) by mailwasher-b.lanl.gov (8.12.11.20060308/8.12.11/(ccn-5)) with ESMTP id k44GHVVT003674 for ; Thu, 4 May 2006 10:17:32 -0600 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay3.lanl.gov (8.12.11.20060308/8.12.11/(ccn-5)) with ESMTP id k44GHUhM023678; Thu, 4 May 2006 10:17:30 -0600 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id k44GHUZI007985; Thu, 4 May 2006 10:17:30 -0600 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id k44GHUfI007983; Thu, 4 May 2006 09:17:30 -0700 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.132 (SquirrelMail authenticated user 196434); by webmail.lanl.gov with HTTP; Thu, 4 May 2006 09:17:30 -0700 (PDT) In-Reply-To: <877j55gb6p.fsf@jurta.org> Original-To: "Juri Linkov" User-Agent: SquirrelMail/1.4.3a-11.EL3 X-Mailer: SquirrelMail/1.4.3a-11.EL3 X-Priority: 3 (Normal) Importance: Normal X-PMX-Version: 4.7.1.128075 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:53914 Archived-At: >> Can you use a different file name for the "in use" marker? > > Wouldn't it be better to use Emacs standard file locking mechanism, > i.e. after reading a desktop file to mark the desktop file's buffer > as modified? This ensures that trying to save the desktop in another > Emacs session will raise a question about stealing/leaving the lock. The desktop file is never in a buffer in the current scheme. `load' is called on the file, and then a new desktop is prepared in a file-less buffer "*desktop*" which is then `write-region'ed to the desktop file. `write-region' supports locking (even for file-less buffers), but `load' does not. Obviously one could actually find the desktop file, lock it, and then `eval-buffer' or so. I just want it understood that it's not compatible with the current architecture. > Another simpler solution (without touching the desktop file's buffer) is > to remember the desktop file's timestamp after reading it, and before > saving it compare it with the old timestamp, and ask the question about > whether to override it or not. My patch does this, among other things. The question arises, though, of what to do when the desktop is being saved to a different file; the desktop model does not involve "loading" and "saving" a desktop _file_ which is conceptually central and always-current, but rather "storing" and "reloading" a desktop (session data), using the file only as a persistence mechanism. So the statement "your desktop file has been modified since you read it" is somewhat wrongheaded, since during any Emacs session (or some subsession using a particular desktop; there is a function `desktop-change-dir') there is, conceptually, no "desktop file", just the actual desktop. My patch attempts to say meaningful things when loading from an in-use A and saving to a modified B, but the heuristics might be improvable. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.