all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: Calling emacsclient
Date: Mon, 12 Nov 2012 01:51:18 +0100	[thread overview]
Message-ID: <87pq3jk5ix.fsf@googlemail.com> (raw)


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





             reply	other threads:[~2012-11-12  0:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12  0:51 Thorsten Jolitz [this message]
     [not found] <mailman.12766.1352681489.855.help-gnu-emacs@gnu.org>
2012-11-12  5:03 ` Calling emacsclient William Gardella
2012-11-12 13:04   ` Thorsten Jolitz
2012-11-12 14:15     ` Suvayu Ali
2012-11-12 14:58       ` Thorsten Jolitz
2012-11-14 13:53   ` Thorsten Jolitz
     [not found]   ` <mailman.12968.1352901198.855.help-gnu-emacs@gnu.org>
2012-11-14 17:10     ` William Gardella
2012-11-14 20:08       ` Thorsten Jolitz
2012-11-14 17:22     ` William Gardella
2012-11-14 17:23       ` William Gardella
2012-11-14 20:01       ` Thorsten Jolitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pq3jk5ix.fsf@googlemail.com \
    --to=tjolitz@googlemail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.