1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(server-start): Don't delete ~/.emacs-server.

Instead, delete the names emacsserver really uses
if compiled with SERVER_HOME_DIR.
This commit is contained in:
Richard M. Stallman 1996-12-30 20:40:27 +00:00
parent cd891e6848
commit c1148e39cc

View file

@ -147,20 +147,26 @@ Prefix arg means just kill any existing server communications subprocess."
(progn
(set-process-sentinel server-process nil)
(condition-case () (delete-process server-process) (error nil))))
(condition-case () (delete-file "~/.emacs_server") (error nil))
;; Delete the socket files made by previous server invocations.
(let* ((sysname (system-name))
(dot-index (string-match "\\." sysname)))
(condition-case ()
(delete-file (format "~/.emacs-server-%s" sysname))
(error nil))
(condition-case ()
(delete-file (format "/tmp/esrv%d-%s" (user-uid) sysname))
(error nil))
;; In case the server file name was made with a domainless hostname,
;; try deleting that name too.
(if dot-index
(condition-case ()
(delete-file (format "/tmp/esrv%d-%s" (user-uid)
(substring sysname 0 dot-index)))
(error nil))))
;; If we already had a server, clear out associated status.
(let ((shortname (substring sysname 0 dot-index)))
(condition-case ()
(delete-file (format "~/.emacs-server-%s" shortname))
(error nil))
(condition-case ()
(delete-file (format "/tmp/esrv%d-%s" (user-uid) shortname))
(error nil)))))
;; If this Emacs already had a server, clear out associated status.
(while server-clients
(let ((buffer (nth 1 (car server-clients))))
(server-buffer-done buffer)))