|
|
|
|
|
by rjmorris
1635 days ago
|
|
Thanks for this, I found a few things to investigate adding to my own config. I have a question about the server/client mode: > Experienced Emacs users run a single instance of Emacs and do all their editing activities via this single instance. What's the motivation for running it this way? I think the repo should explain why, especially since it's targeted at newbies. Also because it looks like a lot of effort was put into explaining how and discussing the em script that makes it more convenient. For what it's worth, I'm an experienced Emacs user, and I don't run a single instance. Instead, I start lots of new instances. As best I can tell, the motivating factor for a single instance is startup speed. However, I'm satisfied with my startup speed and haven't felt the need to improve it with server/client mode. |
|
There are a few uses, for me, of daemon mode that have kept me using it.
First, like tmux and mosh, emacs daemon is persistent. Should I accidentally close it but not really intend to close it, everything is still there. Useful if you use emacs for more than just editing (like an IRC client). In that instance, all my buffers are still present and anything that needs ongoing execution will continue to happen.
Second, I never got used to using emacs as my shell. So I drop back to the shell for most of my filesystem navigation and running various CLI tools. With the daemon running in the background, this means I can close the client, navigate or run programs, and reload the client with everything in place or while opening a new file.
Third, I often use multiple daemons, one for each project/language. I use the shell to go to the project root and launch a new (named) daemon. Then when navigating around the project in the shell, I can open a file for editing using the appropriate client incantation. This lets me keep a full emacs daemon running but with only the appropriate buffers and subprograms (useful when dealing with interactive languages like Lisp or Erlang, where I may also have a project-specific REPL running).
Fourth, I use magit and tmux. So I usually split my window into two panes with editing/navigation/CLI activities on the left and magit on the right. The magit instance gets to share the same kill ring and buffers as the editing instances on the left. I know I could do the same by splitting the frame left and right the same way, but this has become my preferred interaction. Plus, since I don't use emacs' shell mode I often further subdivide the panes anyways, like editor in the top left, magit on the right, and shell in the lower left with fswatch running tests continuously.
I suppose that if I just did everything in emacs (including the shell and file system navigation) then it would be less useful. But I don't, so it's very useful.