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

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

bug#25082: [PATCH] Add support to emacsclient for command-lline options


From: Reuben Thomas
Subject: bug#25082: [PATCH] Add support to emacsclient for command-lline options in ALTERNATE_EDITOR/--alternate-editor
Date: Mon, 28 Aug 2017 11:15:55 +0100

On 27 August 2017 at 15:55, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Reuben Thomas <rrt@sc3d.org>
>> Date: Wed, 23 Aug 2017 23:59:01 +0100
>> Cc: 25082@debbugs.gnu.org
>>
>> I've modified my patch to cope with this case. Rather than write a
>> general escaping parser, or even one that just copes with escaping
>> quotes (likely to be complex and buggy in C; and I couldn't find code I
>> could easily lift from elsewhere), I simply allow " as a delimiter as
>> well as space for quotes. Escaping quotes is not supported.
>>
>> This suffices to cope with the common case on Windows of needing to
>> quote a path containing spaces. It also copes with other simple cases.
>>
>> Is this sufficient?
>
> It could be, but I'm not sure I understand clearly what is supported
> and what isn't.  Could you please add this information to the NEWS
> entry and in more detail to the user manual?  I think having these
> details in the manual is important regardless.

I've added detail to NEWS. I am wary of adding more detail to the
manual, because it could prevent future improvements (for example,
implementation of quote escaping): we don't want users to rely on the
lack of quote escaping. The manual currently says:

@table @samp
@item -a @var{command}
@itemx --alternate-editor=@var{command}
Specify a command to run if @code{emacsclient} fails to contact Emacs.
This is useful when running @code{emacsclient} in a script.

Note that this does not document the current situation precisely (a
user could be forgiven for thinking that "emacs -Q -nw" would already
work.

The man page emacsclient(1) is similarly imprecise, though it is a
little different:

.B \-a, \-\-alternate-editor=EDITOR
if the Emacs server is not running, run the specified editor instead.

Here, the use of the word "editor" rather than "command" is more
suggestive of the current behavior. I have changed it to be in line
with the manual. I have also fixed a small error in the man page: it
said

If the value of EDITOR is the empty string, run "emacs \-\-daemon" to
start Emacs in daemon mode, and try to connect to it.

where it should say

If the value of ALTERNATE_EDITOR is the empty string, run "emacs \-\-daemon" to
start Emacs in daemon mode, and try to connect to it.

Updated patch attached.

-- 
https://rrt.sc3d.org

Attachment: 0001-Add-support-for-arguments-in-ALTERNATE_EDITOR-to-ema.patch
Description: Text Data


reply via email to

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