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: Re: Calling emacsclient Date: Mon, 12 Nov 2012 14:04:31 +0100 Message-ID: <87haovq8f4.fsf@googlemail.com> References: <87ip9b9zvj.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1352725491 22794 80.91.229.3 (12 Nov 2012 13:04:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2012 13:04:51 +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 14:05:02 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 1TXthD-0000a6-OS for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 14:04:59 +0100 Original-Received: from localhost ([::1]:39901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXth4-0001tw-73 for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 08:04:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXtgt-0001g5-7U for help-gnu-emacs@gnu.org; Mon, 12 Nov 2012 08:04:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXtgq-0006VV-4G for help-gnu-emacs@gnu.org; Mon, 12 Nov 2012 08:04:39 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:33612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXtgp-0006Uj-Tf for help-gnu-emacs@gnu.org; Mon, 12 Nov 2012 08:04:36 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TXtgw-0000Sk-IG for help-gnu-emacs@gnu.org; Mon, 12 Nov 2012 14:04:42 +0100 Original-Received: from e178057094.adsl.alicedsl.de ([85.178.57.94]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Nov 2012 14:04:42 +0100 Original-Received: from tjolitz by e178057094.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Nov 2012 14:04:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178057094.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:bC3l/NTqJcA/97cWBE4srwOOf9Q= 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:87654 Archived-At: William Gardella writes: Hi William, > Thorsten Jolitz writes: >> 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." ? > > Based on my own experience, that passage you quoted from (info "(emacs) > emacsclient Options") is just plain incorrect. I tried it before, and I tried it recently - it definitely doesn't work > Emacsclient run without -s simply expects the server to be named the > default server name, `server'. Thats already a simple solution for my problem. So I can call emacsclient generically without the '-s' option in my program and tell my users that the emacs-daemon they want to connect to must be started with server-name 'server'. > One possibility would be to use the emacsclient -s option together with > a shell wildcard, e.g.: > > emacsclient -c -s /tmp/emacs1000/* > > works, whatever the name of the socket inside /tmp/emacs1000/ is. So > you could use that trick with the value of your `server-socket-dir' > variable. I have the same 'server-socket-dir', so hardcoding this works fine on my machine. But what if I need a generic version? Can I get the value of `server-socket-dir' and use it for the '-s' option in the same external call to emacsclient? Or would I need two consecutive calls to emacsclient, the first one reading the value of `server-socket-dir' via 'emacsclient -e "(...some lisp...)"', the second one using it for the '-s' option from a variable of the calling program? Anyway, supposing that the adressed emacs-server is called 'server' is probably the simplest and best solution. Thanks for your help. -- cheers, Thorsten