From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#13319: 24.2.91; emacsclient doesn't find server with nonstandard name Date: Mon, 31 Dec 2012 18:11:18 +0100 Message-ID: <87zk0u405l.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356974417 23311 80.91.229.3 (31 Dec 2012 17:20:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Dec 2012 17:20:17 +0000 (UTC) To: 13319@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 31 18:20:33 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tpj2M-00049d-R3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 31 Dec 2012 18:20:31 +0100 Original-Received: from localhost ([::1]:46266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tpj27-00056M-Vc for geb-bug-gnu-emacs@m.gmane.org; Mon, 31 Dec 2012 12:20:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tpj24-000560-Vp for bug-gnu-emacs@gnu.org; Mon, 31 Dec 2012 12:20:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tpixs-0007FJ-1A for bug-gnu-emacs@gnu.org; Mon, 31 Dec 2012 12:16:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tpixr-0007FE-NN for bug-gnu-emacs@gnu.org; Mon, 31 Dec 2012 12:15:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tpiz0-0005Ho-45 for bug-gnu-emacs@gnu.org; Mon, 31 Dec 2012 12:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Dec 2012 17:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13319 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135697420720290 (code B ref -1); Mon, 31 Dec 2012 17:17:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Dec 2012 17:16:47 +0000 Original-Received: from localhost ([127.0.0.1]:38248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tpiyk-0005HC-OU for submit@debbugs.gnu.org; Mon, 31 Dec 2012 12:16:47 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53699) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tpiyh-0005H3-RN for submit@debbugs.gnu.org; Mon, 31 Dec 2012 12:16:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TpixT-000738-SO for submit@debbugs.gnu.org; Mon, 31 Dec 2012 12:15:33 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:55275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TpixT-00070p-P2 for submit@debbugs.gnu.org; Mon, 31 Dec 2012 12:15:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tpisc-0003m3-GK for bug-gnu-emacs@gnu.org; Mon, 31 Dec 2012 12:10:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TpisZ-0005du-Cb for bug-gnu-emacs@gnu.org; Mon, 31 Dec 2012 12:10:26 -0500 Original-Received: from mout.web.de ([212.227.15.4]:64610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TpisZ-0005Ve-1s for bug-gnu-emacs@gnu.org; Mon, 31 Dec 2012 12:10:23 -0500 Original-Received: from drachen.dragon ([89.204.130.115]) by smtp.web.de (mrweb102) with ESMTPA (Nemesis) id 0M4qav-1T6AMp30zl-00yrrc; Mon, 31 Dec 2012 18:10:11 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) X-Provags-ID: V02:K0:Oml7KemU5GfVo8KdNNOWcT6G6En5+cmihStbiqIvpez Oz5PeY5uym4o2MEzucAghY4Z+BMuf4Y2ASSSpZvdyH04nAnfHZ 8wD2w+k3sjiszJFUreDA+o5p+bNVUfdDWDWarCPXgbgDZPuRN6 4xB3LBo0JsWV5QbH3V0xQiqULP5VHw1KH4zSktRt1Ra3vW5eVX nORKf4vu5sJbaLYkN4FQXxQkfj45/rcSBwOLTjDCFQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:69245 Archived-At: Hi, In emacs -Q, do this: (progn (require 'server) (let ((server-name (concat "server_" (format-time-string "%H:%M:%S")))) (server-start))) Then I try to connect to this server, but it fails: | bash-4.2:mh:~$ /usr/bin/emacsclient ~/.bashrc | /usr/bin/emacsclient: can't find socket; have you started the server? | To start the server in Emacs, type "M-x server-start". | /usr/bin/emacsclient: No socket or alternate editor. Please use: | | --socket-name | --server-file (or environment variable EMACS_SERVER_FILE) | --alternate-editor (or environment variable ALTERNATE_EDITOR) When I explicitly specify the server name with the -s option, emacsclient succeeds. But due to the doc (man page), "emacsclient" should connect to "the first server it finds": | `-s SERVER-NAME' | `--socket-name=SERVER-NAME' | Connect to the Emacs server named SERVER-NAME. The server name is | given by the variable `server-name' on the Emacs server. If this | option is omitted, `emacsclient' connects to the first server it | finds. (This option is not supported on MS-Windows.) Obviously this is not fulfilled here. And it is no useful behavior. If only one server is running (and the socket is located under the canonical path), emacsclient should find and use it. It is arguable which server should be used if more than one is running (and what the "first server it finds" should be). BTW, here is an explanation for why I want to start the server like above (not substantially important for this report): I often make changes to my config file/ elpa installations or rebuild Emacs. To guarantee that I always have a running Emacs (as a fallback when something went wrong and a newly started Emacs fails to start), I keep my old Emacs open and start a new one. If I had just (server-start) in my config, the new Emacs would not start a server (since the old one is still running). After having closed the old Emacs, I had no server running, so I had to manually start the server every time. This is annoying. So I want to start a server with a unique name. Thanks, Michael. In GNU Emacs 24.2.91.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2012-12-30 on drachen Bzr revision: rgm@gnu.org-20121230122326-m6gw29pkwjgwqf9d Windowing system distributor `The X.Org Foundation', version 11.0.10707000 System Description: Debian GNU/Linux testing (wheezy)