1

Suppose I already opened a emacs but its in the background. So, is there an emacsclient eval option that I can type in the shell like:

emacsclient --eval "(bring-existing-emacs-window-to-front)"

To bring the background emacs window to the front?

This can be pretty handy, since I'm always using emacsclient -c --eval "(find-file \"afile\")". Which unfortunately opens the frame in the background instead of front.

2

You can use select-frame-set-input-focus to give focus to a given frame:

emacsclient --eval '(progn
                      (find-file "file.txt")
                      (select-frame-set-input-focus (selected-frame)))'

But, if you only want to open a file, don't use --eval:

emacsclient -c file.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.