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: [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 21:32:23 +0200 Organization: JURTA Message-ID: <87mwi1l7sf.fsf@mail.jurta.org> References: <83eh3eyjvs.fsf@gnu.org> <87iosqsntr.fsf@mail.jurta.org> <87a9e1q5h5.fsf@mail.jurta.org> <87bnyhops2.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391888064 9655 80.91.229.3 (8 Feb 2014 19:34:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Feb 2014 19:34:24 +0000 (UTC) Cc: Eli Zaretskii , Emacs developers To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 08 20:34:31 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 1WCDfY-00015d-Eu for ged-emacs-devel@m.gmane.org; Sat, 08 Feb 2014 20:34:28 +0100 Original-Received: from localhost ([::1]:47761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCDfY-0006Yc-3c for ged-emacs-devel@m.gmane.org; Sat, 08 Feb 2014 14:34:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCDfP-0006YV-E6 for emacs-devel@gnu.org; Sat, 08 Feb 2014 14:34:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCDfJ-0003zm-Fe for emacs-devel@gnu.org; Sat, 08 Feb 2014 14:34:19 -0500 Original-Received: from [69.163.184.122] (port=42210 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCDfD-0003z6-5L; Sat, 08 Feb 2014 14:34:07 -0500 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.184.122]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6B1EC300B55115; Sat, 8 Feb 2014 11:34:05 -0800 (PST) In-Reply-To: (Juanma Barranquero's message of "Sat, 8 Feb 2014 11:42:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 69.163.184.122 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:169496 Archived-At: >> Maybe we need a separate question in addition to the existing question >> >> 1. "Warning: desktop file appears to be in use by PID %s. >> Using it may cause conflicts. Use it anyway? " >> >> something like >> >> 2. "Claim the lock from PID %s to take the ownership of the desktop file? " > > Something like that, but it needs to be possible to configure it to > not ask/not claim, if that's what the user wants. Then instead of asking a question we could add two new values to `desktop-load-locked-desktop' ask-and-lock -- ask the user and lock the desktop. load-and-lock -- load and lock anyway. with the default to `ask-and-lock'. Whereas the existing t -- load anyway. ask -- ask the user. will load without locking. > As an example, in my .emacs, I set desktop-load-locked-desktop to nil, > and then I add code to desktop-not-loaded-hook that only steals the > lock if the PID of the old lock does not match a running Emacs > instance; if the old Emacs is still running I only throw a warning. I guess your code to detect a running Emacs instance is not too reliable to include to desktop.el?