unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Reuben Thomas <rrt@sc3d.org>
To: Glenn Morris <rgm@gnu.org>
Cc: 25082@debbugs.gnu.org
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	[thread overview]
Message-ID: <CAOnWdojqhxd2RXxbseLKCTOOGxNwDEkm=LOAzR+5Ce42cycuhA@mail.gmail.com> (raw)
In-Reply-To: <g2oa0mvwyz.fsf@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1742 bytes --]

On 8 December 2016 at 23:10, Glenn Morris <rgm@gnu.org> 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.

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 3833 bytes --]

  reply	other threads:[~2016-12-09 13:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 15:31 bug#25082: [PATCH] Add support to emacsclient for command-lline options in ALTERNATE_EDITOR/--alternate-editor Reuben Thomas
2016-12-02 10:20 ` Eli Zaretskii
2016-12-02 15:31   ` Reuben Thomas
2016-12-08 23:10 ` Glenn Morris
2016-12-09 13:44   ` Reuben Thomas [this message]
2017-08-20 21:08     ` Reuben Thomas
2017-08-22  0:16       ` Glenn Morris
2017-08-22  0:23         ` Reuben Thomas
2017-08-22  0:52           ` Reuben Thomas
2017-08-23 22:59   ` Reuben Thomas
2017-08-27 14:55     ` Eli Zaretskii
2017-08-28 10:15       ` Reuben Thomas
2017-08-29 15:43         ` Eli Zaretskii
2017-08-29 15:49           ` Reuben Thomas
2017-08-29 16:49             ` Eli Zaretskii
2017-08-29 22:29               ` Reuben Thomas
2017-08-30 16:48                 ` Eli Zaretskii
2017-08-30 21:01                   ` Reuben Thomas
2017-08-30 21:02 ` bug#25082: Patch installed Reuben Thomas

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOnWdojqhxd2RXxbseLKCTOOGxNwDEkm=LOAzR+5Ce42cycuhA@mail.gmail.com' \
    --to=rrt@sc3d.org \
    --cc=25082@debbugs.gnu.org \
    --cc=rgm@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).