Commit c1148e39 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

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

Instead, delete the names emacsserver really uses
if compiled with SERVER_HOME_DIR.
parent cd891e68
...@@ -147,20 +147,26 @@ Prefix arg means just kill any existing server communications subprocess." ...@@ -147,20 +147,26 @@ Prefix arg means just kill any existing server communications subprocess."
(progn (progn
(set-process-sentinel server-process nil) (set-process-sentinel server-process nil)
(condition-case () (delete-process server-process) (error 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)) (let* ((sysname (system-name))
(dot-index (string-match "\\." sysname))) (dot-index (string-match "\\." sysname)))
(condition-case ()
(delete-file (format "~/.emacs-server-%s" sysname))
(error nil))
(condition-case () (condition-case ()
(delete-file (format "/tmp/esrv%d-%s" (user-uid) sysname)) (delete-file (format "/tmp/esrv%d-%s" (user-uid) sysname))
(error nil)) (error nil))
;; In case the server file name was made with a domainless hostname, ;; In case the server file name was made with a domainless hostname,
;; try deleting that name too. ;; try deleting that name too.
(if dot-index (if dot-index
(condition-case () (let ((shortname (substring sysname 0 dot-index)))
(delete-file (format "/tmp/esrv%d-%s" (user-uid) (condition-case ()
(substring sysname 0 dot-index))) (delete-file (format "~/.emacs-server-%s" shortname))
(error nil)))) (error nil))
;; If we already had a server, clear out associated status. (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 (while server-clients
(let ((buffer (nth 1 (car server-clients)))) (let ((buffer (nth 1 (car server-clients))))
(server-buffer-done buffer))) (server-buffer-done buffer)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment