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: Fri, 9 Dec 2016 13:44:41 +0000

On 8 December 2016 at 23:10, Glenn Morris <address@hidden> wrote:
Reuben Thomas wrote:

> The attached patch adds support to emacsclient for command-line options
> when specifying the alternate editor, so that for example one can now say:
>
> ALTERNATE_EDITOR="emacs -Q -nw"

Obvious question: what happens if eg one wants to specify an absolute
file name for the alternate editor, and it contains spaces?

With my current implementation, that wouldn't work. I guess this would be most likely to be a problem on Windows?

> implemented the feature when I found that it didn't work as I expected;
> other similar environment variables with which users may be familiar, such
> as EDITOR and VISUAL, already work like this.

Do you have a citation for that being how eg EDITOR is intended to work?

​No. The documentation in environ(7) just says:

       EDITOR/VISUAL
              The user's preferred utility to edit text files.

However, I can't find a program that interprets it as a literal filename.

For example, Debian's sensible-editor editor-wrapper script does exactly what I just did. If I set

export EDITOR='"spacey editor"'

it complains it can't find a program called: "spacey

If I do

export EDITOR="emacsclient -c"

it works nicely. So it doesn't parse quotes specially. However, that's not cross-platform.

I would not be averse to adding more sophisticated parsing (as I don't think that would confuse users), but I'd rather not have to write a lot more error-prone C to achieve that.

I had a look in gnulib but couldn't find anything. If there's some code I could lift from bash or something, that'd be ideal.

--

reply via email to

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