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

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

Re: Detecting if the Emacs server is running


From: Ilya Zakharevich
Subject: Re: Detecting if the Emacs server is running
Date: Fri, 18 Mar 2011 08:14:05 +0000 (UTC)
User-agent: slrn/0.9.8.1pl1 (Linux)

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


reply via email to

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