Most modern editors don't have a separate <editor>client
binary. Instead, the main binary acts as a client to open a new window/the file given as an argument when possible.
Is there a way to accomplish the same in Emacs? I know about emacsclient
but 1. it's not a drop-in replacement and 2. using it comfortably requires additional setup beyond copying .emacs.d
to a machine -- e.g. adding a desktop file for emacsclient
.
I'm envisioning something like this:
;; Start of init.el
(if (server-running-p)
;; Open given file in existing server
(server-start))
emacsclient
if you've already opened emacs. Do you perhaps just want to open a new frame? If so, you can do so from any existing emacs frame withmake-frame-command
, bound by default toC-x 5 2
.emacsclient
. That's an example of what I want to avoid. I wantemacs
, the main binary, to act as a client to open a new window/the file given as an argument when possible.