When emacsclient
is invoked with the option -c
it creates a new frame.
In both Windows and Linux, this frame is a window at the top of the Z-stack and has input focus.
With option -n
(non-blocking) the command window in which emacsclient
is invoked regains this position but the new Emacs frame only takes one step down the Z-order.
I can put the focus back on the Emacs frame just by closing the command window.
Is there any way to get this behavior with an existing frame, i.e. without -c
?
The focus question has been asked many times without being clear about whether a new or existing frame is involved. The generally accepted answers seem to revolve around the elisp functions select-frame-set-input-focus
and server-raise-frame
. I find that these do nothing with existing frame (no -c
) and are not needed otherwise.
I'm wondering if a viable but ugly solution would be to always invoke emacsclient
with -c
and in the command line eval
an expression that detects the previous frame and deletes it but I don't know how to do this.
Windows 10 and 7; emacsclient
version 26.1
Linux Ubuntu-Mate version 18.04; emacsclient
version 25.2