[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling emacsclient

From: Thorsten Jolitz
Subject: Re: Calling emacsclient
Date: Wed, 14 Nov 2012 14:53:05 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux)

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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]