Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Write pidfile on emacs-server startup
(setq pidfile "emacs-server.pid")
(add-hook 'emacs-startup-hook
(lambda ()
(with-temp-file pidfile
(insert (number-to-string (emacs-pid))))))
(add-hook 'kill-emacs-hook
(lambda ()
(when (file-exists-p pidfile)
(delete-file pidfile))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.