It's terribly inefficient for emacs vi emulation mode to actually quit emacs when you type ":q", because it takes much longer for emacs to start up than vi, and people use a long-running emacs a lot differently than they use disposable vi's.

UniPress[1] Emacs's vi emulation mode would actually flip you over to an emacs shell buffer when you typed :q, and the shell would recognize when you typed "vi foo.c" and flip back over to a vi emulator buffer instead of actually running vi, but INSTANTLY, since changing buffers in a running emacs was much faster than actually starting up a new vi process.

So die-hard vi users didn't have to re-learn their muscle memory, and could just stay in the same emacs all the time, while the same old emacs alternately flipped between pretending to be a shell, and pretending to be vi.

[1] "Evil Software Hoarder Emacs": https://news.ycombinator.com/item?id=26113192

I use emacs --daemon with emacsclient for this. I always have a running emacs instance, and connect with the client. Opening and quitting a client is near instant.

Yup. I've aliased it to e and and it works just fine. Sort of "send file into Emacs". I've also added some elisp to say things like e something.c:43 so that it opens it up at line 43.

I used have a ep which I could pipe something into and it would put it in Emacs buffer but that stopped working somewhere I never got around to fixing it.

I used emacs for about 16 years, but never properly gotten into client-daemon setup. What’s your setup? Does the daemon preserve open buffers and stuff, so when you connect you have all your openned stuff? Or each emacs sessions have separate set of buffers and windows?

> Does the daemon preserve open buffers and stuff, so when you connect you have all your openned stuff?

Yes. I use it instead of tmux for that.