Google Grupper støtter ikke lenger nye Usenet-innlegg eller -abonnementer. Historisk innhold er fortsatt synlig.

server-running-p: not detect server running by other emacs instance

Sett 6 ganger
Hopp til første uleste melding

Liang Wang

ulest,
5. apr. 2008, 08:29:5205.04.2008
til
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?

Stefan Monnier

ulest,
5. apr. 2008, 13:55:5405.04.2008
til Liang Wang, bug-gn...@gnu.org
> 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.

If I understand correctly, you're reporting a bug that server-running-p
doesn't work if you haven't called server-start before. I believe I've
just fixed it in the trunk,


Stefan


Liang Wang

ulest,
5. apr. 2008, 22:58:5105.04.2008
til

Thanks. I didn't check latest version carefully.

0 nye meldinger