-
-
Save tctony/f31cf7e8078654690445c1002fa40a26 to your computer and use it in GitHub Desktop.
Write pidfile on emacs-server startup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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