Re:Using Emacs as $Editor
by gray_-_wolf on Monday October 02, 2023 @10:34AM
(#37738679)
`(require 'server) (or (server-running-p) (server-mode))` :)
What's the difference between daemon and server-mode?
IIRC, daemon mode is a headless instance of the Emacs that the clients can connect to. Server-mode is just a standard, headful, user-session instance of Emacs that can also accept clients.
Re:Using Emacs as $Editor
by globular-toast on Monday October 02, 2023 @04:13PM
(#37743795)
Daemon runs without a UI at all and can only be used with emacsclient. server-mode is used with a normal/non-daemon instance so emacsclients can connect to it. Combined with the --alternative option you can then run emacsclient without really thinking about it. The first one will start a full emacs instance and enable the server, subsequent ones will just connect to that server.
I run emacs as a daemon, but it doesn't have to be. You can also run `(server-mode)` from any emacs process. A nice snippet for the init.el is: `(or (server-running-p) (server-mode))` which works whether you run the daemon or not.