From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: error in server-running-p on M$ Date: Wed, 10 Dec 2008 13:59:13 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1228914114 22079 80.91.229.12 (10 Dec 2008 13:01:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Dec 2008 13:01:54 +0000 (UTC) Cc: Eli Zaretskii , Ulrich Mueller , emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 10 14:02:58 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LAOiP-0005iL-9D for ged-emacs-devel@m.gmane.org; Wed, 10 Dec 2008 14:02:57 +0100 Original-Received: from localhost ([127.0.0.1]:35236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAOhD-0004Df-Pn for ged-emacs-devel@m.gmane.org; Wed, 10 Dec 2008 08:01:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAOeu-0003ss-4x for emacs-devel@gnu.org; Wed, 10 Dec 2008 07:59:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAOep-0003rx-58 for emacs-devel@gnu.org; Wed, 10 Dec 2008 07:59:17 -0500 Original-Received: from [199.232.76.173] (port=55635 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAOeo-0003rp-Hu for emacs-devel@gnu.org; Wed, 10 Dec 2008 07:59:14 -0500 Original-Received: from an-out-0708.google.com ([209.85.132.250]:26472) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAOeo-0006BZ-4o for emacs-devel@gnu.org; Wed, 10 Dec 2008 07:59:14 -0500 Original-Received: by an-out-0708.google.com with SMTP id c38so207192ana.21 for ; Wed, 10 Dec 2008 04:59:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=DkLgW87s+OKedGx+6QJ6p9MdKG3CrS/0QHg7aESdIhU=; b=hI1VYudUQc+ED/qtBkQaewjSfBqu3fm/4aC5SOO4N4CCl9GoNVd6dEBPIRgDO3Xij6 YB7m+MvQXFqyczX3Bup8CmOtAPNAlvC8GdDsYcjr1BPomL8MH6hRjSwRJR2oblVJahxs tzMCdwSdql9pR5D5v8RbuwWWCVt7rzvTE2LGM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=QzCNmsBE/kNr+WJAeAc0iTL1g1yxWCs32z4yyuqJGSiyiPgOpFyiMkLoiPjY8dC0LZ zmBe633L4M7qWpal8ao/cGZOn6PSaBNJaCfYwYlP47DM6eN8mDf3JR4qESuaDmgBRMHD R6coeyo/wxCkcM3K8rFPlQ/TtH58uP70XmoYo= Original-Received: by 10.100.3.13 with SMTP id 13mr1029211anc.26.1228913953466; Wed, 10 Dec 2008 04:59:13 -0800 (PST) Original-Received: by 10.100.13.13 with HTTP; Wed, 10 Dec 2008 04:59:13 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:106747 Archived-At: On Tue, Dec 9, 2008 at 21:46, Stefan Monnier 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