From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Calling emacsclient Date: Mon, 12 Nov 2012 01:51:18 +0100 Message-ID: <87pq3jk5ix.fsf@googlemail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1352681492 26775 80.91.229.3 (12 Nov 2012 00:51:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2012 00:51:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 12 01:51:43 2012 Return-path: Envelope-to: geh-help-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 1TXiFZ-0003ia-GU for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 01:51:41 +0100 Original-Received: from localhost ([::1]:35873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXiFQ-0004ml-2s for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Nov 2012 19:51:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXiFJ-0004if-AV for help-gnu-emacs@gnu.org; Sun, 11 Nov 2012 19:51:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXiFG-0000OD-8O for help-gnu-emacs@gnu.org; Sun, 11 Nov 2012 19:51:25 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:45469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXiFG-0000O8-19 for help-gnu-emacs@gnu.org; Sun, 11 Nov 2012 19:51:22 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TXiFN-0003dz-Cv for help-gnu-emacs@gnu.org; Mon, 12 Nov 2012 01:51:29 +0100 Original-Received: from e178059021.adsl.alicedsl.de ([85.178.59.21]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Nov 2012 01:51:29 +0100 Original-Received: from tjolitz by e178059021.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Nov 2012 01:51:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 70 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178059021.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:Yz0FMJFzlx9sd/CyBqiaxt0J3Ek= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87646 Archived-At: Hi List, with one emacs-daemon (named 'emacs1') running, the following external call to emacsclient succeeds: ,----------------------------- | (call 'emacsclient | "-s" "emacs1" | "-a" "" | "-c" "file...") `----------------------------- But what I really would need is a more generic version that does not use the server-name. The manual says: ,------------------------------------------------------------------ | ‘-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.) `------------------------------------------------------------------ This does not work in my case. If I use ,----------------------------- | (call 'emacsclient | "-c" "file...") `----------------------------- I get: ,----------------------------------------------------------------------- | emacsclient: can't find socket; have you started the server? | To start the server in Emacs, type "M-x server-start". | 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) `----------------------------------------------------------------------- while ,----------------------------- | (call 'emacsclient | "-a" "" | "-c" "file...") `----------------------------- starts a new emacs-daemon (although emacs-server 'emacs1' is running). Question: How do I get the behaviour described in the manual: "If this option [-s] is omitted, emacsclient connects to the first server it finds." ? I would need a generic call to emacsclient that first looks for a running server (which ever it encounters) and only starts a new daemon if there is no server running already. I'm on Arch Linux. -- cheers, Thorsten