Skip to content

Emacs Daemon! Hell Yes!

I’m late to the party, there have been several blog posts on this through the intertubes, but I have to add my w00t!

For those wanting to play with this, It’s only available on the development version, meaning you’ll need to get the source from CVS/SVN/Git repos, (some distros have packages for emacs23 so look around for your repo) and compile, if you need help with this, give me a holler or just checkout emacswiki.

To start the daemon just do:

emacs –daemon

It will detach itself, so all is good. Then on your terminal:

emacsclient -t (if you want to run it inside the terminal)

or

emacsclient -c (To create a frame for Emacs gui)

I have it starting at boot from a init script I made, and it’s working beautifully!

Some of you might be wondering why have an editor run as a daemon, well in the specific case of emacs, it’s really a convenience of having just one instance running, and really now, you don’t need more than one, at least I don’t. There might be other reasons, but to be honest I don’t care, I just love it, and want to say thanks to all the emacs-devel team.

6 Comments

  1. richard

    Do you know how to correctly shut down the daemon?

    Posted on 11-Oct-08 at 10:53 am | Permalink
  2. There is no correct way, at least not yet. What I would recommend, is to do close all your emacs instances, and then do a pkill -TERM emacs.

    In my case I only do this, when updating my emacs to the latest CVS version.

    Hope this helps.

    Posted on 11-Oct-08 at 12:50 pm | Permalink
  3. It seems to be supported in the 22 version too

    Just do alt-x server-start and you can use emacsclient .

    Check:

    http://www.emacswiki.org/cgi-bin/wiki/EmacsClient

    Pretty interesting.

    Posted on 14-Oct-08 at 10:30 am | Permalink
  4. Ricardo, it’s a different thing, yes you can start an emacs server, with M-x server-start, also you can start it from the command line with emacs –eval ’server-start’ or emacs -f ’server-start’, but that will bring up emacs with a frame. The emacs daemon instead is a headless instance of emacs, no frame.

    I truly suggest you give emacs23 a try, it’s quite stable, and you’ll be able to appreciate the difference.

    Posted on 14-Oct-08 at 6:03 pm | Permalink
  5. Eduardo Padoan

    I tried using with Ubuntu’s emacs-snapshot, but when I do ‘emacs -c something’, I get a debugging message saying that there is no tty Fontset.

    Posted on 25-Oct-08 at 1:08 pm | Permalink
  6. Eduardo, I assume you did emacs –daemon and didn’t get any error, if so, the command you are looking for is: emacsclient -c
    not emacs -c.

    Hope that helps.

    Posted on 25-Oct-08 at 5:19 pm | Permalink