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: Back to emacsclient/server Date: Mon, 23 Oct 2006 16:14:20 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1161612894 21043 80.91.229.2 (23 Oct 2006 14:14:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 23 Oct 2006 14:14:54 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 23 16:14:52 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gc0Zd-0001qm-Lp for ged-emacs-devel@m.gmane.org; Mon, 23 Oct 2006 16:14:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gc0Zd-0000wv-4h for ged-emacs-devel@m.gmane.org; Mon, 23 Oct 2006 10:14:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gc0ZQ-0000wi-6u for emacs-devel@gnu.org; Mon, 23 Oct 2006 10:14:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gc0ZL-0000tq-4Q for emacs-devel@gnu.org; Mon, 23 Oct 2006 10:14:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gc0ZK-0000tZ-Sa for emacs-devel@gnu.org; Mon, 23 Oct 2006 10:14:22 -0400 Original-Received: from [66.249.92.175] (helo=ug-out-1314.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gc0ZK-0007GS-JQ for emacs-devel@gnu.org; Mon, 23 Oct 2006 10:14:22 -0400 Original-Received: by ug-out-1314.google.com with SMTP id 36so1373052uga for ; Mon, 23 Oct 2006 07:14:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=J/xIamfQ1TZ1r+2rvNxa4ijQXA+UKZ9B1WWSG4C9P/fNCzKKgo4QKW8GFrjBKqNB1J7bBKuRmRzVhEoRBsGm216LakwLzElVvJMRcLOeS0aNDW5+1gcy+o1fm9ToPGgjIX3vQT/fyqtveYqf+7FiHbQ1ZtRwj6bZkHyZjuAH5P8= Original-Received: by 10.82.101.3 with SMTP id y3mr1293363bub; Mon, 23 Oct 2006 07:14:20 -0700 (PDT) Original-Received: by 10.82.136.11 with HTTP; Mon, 23 Oct 2006 07:14:19 -0700 (PDT) Original-To: "Emacs Devel" Content-Disposition: inline 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:61046 Archived-At: I'm finally getting the time to try implementing TCP sockets (and so Win32 support) for emacsclient.c/server.el. I must confess that the talk about reimplementing gnuserv in Java has made me shiver quite a lot (no offense intended, I just happen to not like Java *at all*). I've reviewed all comments exchanged about this issue in past threads (or at least all the ones I could find). There were some decisions that got more-or-less universal agreement, some that were controversial, and a few that were left undecided (mostly because we were throwing ideas back and forth). So let's recapitulate: - The server (i.e., server.el) should: - Have an option to choose among Unix (if available) or TCP sockets. - Have an option to specify the host address, defaulting to 127.0.0.1. - Choose the port at random (to allow multiple server in the same computer). - Write the hostname address, port and random authentication string in a file. - Close any connection which doesn't start with "-auth AUTHENTICATION-STRING". - The client (emasclient.c) should: - Interpret --server-name as an Unix socket (if available), and, if that does fail, as a path to the server file. - Default --server-name to an environment variable (EMACS_SERVER_NAME, for example), if -server-name is missing. - Send "-auth AUTHENTICATION-STRING" as the first command in any connection. There was some discussion about allowing/not allowing remote connections (defaulting to "not allow"). If they're allowed, either a option in server.el would activate remote connection support, or perhaps just the fact that server-host != 127.0.0.1 should suffice. I favor this, because connections on Unix sockets will never be remote, so a new option seems redundant. But I don't care much. Stefan wanted that --server-name=foo, if not valid as a Unix socket, would try to open server file ~/.emacs.server/foo to get the address, port and authentication string. I'm not so sure. I don't see why root in one session cannot try to connect with Emacs in another user's session, so --server-name is gonna need to be a (relative or absolute) path, and not a name depending of the current user. Am I missing something? The last time around, about 80% of the above was implemented; I'll have to rework it because I got rid of the Unix socket support (which must stay), but it shouldn't be too difficult. -- /L/e/k/t/u