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."
(list (if current-prefix-arg
(read-string "Server name: " nil nil server-name))))
(unless name (setq name server-name))
: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))))))
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,
Thanks. I didn't check latest version carefully.