From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22495 invoked by alias); 14 Oct 2017 13:57:39 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 41890 Received: (qmail 7502 invoked by uid 1010); 14 Oct 2017 13:57:39 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.28):SA:0(-2.6/5.0):. Processed in 2.089598 secs); 14 Oct 2017 13:57:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=OcpsGt Hj+VyzmxsmUrdtPRjbDc4xGk2YwL8dK9H0tlM=; b=L+ENN8CtXduirpQsylT98K +d+2iN28jIM/ksVKGPL3UfqkNGKM7nD3YMCl0O7xFe0GfcR9rrkpv/0u7uQQcAdK QxVms+Nne0PSghE4QrBuVI5Hs/cfdtCYM0e2Yv4iVEgMEdtOXegH3nnQ+sDGMVs6 AMiRuOx4CqbsiOIjI/jg3KCbAKEJyVUyLHR6CxHAAvhc9eBolGMTD8BjGbChRfGB zCK4Ctm1oBg1ZbQ0nIO4LzOieusN2KjGn2HMjzjOIFGHnnTDXXL0mFTtxGu+oiDM Rmh2CABL/Nqs/ntKL/qRQahfAhi91Pedpl6kVbUL9Fj55YliL5F++l1sR/oDD4xw == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=OcpsGt Hj+VyzmxsmUrdtPRjbDc4xGk2YwL8dK9H0tlM=; b=dpNcELSoSdhOK5gci979n0 dI/1jSfVzyKteimoYTZ48miv/0DkFiiYZz7Gw6ooxa9yodiSHMilCU35Uy8yci0D jHY/pqU2xSVkvt4aX78lYYXB8AbCm3kB38J6iPMg5+9gt6tJnBB3U7ncrRgjNoJs IjzTBKuutYZAvTmqLdpJFL4Gb/8rMIWusPRXL3a47EuprD/Jgr2MtN9+gHWlhOd/ +JATV4R7aqeAp7AlF8DPN2wGHXekYvze4NSn/TfxystHGwqYyoHHD18290ZFey4q OKEQCQWCxLwbxUm79iPt3W+SL2zoNws9zIzBOZ0EjxZL76DfFkQIgTAgxZ2nIUgw == X-ME-Sender: Message-Id: <1507989452.1856983.1138671752.5772DAF0@webmail.messagingengine.com> From: Daniel Shahaf To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 In-Reply-To: <20171014042152.GA96140@tower.spodhuis.org> Date: Sat, 14 Oct 2017 13:57:32 +0000 Subject: Re: [PATCH] edit-command-line breaks arguments with spaces References: <4B40504C-14CC-4EE0-8A53-5CF67C67E37E@gmail.com> <1507939677.3717869.1138301848.03470D9F@webmail.messagingengine.com> <171013175555.ZM12982@torch.brasslantern.com> <1507945924.3744661.1138358040.4B6A109D@webmail.messagingengine.com> <20171014042152.GA96140@tower.spodhuis.org> Phil Pennock wrote on Sat, 14 Oct 2017 00:21 -0400: > On 2017-10-14 at 01:52 +0000, Daniel Shahaf wrote: > > If $EDITOR is set to "vim -c ''", then: > >=20 > > - current master passes =C2=AB''=C2=BB (two characters) for vim's argv[= 2] > >=20 > > - using eval passes the empty string for vim's argv[2] > >=20 > > - using ${(Q)} elides the "" entirely >=20 > No, the (Q) has nothing to do with it. The problem is that in zsh, > expanding an unquoted array variable omits empty elements. >=20 > So instead of =C2=AB$editor=C2=BB it needs to be =C2=AB"${editor[@]}"=C2= =BB or > =C2=AB"${(@)editor}"=C2=BB to keep the empty elements present at _expansi= on_ time. Good point; changing =C2=AB${(Q)foo}=C2=BB to =C2=AB"${(@Q)foo}"=C2=BB and = =C2=AB$editor=C2=BB to =C2=AB"${editor[@]}"=C2=BB would also work: the problem wasn't (Q) per se, but the lack of (@). Between eval and (@Q) I think I'm leaning towards the latter. Thanks Phil. Cheers, Daniel