From: Lars Ingebrigtsen Date: Tue, 24 Nov 2020 05:41:03 +0000 (+0100) Subject: Delete the emacs-server directory upon Emacs exit X-Git-Tag: emacs-28.0.90~5051 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3802f9ce3d5ff72fc73406528c90bd6e265231ab;p=emacs.git Delete the emacs-server directory upon Emacs exit * lisp/server.el (server-start): Delete the server directory upon Emacs exit (bug#44644). This fixes the problem of /tmp/emacs0 directories being left behind when running an Emacs server as root. --- diff --git a/lisp/server.el b/lisp/server.el index 763f651fefc..1219b021224 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -648,7 +648,12 @@ the `server-process' variable." ;; Remove any leftover socket or authentication file. (ignore-errors (let (delete-by-moving-to-trash) - (delete-file server-file))) + (delete-file server-file) + ;; Also delete the directory that the server file was + ;; created in. There may be other servers running, + ;; too, so this may fail. + (ignore-errors + (delete-directory (file-name-directory server-file))))) (setq server-mode nil) ;; already set by the minor mode code (display-warning 'server