From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28130 invoked from network); 23 Nov 2022 23:07:04 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Nov 2022 23:07:04 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669244825; b=C/YskV/60hRvpKiWt+7p+QIi6LF8x87bJ13JcAJMOcBUJpJjDsim7gSK2kLnVm89MGI1Gc/CLo TbyJ3WDfB7R8nqXYVurSuPChGT+eJC8/JI5fW/o1t7w4gYSjUQcX2hthGTOnkUgDgTqd4YClW3 UcJZXQy5Pp0Tb6Ot+MctA6aVQ/lX+GBEi94Y+vrK+2QsL1j/dUQ/o3JLPTBa+0iTEHEuoFbPxz d8JoOTFUyfKvO4R0xBGQXQ6lislNDYJUI7L2/TOVc/o3Iv5T9A20bOXIdz0iR63vzPx7QvJJ6G OK5W+ZTcQo/L8Qb6BJVaHuewwAMW0HhK3qiBVrJdutwm6g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out4-smtp.messagingengine.com) smtp.remote-ip=66.111.4.28; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1669244825; bh=eD1doOAQPRxBUu7/LlFrlNzdXAHtvkAginJsM+e50p4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Subject:Cc:To:From:Date:References:In-Reply-To: Message-ID:MIME-Version:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=FzgIezVl7SlPYUppOTy7u+1jo6/nL7EyRZvy5PMLoPG0AKQTIDjN1aH9LauIHQtQSIPwguW9/C Nz+F1YGmlRMuacycBSrr6b6sUT7cEJblsDynoN9V4+pz/jkIGTFqk6QSGX7XMuXKnHCmT+4gmb bCM6WWsnNQsLYqLgzxe0lDnh5ZjHNKFNbXweL/bEiQQ9V/P3fEZEqPZ2yxa8h6WxXvogWB3ikI 9wLW2KF/kgqM6OGBtovb/DYdqBcXpHczG0r1HIH3gCpBfPwwsOYE3U8nMNMmoxLV2yo91b6uPx tgkTtcQOY8cYCaijja3VWo8HM17YBVjEqFqFLe1eU93DPg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+ETNS4UHRiNH1SRduaP0gKY+vx2Shz7nOgora97wGD0=; b=dCgb8CeLHPiVNztQbTCO6pPUXO 0k22d5XR99L7JpYBuQNU2Ss+F0HxZHRxU16+V1Zl403br497+cSZF8Gy2d5XdAhe/pxV75J3dUpRv bG87KmIYAS8EbmndIcXmpqYVryK0mQe1yxWpNtcZGNv6PEPhDkx0RprwLGoCHqBTPGPbpM+60dKBf wJgwcT3tVyTKK4zcXVUJN5oEt3EG9c5vDQd+tgPhwBbjf6caWNK/dUoT6K7xl1RYTLO8JvztIh425 FdJ2/lLYAdjFeHiesl0IxgOToYklfHO9Ou4mHXbfL3z6XnEVfHOCsV7HglqrGNRRrqsSnOFfGQ8gh 5WdcGn7A==; Received: by zero.zsh.org with local id 1oxypb-0006Nx-G6; Wed, 23 Nov 2022 23:07:03 +0000 Authentication-Results: zsh.org; iprev=pass (out4-smtp.messagingengine.com) smtp.remote-ip=66.111.4.28; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out4-smtp.messagingengine.com ([66.111.4.28]:52953) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oxypL-00062d-SP; Wed, 23 Nov 2022 23:06:49 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C9A2B5C0106; Wed, 23 Nov 2022 18:06:46 -0500 (EST) Received: from imap46 ([10.202.2.96]) by compute2.internal (MEProxy); Wed, 23 Nov 2022 18:06:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1669244806; x= 1669331206; bh=+ETNS4UHRiNH1SRduaP0gKY+vx2Shz7nOgora97wGD0=; b=K Vsy9OoPo1DMB4uwr8jV/J4dgS5hEkX/0MgVUCpMTk+XYiOm8wKGK/QXt0GEhSJz2 BcCqK83GPLgNFSThWeCzFgwcIpSn5khQzOFnRZ3W1gmr72ysTxy2YhRX7LVz2Gz+ nm3c9DX6Pf3XbITO/aZjDokEvCBI2yCfUHzc/2YCTdiAr4N6qYk8sReIyvpi3XWy kkC/VaeHNPm/ON/WZkV6RA15kB6hZ3djasgGYnhF42H+gROTixoGrxiZzGFOaDyA Qs4WBzlokyhugJUBgZ9ozP7l6gFBdNIcjuCWIxVpgCqv2eAsJJlE2FCtQpHjvaMJ S2GBusLhgKsqhck2rJ9EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669244806; x=1669331206; bh=+ETNS4UHRiNH1SRduaP0gKY+vx2S hz7nOgora97wGD0=; b=waHrjPagSS/G+rdnfdh8a0/Rbogy6fUeEFdgdNIAQuGS 5Rgc5w1dHLChoDf1pM0kL/cZ5r4goyiK1locaAa5yzTnuMqb3UVIX8rq20AGdfft n7x+Dj67mDuAWxUZcncW+aLrkkRAyrq9Quz3CQpZR55by/mRc5R8VgEdY5W8KX37 gUKwGqupGdnr1hKWXU1p+jTj3je8ocKWRbICQbhUKK8lDcfMYxxFzDMzMzM4BpBf QLaFYJxcjx80mTynm4JYRjotNmczLXjUY7C0CwA9yae+Kz47TSEkE2m3Dr4JvhTP G9w/vjqLYyNEi9ObSRGeI0ZMD3d7w7eWARiBbwCdMw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedriedvgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdffrghn ihgvlhcuufhhrghhrghffdcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg eqnecuggftrfgrthhtvghrnhepiefghfeftedtgfevheeklefgieekhefgkeefvedvvddv hfduleffgeehveefieeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i425e4195:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6F29B2A20085; Wed, 23 Nov 2022 18:06:46 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <2c4018af-1fe8-4e23-a31b-11158061bd18@app.fastmail.com> In-Reply-To: References: <45820bd7-fab6-70f5-5abb-dc444f6f1075@coldfix.de> <20221123141357.GL27622@tarpaulin.shahaf.local2> Date: Wed, 23 Nov 2022 23:06:25 +0000 From: "Daniel Shahaf" To: "Bart Schaefer" Cc: zsh-workers@zsh.org, =?UTF-8?Q?Thomas_Gl=C3=A4=C3=9Fle?= Subject: Re: Path with spaces in _canonical_paths Content-Type: text/plain X-Seq: 51048 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Bart Schaefer wrote on Wed, 23 Nov 2022 22:42 +00:00: > On Wed, Nov 23, 2022 at 2:24 PM Daniel Shahaf wrote: >> >> Yes. That's why the comment says s/$origpref/$canpref/ rather than >> s/$canpref/$origpref/ as the code in HEAD says. > > Ah, I see. The comment is explaining what the else-branch OUGHT to be > accomplishing, rather than what it actually IS doing. Right. > That was not clear. > Thanks for the feedback. That comment is using "###" comments (a conventional "TODO" marker), the word "ideally", a conditional ("would"), and the order of pattern and replacement is the opposite of what it is in the code. I had thought it was clear. Anyway, I see you've extended it to clarify. Thanks for this. >> I'm not sure off the top of my head. Perhaps that patch needs an extra >> ${(q)} somewhere? Or perhaps we should add -Q to the if() codepath? >> What do callers expect? > > Callers expect it in the form from the if-branch (what compadd > produces), so I think the else-branch needs some variant of (q). > > Thomas, can you try this? > > diff --git a/Completion/Unix/Type/_canonical_paths > b/Completion/Unix/Type/_canonical_paths > index a8fbbb524..1444bc165 100644 > --- a/Completion/Unix/Type/_canonical_paths > +++ b/Completion/Unix/Type/_canonical_paths > @@ -42,7 +42,8 @@ _canonical_paths_add_paths () { > # ### Ideally, this codepath would do what the 'if' above does, > # ### but telling compadd to pretend the "word on the command line" > # ### is ${"the word on the command line"/$origpref/$canpref}. > - matches+=(${${(M)files:#$canpref*}/$canpref/$origpref}) > + # ### The following approximates that. > + matches+=(${(q)${(M)files:#$canpref*}/$canpref/$origpref}) > fi > > for subdir in $expref?*(@); do