From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83shga2ubi.fsf@gnu.org> References: <83val93vrk.fsf@gnu.org> <83val62xcb.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1504025508 15064 195.159.176.226 (29 Aug 2017 16:51:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Aug 2017 16:51:48 +0000 (UTC) Cc: 25082@debbugs.gnu.org To: Reuben Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 29 18:51:43 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmjji-0003Cg-Sr for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Aug 2017 18:51:34 +0200 Original-Received: from localhost ([::1]:46110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmjjp-0005S7-Uy for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Aug 2017 12:51:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmjiI-0004Bf-0p for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2017 12:50:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmjiE-0000YZ-Ux for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2017 12:50:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52261) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmjiE-0000YU-Qa for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2017 12:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dmjiE-0004GM-JH for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2017 12:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Aug 2017 16:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25082 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 25082-submit@debbugs.gnu.org id=B25082.150402536116336 (code B ref 25082); Tue, 29 Aug 2017 16:50:02 +0000 Original-Received: (at 25082) by debbugs.gnu.org; 29 Aug 2017 16:49:21 +0000 Original-Received: from localhost ([127.0.0.1]:60942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmjhY-0004FQ-QH for submit@debbugs.gnu.org; Tue, 29 Aug 2017 12:49:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmjhX-0004F6-Dv for 25082@debbugs.gnu.org; Tue, 29 Aug 2017 12:49:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmjhP-0000Kt-0b for 25082@debbugs.gnu.org; Tue, 29 Aug 2017 12:49:14 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmjhO-0000Kn-T9; Tue, 29 Aug 2017 12:49:10 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1182 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dmjhN-00016d-V2; Tue, 29 Aug 2017 12:49:10 -0400 In-reply-to: (message from Reuben Thomas on Tue, 29 Aug 2017 16:49:23 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136336 Archived-At: > From: Reuben Thomas > Date: Tue, 29 Aug 2017 16:49:23 +0100 > Cc: Glenn Morris , 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.)