News for hackers. Stuff that matters.
Re:Using Emacs as $Editor by globular-toast on Monday October 02, 2023 @09:19AM (#37737688)
I like to use `emacsclient -t` as my $EDITOR (actually I have this in a small wrapper script in ~/bin/editor) so it runs a terminal-based frame rather than opening a new GUI frame. Also, setting alternate editor helps which will just run emacs if an emacs server isn't already running.

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.

Re:Using Emacs as $Editor by gray_-_wolf on Monday October 02, 2023 @10:34AM (#37738679)
`(require 'server) (or (server-running-p) (server-mode))` :)
Re:Using Emacs as $Editor by Scarbutt on Monday October 02, 2023 @02:32PM (#37742442)
What's the difference between daemon and server-mode?
Re:Using Emacs as $Editor by a_e_k on Monday October 02, 2023 @04:11PM (#37743778)
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.