all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Detecting if the Emacs server is running
Date: Fri, 18 Mar 2011 08:14:05 +0000 (UTC)	[thread overview]
Message-ID: <slrnio652d.aj3.nospam-abuse@powdermilk.math.berkeley.edu> (raw)
In-Reply-To: mailman.5.1300430901.25014.help-gnu-emacs@gnu.org

On 2011-03-18, Deniz Dogan <deniz.a.m.dogan@gmail.com> wrote:
> `--alternate-editor=COMMAND'
>      Specify a command to run if `emacsclient' fails to contact Emacs.
>      This is useful when running `emacsclient' in a script.  For
>      example, the following setting for the `EDITOR' environment
>      variable will always give you an editor, even if no Emacs server is
>      running:
>
>           EDITOR="emacsclient --alternate-editor emacs +%d %s"
>
>      As a special exception, if COMMAND is the empty string, then
>      `emacsclient' starts Emacs in daemon mode and then tries
>      connecting again.

Unfortunately, AFAIK, this piece of documentation is wrong.  One is
forced to use much more baroque ways to do "the right thing".  The bug
I suspect is emacsclient using some unportable switch (like
--daemon) for emacs, instead of using
  -f server-start
on platforms which do not support --daemon.  I needed to create a
batch file which does
   emacs -f server-start %*
and give its name as the argument to --alternate-editor...

Ilya


  parent reply	other threads:[~2011-03-18  8:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18  6:11 Detecting if the Emacs server is running PJ Weisberg
2011-03-18  6:47 ` Deniz Dogan
2011-03-18  7:38   ` PJ Weisberg
2011-03-18  9:59     ` PJ Weisberg
2011-03-18  7:18 ` Leo
     [not found] ` <mailman.5.1300430901.25014.help-gnu-emacs@gnu.org>
2011-03-18  8:14   ` Ilya Zakharevich [this message]
     [not found] <mailman.2.1300428697.25014.help-gnu-emacs@gnu.org>
2011-03-18  9:43 ` Pascal J. Bourguignon
2011-03-18 20:46   ` PJ Weisberg

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=slrnio652d.aj3.nospam-abuse@powdermilk.math.berkeley.edu \
    --to=nospam-abuse@ilyaz.org \
    --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.