I'd like to use emacsclient to edit emails in Mutt.
I added this in .emacs
(server-start)
And in .muttrc I added
set editor="emacsclient -nw %s"
It seems they work. When I start a second Emacs, it complains there is already a server running so it issues errors. How to make sure to do (server-start)
only if the server isn't already started?
Thanks
In emacs check the value of server-socket-dir . Check if there are some files in this directory. If does, then the server is running.
The simplest way to use the emacsclient program is to run the shell command ' emacsclient file ', where file is a file name. This connects to an Emacs server, and tells that Emacs process to visit file in one of its existing frames—either a graphical frame, or one in a text terminal (see Frames and Graphical Displays).
This code starts the server only if it's not running:
(load "server") (unless (server-running-p) (server-start))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With