From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Hansen Newsgroups: gmane.emacs.devel Subject: Re: A few questions about desktop.el Date: Wed, 03 May 2006 16:37:37 +0200 Message-ID: <4458C031.5060201@soem.dk> References: <58643.128.165.123.132.1146179153.squirrel@webmail.lanl.gov> <877j55gb6p.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1146667125 11490 80.91.229.2 (3 May 2006 14:38:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 May 2006 14:38:45 +0000 (UTC) Cc: lekktu@gmail.com, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 03 16:38:41 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 1FbIUf-0004Sn-Uw for ged-emacs-devel@m.gmane.org; Wed, 03 May 2006 16:38:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbIUf-0006JL-AT for ged-emacs-devel@m.gmane.org; Wed, 03 May 2006 10:38:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FbIUV-0006It-1z for emacs-devel@gnu.org; Wed, 03 May 2006 10:38:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FbIUT-0006Ib-7e for emacs-devel@gnu.org; Wed, 03 May 2006 10:38:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbIUT-0006IY-56 for emacs-devel@gnu.org; Wed, 03 May 2006 10:38:09 -0400 Original-Received: from [212.99.225.245] (helo=odin.broadcom.dk) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FbIUX-0004DB-6A; Wed, 03 May 2006 10:38:13 -0400 Original-Received: from pppoe3-ves.broadcom.dk ([212.99.255.42] helo=[10.17.0.131]) by odin.broadcom.dk with esmtp (Exim 4.24; FreeBSD) id 1FbITH-00070X-Ih; Wed, 03 May 2006 16:36:55 +0200 User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en Original-To: Juri Linkov In-Reply-To: <877j55gb6p.fsf@jurta.org> 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:53851 Archived-At: Juri Linkov wrote: >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. > > I like the idea of using the standard locking mechanism, but I don't like to mark an unmodified buffer as modified. I think the desktop file should be locked as soon as we know it is going to be changed when Emacs exits, i.e. when desktop-save-mode is turned on. And if desktop-save-mode is turned off, the desktop file should be unlocked if its buffer is unmodified. So maybe lock-buffer should have an optional parameter LOCK-UNMODIFIED to make it usable in such cases (I take it this is an after-the-release discussion.) I guess the same type of problem exists for .recentf, .emacs-places, .emacs-history and maybe other files. The problem should be handled in the same way for all these files. >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. > > This is pleasingly simple, but then the question would be asked when Emacs is exited rather than when it is started. IMHO, the question should be asked as soon as the problem is detected, i.e. when the second Emacs is started (if desktop-save-mode is turned on).