From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r116304: * lisp/desktop.el (desktop-read): Claim the lock when the owner is not the current process. Date: Sat, 08 Feb 2014 12:52:29 +0200 Message-ID: <83ob2hx4eq.fsf@gnu.org> References: <83eh3eyjvs.fsf@gnu.org> <87iosqsntr.fsf@mail.jurta.org> <838utmxcre.fsf@gnu.org> <871tzdq5er.fsf@mail.jurta.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1391856792 10516 80.91.229.3 (8 Feb 2014 10:53:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Feb 2014 10:53:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 08 11:53:19 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WC5XB-0001Xg-91 for ged-emacs-devel@m.gmane.org; Sat, 08 Feb 2014 11:53:17 +0100 Original-Received: from localhost ([::1]:46080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC5XA-0004ak-UK for ged-emacs-devel@m.gmane.org; Sat, 08 Feb 2014 05:53:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC5Wt-0004Fx-6V for emacs-devel@gnu.org; Sat, 08 Feb 2014 05:53:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WC5Wm-0001Hg-GL for emacs-devel@gnu.org; Sat, 08 Feb 2014 05:52:59 -0500 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:33462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC5Wm-0001HP-8Q for emacs-devel@gnu.org; Sat, 08 Feb 2014 05:52:52 -0500 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N0O00E00BLDB200@mtaout28.012.net.il> for emacs-devel@gnu.org; Sat, 08 Feb 2014 12:53:58 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N0O0082FBLY5H60@mtaout28.012.net.il>; Sat, 08 Feb 2014 12:53:58 +0200 (IST) In-reply-to: <871tzdq5er.fsf@mail.jurta.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169489 Archived-At: > From: Juri Linkov > Cc: emacs-devel@gnu.org > Date: Sat, 08 Feb 2014 12:14:44 +0200 > > >> The one that comes last wins. The last session will do auto-saving, > >> the previous won't. At least, there should be no conflict of both sessions > >> trying to auto-save to the same file, because auto-saving checks the ownership. > >> The conflict might occur when during exiting both sessions will try writing > >> to the same file. I see nothing in `desktop-kill' that would prevent saving > >> to a non-locked desktop, except the question "Save desktop?" > > > > That's not what I see today, I think. When I need to test something > > in a fresh session, I sometimes by mistake invoke "emacs" instead of > > "emacs -Q", which reads my ~/.emacs and activates desktop saving. The > > main Emacs session is alive, of course. Then, when I exit, I'm asked > > whether to save desktop and given the opportunity to say NO, > > When you invoke "emacs" instead of "emacs -Q" by mistake, > it warns you about the mistake by asking > > "Warning: desktop file appears to be in use by PID %s. > Using it may cause conflicts. Use it anyway? " Not if I load from a different desktop file. > > because I certainly don't want my main desktop file to be overwritten > > by this mistaken session. I'm not sure this change doesn't eliminate > > this useful capability. > > Even when you answer YES, and a new session will auto-save the desktop, > you still can save the final version of the desktop from the first session > if you exit it later than the auto-saving session, so it will overwrite > the desktop from the latest exited session. Isn't it safer to see of the PID that locked the desktop file still runs, and if so, ask for permission?