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:
Make Emacs-Server Write a PID File
2 comments
Comments are closed.
Avdi Grimm, Code Cleric
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:
Comments are closed.
This is what I’ve been using for awhile now.
https://github.com/edavis10/emacs-config/blob/master/desktop.el#L14
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.