(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?
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
Thanks. I didn't check latest version carefully.