On 8 December 2016 at 23:10, Glenn Morris 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