0

If I invoke emacsclient with emacsclient -na runemacs file1 emacsclients switch to the frame containing file1. But if later I invoke emacs with emacsclient -na runemacs file2 emacsclient opens file2 in the existing frame of file1.

On the other hand emacsclient -cna runemacs file1 always creates a new frame regardless of if file1 is already opened or not.

I prefer that emacsclient creates a new frame of a file if that file is not already open in the existing frames, otherwise emacsclient switchs to the frame containing it.

I guess I should send some elisp code by -e option to the emacsclient for checking this but I was not able to find the right code.

There is a related question Make emacsclient create a frame only if there isn't one already without an accepted answer. The upvoted answer there uses a bash script hence not a pure elisp solution.

2
  • Why is it important for it to be pure elisp?
    – Qudit
    Commented Dec 17, 2016 at 18:35
  • One reason can be an elisp solution also works an the platforms where bash is not available.
    – Name
    Commented Dec 17, 2016 at 18:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.