[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
server-running-p: not detect server running by other emacs instance
From: |
Liang Wang |
Subject: |
server-running-p: not detect server running by other emacs instance |
Date: |
Sat, 5 Apr 2008 05:29:52 -0700 (PDT) |
User-agent: |
G2/1.0 |
I modify server-running-p in server.el to make it to detect server
running by other emacs instance. With this modification, server
started by first emacs instance won't be killed by successive
instances.
(unless (server-running-p)
(server-start))
I replace server-socket-dir with (or server-socket-dir (format "/tmp/
emacs%d" (user-uid))) since server-socket-dir only set by server-
start. Here is whole function.
(defun server-running-p (&optional name)
"Test whether server NAME is running."
(interactive
(list (if current-prefix-arg
(read-string "Server name: " nil nil server-name))))
(unless name (setq name server-name))
(condition-case nil
(progn
(delete-process
(make-network-process
:name "server-client-test" :family 'local :server nil :noquery t
:service (expand-file-name name (or server-socket-dir
(format "/tmp/emacs%d"
(user-uid))))))
t)
(file-error nil)))
Does this make sense to be a patch to emacs?
- server-running-p: not detect server running by other emacs instance,
Liang Wang <=