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: Wed, 14 Nov 2012 14:53:05 +0100 Message-ID: <87fw4cwata.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 1352901200 17213 80.91.229.3 (14 Nov 2012 13:53:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2012 13:53:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 14 14:53:31 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 1TYdPH-0005DN-0H for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Nov 2012 14:53:31 +0100 Original-Received: from localhost ([::1]:40809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYdP7-00014G-DZ for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Nov 2012 08:53:21 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYdP0-00013m-He for help-gnu-emacs@gnu.org; Wed, 14 Nov 2012 08:53:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYdOx-0002IH-Et for help-gnu-emacs@gnu.org; Wed, 14 Nov 2012 08:53:14 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:52750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYdOx-0002I5-92 for help-gnu-emacs@gnu.org; Wed, 14 Nov 2012 08:53:11 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TYdP3-00051q-Fs for help-gnu-emacs@gnu.org; Wed, 14 Nov 2012 14:53:17 +0100 Original-Received: from e178054191.adsl.alicedsl.de ([85.178.54.191]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Nov 2012 14:53:17 +0100 Original-Received: from tjolitz by e178054191.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Nov 2012 14:53:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 72 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178054191.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:OQJQF2dz4/SZcxGRY/01p+PZo1M= 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:87684 Archived-At: William Gardella writes: > 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. Emacsclient run without > -s simply expects the server to be named the default server name, > `server'. It fails if it can't find this server, or fails over to > starting up emacs --daemon if run with -a "" or an ALTERNATE_EDITOR="" > environment. The emacsclient manpage, btw, holds out no such hope that > the "first server it finds" thing referenced in the Info manual will > work. > > I'm writing up a bug report against the Info manual. After some experimenting it seems to me that there is another bug, at least in my case ,--------------------------- | (call 'emacsclient | "-e" | "(message \"CALL 1\")") `--------------------------- does not work, while ,--------------------------- | (call 'emacsclient | "--eval" | "(message \"CALL 1\")") `--------------------------- does (on Archlinux). I have another problem not yet solved - I want to call an Emacsclient with a file to open and some code to evaluate. Using the "-c" and "--eval" options in one call gives an error for me, and this seems to be in accordance with the manual that says its either the one or the other. However, if I try two sequential calls instead, it works somehow, but not as intended. These two calls directly after another ,-------------------------- | (call 'emacsclient | "-c" "my/dir/my-file") `-------------------------- ,--------------------------- | (call 'emacsclient | "--eval" | "(message \"CALL 1\")") `--------------------------- open a new emacs-frame showing a 'my-file' buffer, but in the *Messages* buffer there is no CALL 1 message. But when I kill the Emacsclient-frame with C-x C-c, CALL 1 is shown as return value in the calling external program and now appears in the *Messages* buffer too. It seems the second call is waiting for the first call to terminate. Now I wonder how I can call Emacsclient with a file I want to edit, but make it (immediately) evaluate some code when it starts up? Is that possible in the call(s) itself, or do I have to use hooks or something like that? -- cheers, Thorsten