emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error in server-running-p on M$


From: Juanma Barranquero
Subject: Re: error in server-running-p on M$
Date: Wed, 10 Dec 2008 13:59:13 +0100

On Tue, Dec 9, 2008 at 21:46, Stefan Monnier <address@hidden> wrote:

> As Ulrich points out, we should make sure that we can always somehow
> start a server.

OK, but how do you want to do this? Another argument to server-start?
A configuration variable? What about interactive use?

> [...] E.g. it could
> return t, nil, or `not-sure'.
> [...]
> Finally, for the purpose of server-start, we don't necessarily care if
> there is a server named "foo" running on some other machine, so maybe in
> the server-use-tcp case, if the IP is not 127.0.0.1, server-running-p
> might return a special value like `remote' and server-start might treat
> it like "not running" (i.e. it will remove the server-file).

So you're saying:

 t -> the server file cannot be deleted; there's a running server
 nil -> the server file can be deleted; there's no running server
 remote -> the server file can be deleted; ignore any possible remote TCP server
 not-sure -> ????

This is getting confusing, so let's sort the cases:

 1) local socket, client process works => sure, server -> t
 2) local socket, client process fails => sure, no server -> nil
 3) TCP sockets, no server file => sure, no server -> nil
 4) TCP sockets, not 127.0.0.1 => not sure -> remote
 5) TCP sockets, 127.0.0.1, no process with PID => not sure (could be
shared dir) -> not-sure
 6) TCP sockets, 127.0.0.1, process PID, no "emacs" -> not sure (like
above) -> not-sure
 7) TCP sockets, 127.0.0.1, process PID, "emacs" -> sure (sort of) -> t

Now the `t' cases are clear and safe (don't delete the server file),
and the `nil' ones are too (delete the file, if exists).

You're suggesting that 4 should return `remote' and be treated like
`nil' (delete). But 5 and 6 could also be remote, and they must also
be treated like `nil' (delete), or they won't be useful at all. So,
there's no real distinction between `remote' and `not-sure', and
`remote' does not even carry useful information (we could return
not-sure for some remote servers).

Now, to be really safe, 5) should be not-sure, but delete, and 6)
should be not-sure, and don't delete (because Emacs could be running
with another name).

Thoughts?

    Juanma




reply via email to

[Prev in Thread] Current Thread [Next in Thread]