GNU bug report logs -
#30421
25.3; desktop.el: Steal lock when no living "emacs" process owns it
Previous Next
Reported by: Pierre Neidhardt <ambrevar <at> gmail.com>
Date: Sun, 11 Feb 2018 09:55:02 UTC
Severity: wishlist
Found in version 25.3
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #71 received at 30421 <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 24 Feb 2018 22:09:26 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 30421 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
>
> > 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.
Can you see if the patch below gives good results? It should work
both when you invoke emacsclient with one or more file names, or
without any file names. In both cases, the new hook
server-after-make-frame-hook should be invoked, with the new frame
being the selected frame. If you run your code in that new hook, you
should get prompted whether you want to load the desktop, regardless
whether or not you specify files for emacscilent to visit.
diff --git a/lisp/server.el b/lisp/server.el
index a892203..ff03cbe 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -188,6 +188,13 @@ server-switch-hook
:group 'server
:type 'hook)
+(defcustom server-after-make-frame-hook nil
+ "Hook run when the Emacs server creates a client frame.
+The created frame is selected when the hook is called."
+ :group 'server
+ :type 'hook
+ :version "27.1")
+
(defcustom server-done-hook nil
"Hook run when done editing a buffer for the Emacs server."
:group 'server
@@ -1336,9 +1343,11 @@ server-execute
((or isearch-mode (minibufferp))
nil)
((and frame (null buffers))
+ (run-hooks 'server-after-make-frame-hook)
(message "%s" (substitute-command-keys
"When done with this frame, type \\[delete-frame]")))
((not (null buffers))
+ (run-hooks 'server-after-make-frame-hook)
(server-switch-buffer (car buffers) nil (cdr (car files)))
(run-hooks 'server-switch-hook)
(unless nowait
This bug report was last modified 7 years and 150 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.