Oddly, emacs-server doesn’t seem to have an option to write a PID file when it starts up. Here’s some ELisp you can drop into your init file to make it happen:

Published by Avdi Grimm

2 Comments

    • I believe most of what that file is doing is automatic these days. I don’t
      find I need conditional server-starting; passing -a “” (-a with an empty
      string) to emacsclient takes care of that.

      In any case, my stuff is for a slightly different case; I have a makefile
      where I want it to restart the edit server if the config file has been
      updated. For that I needed a pidfile to a) tell it what to kill; and b) give
      it a timestamp of when the server was last started to compare against the
      init file.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *