From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#6831: 23.2; emacsclient warning "can't find socket" Date: Mon, 4 Jul 2011 17:28:55 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1309794460 9882 80.91.229.12 (4 Jul 2011 15:47:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2011 15:47:40 +0000 (UTC) Cc: 6831@debbugs.gnu.org To: Leo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 04 17:47:36 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QdlN0-0001XV-KD for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Jul 2011 17:47:34 +0200 Original-Received: from localhost ([::1]:48991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdlMz-0000FR-77 for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Jul 2011 11:47:33 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdl68-0004D1-Ch for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 11:30:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qdl65-0000j6-SC for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 11:30:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdl65-0000iA-K4 for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 11:30:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qdl64-0003XC-Is; Mon, 04 Jul 2011 11:30:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Jul 2011 15:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6831 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6831-submit@debbugs.gnu.org id=B6831.130979338313504 (code B ref 6831); Mon, 04 Jul 2011 15:30:04 +0000 Original-Received: (at 6831) by debbugs.gnu.org; 4 Jul 2011 15:29:43 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qdl5j-0003Vj-Bv for submit@debbugs.gnu.org; Mon, 04 Jul 2011 11:29:43 -0400 Original-Received: from mail-pz0-f44.google.com ([209.85.210.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qdl5h-0003VY-GC for 6831@debbugs.gnu.org; Mon, 04 Jul 2011 11:29:42 -0400 Original-Received: by pzk5 with SMTP id 5so726511pzk.3 for <6831@debbugs.gnu.org>; Mon, 04 Jul 2011 08:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=pvsScigEzBS1Vw8DVvdaceRL/Axq0xxZ8yZiJ8k/j+Y=; b=bGPUhxecQS82Ks2s+56M/xmnJ5rjd5iNZhBKjAim3CN9SWEl1nTgMlrZTHCosoTwQq rZkxGXD/woxPr2fw4YFKGziExmt5MhDf2IluV2iloOIZ7NKVn4QTr7ZOXfkPTZr/EuU2 IdI/i+GLSSDlB2kMvHCMUD4yCAbaApM9/wnm8= Original-Received: by 10.142.118.24 with SMTP id q24mr2794606wfc.392.1309793375245; Mon, 04 Jul 2011 08:29:35 -0700 (PDT) Original-Received: by 10.142.48.6 with HTTP; Mon, 4 Jul 2011 08:28:55 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 04 Jul 2011 11:30:04 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47952 Archived-At: > I run emacsclient on a gnu/linux machine and I can still see the > warning without passing --server=3Dserver. I don't think that's a bug. You're running emacs / emacsclient in a POSIX environment, where the default is *not* using TCP, but you're asking Emacs to use TCP: 2. (setq server-use-tcp t) and you're not specifying an alternate server name 3. M-x server-start so Emacs uses "server", the default. Then you run emacsclient without passing --server-file (or -f), which would ask for TCP: 4. emacsclient -n . so it defaults to trying local sockets first. Let's see what set_socket() d= oes: Try 1: #ifndef NO_SOCKETS_IN_FILE_SYSTEM /* Explicit --socket-name argument. */ if (socket_name) { s =3D set_local_socket (); if ((s !=3D INVALID_SOCKET) || no_exit_if_error) return s; message (TRUE, "%s: error accessing socket \"%s\"\n", progname, socket_name); exit (EXIT_FAILURE); } #endif but there's no explicit --socke-name arg, so Try 2: /* Explicit --server-file arg or EMACS_SERVER_FILE variable. */ if (!server_file) server_file =3D egetenv ("EMACS_SERVER_FILE"); if (server_file) { s =3D set_tcp_socket (); /* etc */ } but you didn't pass --server-file nor did you set EMACS_SERVER_FILE, so Try 3: #ifndef NO_SOCKETS_IN_FILE_SYSTEM /* Implicit local socket. */ s =3D set_local_socket (); if (s !=3D INVALID_SOCKET) return s; #endif and set_local_socket tries to open the default local socket [at (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid)))], and fails, displays the error you're seeing, and returns. So, Try 4: /* Implicit server file. */ server_file =3D "server"; s =3D set_tcp_socket (); if ((s !=3D INVALID_SOCKET) || no_exit_if_error) return s; Finally! emacsclient tries a socket with the default name, and succeeds, so the whole run works even if set_local_socket gave us a warning. When you explicitly pass --server=3Dserver, you shortcut the search at Try 2, which works so set_local_socket() is not called. Now, perhaps set_local_socket() should be somewhat more quiet and leave the noise to set_socket(), but it is trying to be helpful and distinguish between different error conditions; passing that back to set_socket() wouldn't be particulary clean or elegant. Moral: if you're taking the trouble to set the server for TCP, take the trouble to say that to emacsclient. If typing " -f server" is too much trouble and you always use the default name, try setting EMACS_SERVER_FILE. =C2=A0 =C2=A0 Juanma