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: Sat, 24 Feb 2018 22:09:26 +0200 Message-ID: <83fu5q2lqh.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> <83po55e4md.fsf@gnu.org> <87r2pkilsj.fsf@gmail.com> <83fu60cb82.fsf@gnu.org> <87r2pilesx.fsf@gmail.com> <831shib6e3.fsf@gnu.org> <83k1v24qpl.fsf@gnu.org> <878tbi2mvm.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1519502910 30175 195.159.176.226 (24 Feb 2018 20:08:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 24 Feb 2018 20:08:30 +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 Sat Feb 24 21:08:26 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 1epg7L-0007SE-Pf for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Feb 2018 21:08:23 +0100 Original-Received: from localhost ([::1]:51303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epg9N-0000Wf-Uf for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Feb 2018 15:10:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epg8z-0000IN-Ok for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 15:10:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epg8w-0001B2-Ht for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 15:10:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51145) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1epg8w-0001Al-E6 for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 15:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1epg8w-000540-8J for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 15:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Feb 2018 20:10:02 +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.151950299419446 (code B ref 30421); Sat, 24 Feb 2018 20:10:02 +0000 Original-Received: (at 30421) by debbugs.gnu.org; 24 Feb 2018 20:09:54 +0000 Original-Received: from localhost ([127.0.0.1]:59042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epg8o-00053a-5B for submit@debbugs.gnu.org; Sat, 24 Feb 2018 15:09:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epg8k-00053M-O5 for 30421@debbugs.gnu.org; Sat, 24 Feb 2018 15:09:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epg8c-0000kn-3c for 30421@debbugs.gnu.org; Sat, 24 Feb 2018 15:09:45 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epg8P-0000Zt-1y; Sat, 24 Feb 2018 15:09:29 -0500 Original-Received: from [176.228.60.248] (port=2143 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1epg8O-0001Sf-GR; Sat, 24 Feb 2018 15:09:28 -0500 In-reply-to: <878tbi2mvm.fsf@gmail.com> (message from Pierre Neidhardt on Sat, 24 Feb 2018 20:44:45 +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:143641 Archived-At: > From: Pierre Neidhardt > Cc: 30421@debbugs.gnu.org, npostavs@users.sourceforge.net > Date: Sat, 24 Feb 2018 20:44:45 +0100 > > Correct me if I did not understand your instructions correctly. I did this: > > - Add this to my init.el > > (defun ambrevar/desktop-init () > (desktop-save-mode) > (desktop-read) > (remove-hook 'server-switch-hook 'ambrevar/desktop-init)) > (add-hook 'server-switch-hook 'ambrevar/desktop-init) > > - Kill Emacs, leaving a .emacs.desktop.lock behind. > > - Switch to a TTY. > > - Start `emacs --daemon`. > > - Run `emacsclient foo`. Yes. > I correctly get prompted if I want to load the desktop then. OK, thanks for testing. So like I said, we need a new hook, which would be called when the server creates a frame, but doesn't switch to any new buffers in that frame. > Running `emacsclient -t` does not trigger the desktop loading, but I > guess that's to be expected. Right, because in that case server-switch-hook is not run.