From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: error in server-running-p on M$ Date: Wed, 10 Dec 2008 13:30:53 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228934892 3140 80.91.229.12 (10 Dec 2008 18:48:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Dec 2008 18:48:12 +0000 (UTC) Cc: Eli Zaretskii , Ulrich Mueller , emacs-devel@gnu.org To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 10 19:49:16 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 1LAU7N-0006rA-SA for ged-emacs-devel@m.gmane.org; Wed, 10 Dec 2008 19:49:06 +0100 Original-Received: from localhost ([127.0.0.1]:40339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAU6C-0007uP-Mn for ged-emacs-devel@m.gmane.org; Wed, 10 Dec 2008 13:47:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LATpv-0003oB-BV for emacs-devel@gnu.org; Wed, 10 Dec 2008 13:31:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LATpt-0003mX-Fa for emacs-devel@gnu.org; Wed, 10 Dec 2008 13:31:02 -0500 Original-Received: from [199.232.76.173] (port=36509 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LATpt-0003mI-9E for emacs-devel@gnu.org; Wed, 10 Dec 2008 13:31:01 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:54119) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LATpq-00055N-Uv; Wed, 10 Dec 2008 13:30:59 -0500 Original-Received: from alfajor.home (vpn-132-204-232-143.acd.umontreal.ca [132.204.232.143]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mBAIVUSP004181; Wed, 10 Dec 2008 13:31:31 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id 746341C91C; Wed, 10 Dec 2008 13:30:53 -0500 (EST) In-Reply-To: (Juanma Barranquero's message of "Wed, 10 Dec 2008 13:59:13 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3166=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:106767 Archived-At: >> 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? A config var doesn't sound right. Programmatically, there's no need to do anything special. The problem is for interactive use. I don't have a good solution to propose just now, we could just say "to force-start a sever first do M-x server-force-delete and then M-x server-mode". > 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? That sounds about right. The doc could simply say "t, nil, other" where "other" means that we're not sure and the value returned might give a hint about why we're not sure. As for process name, I'd rather not check the name of the process. Stefan