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: Eli Zaretskii
Subject: bug#25082: [PATCH] Add support to emacsclient for command-lline options in ALTERNATE_EDITOR/--alternate-editor
Date: Tue, 29 Aug 2017 19:49:05 +0300

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 29 Aug 2017 16:49:23 +0100
> Cc: Glenn Morris <rgm@gnu.org>, 25082@debbugs.gnu.org
> 
>  > 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.
> 
>  We don't want them to rely on the lack of the escaping, but we also
>  want to tell them what is supported and how.
> 
> So just to check, you would view the current lack of documentation of how the 
> current variable works as
> something that should ideally be improved?​

Yes.

>  > +Arguments may be quoted, so that for example an absolute path
>  > +containing a space may be specified; quote escaping is not supported.
> 
>  I would say `quoted "like this"', since otherwise it isn't clear what
>  kind of quoting is supported. And I think something similar needs to
>  be said in the manual.
> 
> ​OK, I'll do that.​

Thanks.

>  This won't work on Windows, btw, if the arguments include whitespace.
>  But that can be fixed by followup changes.
> 
> How not? That is precisely the case it aims to support.​ That's the whole 
> point of dealing with quotes!
> (Previous versions of the patch didn't support quoting, and so didn't support 
> spaces in arguments; this version
> has a passing test to show that spaces in quoted arguments work.)

Did you try that on MS-Windows?  If you did and it worked for you,
then perhaps I've misread the code.  I didn't actually try running it.

The issue I alluded to is a subtle misfeature in the Windows
implementation of execvp (and similar Posix functions): the arguments
you pass via the argv array get concatenated into a single
command-line string, and that string is passed to the Windows system
API that actually invokes the program.  So argv[] elements that
include whitespace need to be quoted(!) to work correctly on
MS-Windows.  (Of course, this quoting must be ifdef'ed away for Posix
platforms.)





reply via email to

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