How to get focus for a new Emacs frame when it was raised from outside Emacs (e.g. from emacsclient or edit-server )? Currently, the new frame receives input focus, but does not display focus, i.e. You enter text, but it is located somewhere behind other windows (in Windows terminology). There was a similar question , and it was marked as an answer, but without a solution.
emacsclient
edit-server
Emacs 23.3.
The raise-frame function can bring the frame to the fore.
raise-frame
What version of Emacs are you using? I used put in gnuserv-visit-hook:
(select-frame-set-input-focus (window-frame (selected-window)))
But with Emacs 23 it is by default controlled by server-raise-frame .
server-raise-frame
See also the select-frame-set-input-focus function:
select-frame-set-input-focus
"Select FRAME, raise it and set the input focus, if possible."