help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Calling emacsclient


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

William Gardella <gardellawg@gmail.com> writes:

Hi William,

> Thorsten Jolitz <tjolitz@googlemail.com> 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




reply via email to

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