aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-03-11 18:35:20 +0000
committerStefan Monnier2004-03-11 18:35:20 +0000
commit03ae35cfae689723ec828481a1d3e47c45fb53d9 (patch)
tree9f4e84839299cef2179dd7898d06302a5b2160ea
parentd9a4b477b071107dc3b8836cefe107b456e525e0 (diff)
downloademacs-03ae35cfae689723ec828481a1d3e47c45fb53d9.tar.gz
emacs-03ae35cfae689723ec828481a1d3e47c45fb53d9.zip
(server-name): New var.
(server-socket-dir): New var to replace server-socket-name. (server-start): Use them.
-rw-r--r--lisp/server.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/server.el b/lisp/server.el
index a6b2742190f..3a8bede9f95 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -159,8 +159,10 @@ This means that the server should not kill the buffer when you say you
159are done with it in the server.") 159are done with it in the server.")
160(make-variable-buffer-local 'server-existing-buffer) 160(make-variable-buffer-local 'server-existing-buffer)
161 161
162(defvar server-socket-name 162(defvar server-name "server")
163 (format "/tmp/emacs%d/server" (user-uid))) 163
164(defvar server-socket-dir
165 (format "/tmp/emacs%d" (user-uid)))
164 166
165(defun server-log (string &optional client) 167(defun server-log (string &optional client)
166 "If a *server* buffer exists, write STRING to it for logging purposes." 168 "If a *server* buffer exists, write STRING to it for logging purposes."
@@ -246,12 +248,14 @@ Emacs distribution as your standard \"editor\".
246Prefix arg means just kill any existing server communications subprocess." 248Prefix arg means just kill any existing server communications subprocess."
247 (interactive "P") 249 (interactive "P")
248 ;; Make sure there is a safe directory in which to place the socket. 250 ;; Make sure there is a safe directory in which to place the socket.
249 (server-ensure-safe-dir (file-name-directory server-socket-name)) 251 (server-ensure-safe-dir server-socket-dir)
250 ;; kill it dead! 252 ;; kill it dead!
251 (if server-process 253 (if server-process
252 (condition-case () (delete-process server-process) (error nil))) 254 (condition-case () (delete-process server-process) (error nil)))
253 ;; Delete the socket files made by previous server invocations. 255 ;; Delete the socket files made by previous server invocations.
254 (condition-case () (delete-file server-socket-name) (error nil)) 256 (condition-case ()
257 (delete-file (expand-file-name server-name server-socket-dir))
258 (error nil))
255 ;; If this Emacs already had a server, clear out associated status. 259 ;; If this Emacs already had a server, clear out associated status.
256 (while server-clients 260 (while server-clients
257 (let ((buffer (nth 1 (car server-clients)))) 261 (let ((buffer (nth 1 (car server-clients))))
@@ -263,7 +267,7 @@ Prefix arg means just kill any existing server communications subprocess."
263 (setq server-process 267 (setq server-process
264 (make-network-process 268 (make-network-process
265 :name "server" :family 'local :server t :noquery t 269 :name "server" :family 'local :server t :noquery t
266 :service server-socket-name 270 :service (expand-file-name server-name server-socket-dir)
267 :sentinel 'server-sentinel :filter 'server-process-filter 271 :sentinel 'server-sentinel :filter 'server-process-filter
268 ;; We must receive file names without being decoded. 272 ;; We must receive file names without being decoded.
269 ;; Those are decoded by server-process-filter according 273 ;; Those are decoded by server-process-filter according