From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30421: 25.3; desktop.el: Steal lock when no living "emacs" process owns it Date: Fri, 16 Feb 2018 10:11:06 +0200 Message-ID: <83po55e4md.fsf@gnu.org> References: <871shram2i.fsf@gmail.com> <83mv0f1q6t.fsf@gnu.org> <87r2prpl05.fsf@gmail.com> <87zi4fa4ft.fsf@users.sourceforge.net> <838tbz1o8k.fsf@gnu.org> <87mv0f5urq.fsf@gmail.com> <837erj1m46.fsf@gnu.org> <87k1vj5tju.fsf@gmail.com> <834lmn1k5h.fsf@gnu.org> <876073e5d9.fsf@gmail.com> <83wozjz79c.fsf@gnu.org> <87bmgv2vvk.fsf@gmail.com> <87o9kpn9pq.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1518768631 23290 195.159.176.226 (16 Feb 2018 08:10:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Feb 2018 08:10:31 +0000 (UTC) Cc: 30421@debbugs.gnu.org, npostavs@users.sourceforge.net To: Pierre Neidhardt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 16 09:10:27 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emb5t-0004ju-R3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Feb 2018 09:10:09 +0100 Original-Received: from localhost ([::1]:49589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emb7v-0005rZ-KE for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Feb 2018 03:12:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emb7n-0005qf-10 for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2018 03:12:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emb7i-0000r2-2Q for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2018 03:12:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37679) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emb7h-0000qr-Uv for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2018 03:12:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1emb7h-00046K-Nf for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2018 03:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Feb 2018 08:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30421 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30421-submit@debbugs.gnu.org id=B30421.151876867915708 (code B ref 30421); Fri, 16 Feb 2018 08:12:01 +0000 Original-Received: (at 30421) by debbugs.gnu.org; 16 Feb 2018 08:11:19 +0000 Original-Received: from localhost ([127.0.0.1]:45576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emb71-00045H-Hj for submit@debbugs.gnu.org; Fri, 16 Feb 2018 03:11:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emb70-000451-0h for 30421@debbugs.gnu.org; Fri, 16 Feb 2018 03:11:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emb6p-0000Ph-RX for 30421@debbugs.gnu.org; Fri, 16 Feb 2018 03:11:12 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emb6p-0000PX-Nc; Fri, 16 Feb 2018 03:11:07 -0500 Original-Received: from [176.228.60.248] (port=1656 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1emb6p-0000Cs-1v; Fri, 16 Feb 2018 03:11:07 -0500 In-reply-to: <87o9kpn9pq.fsf@gmail.com> (message from Pierre Neidhardt on Thu, 15 Feb 2018 23:56:17 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143336 Archived-At: > From: Pierre Neidhardt > Cc: npostavs@users.sourceforge.net, 30421@debbugs.gnu.org > Date: Thu, 15 Feb 2018 23:56:17 +0100 > > if (and owner > (memq desktop-load-locked-desktop '(nil ask)) > (or (null desktop-load-locked-desktop) > (daemonp) > (not (y-or-n-p (format "Warning: desktop file appears to be in use by PID %s.\n\ Using it may cause conflicts. Use it anyway? " owner))))) > > `(deamonp)` will still be true... > > I could set `desktop-load-locked-desktop' to `t' > but then I'm assuming I'll always be the only desktop-mode client on > this machine... I don't like that. > > What about changing `(daemonp)' to some predicate checking if there is a > frame conencted? Something like that, but: . it has to be _in_addition_to_ daemonp check, i.e. the predicate should only be called in a daemon session . it should test for an existence of a client frames, not just _any_ frames, because, perhaps surprisingly, a daemon session does have a frame, it just isn't displayed (and is not a GUI frame) Patches to that effect are welcome. Thanks.