From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 44be6d7e for ; Tue, 8 Jan 2019 15:32:31 +0000 (UTC) Received: (qmail 20022 invoked by alias); 8 Jan 2019 15:32:16 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23831 Received: (qmail 16777 invoked by uid 1010); 8 Jan 2019 15:32:16 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(66.111.4.25):SA:0(-1.1/5.0):. Processed in 5.412072 secs); 08 Jan 2019 15:32:16 -0000 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=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm2; bh=Jm+I+iXMfAmDdIk12T/OI8oLr3CRM1lDqyjopUoL MRU=; b=KnPceldov/LCz41rcUbz7pSwXW7iSOAuKgLa85W/BZWrZDYZ+RD1hrFp mnD9eAwBl/xqaylKnFOI/lNRxHN9Ithm2O9aOV8LebRnOWtR8MD8SwCrHzbQ/mdx VS4Ga32laO4yxfy0dAaN3HWP3u2k/Xq+rmeQI9J4m+J1LRxQik3KcsHz0FoS+YtM jlcCjX5/Lvxzb4Euhxvra35d7EbTBIUUmsIo159xGyafpcOGsqP7PUXg1sbiNLvW n7geyZtwMy4vTYw+yakFTSChxY0yi3uo4E8IRF9l14RTm5GfM8yazjnl5PdVGwFm 9w3g2BsDzXRBLVyMGWBxAYRe+JK6OA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Jm+I+iXMfAmDdIk12T/OI8oLr3CRM1lDqyjopUoLM RU=; b=TnDwAJL5a3Shzn/lCNpTkO5a+Samv9GxHS3OAUJ4eW/Ay0d5Zis7K92tJ dOBlmPL6dxfChYqOvqTq6avmu3sfa8glLEurVRUGHKDgOdXX6YTsXmu+xShZX//b kqCANsLcmSnBiJOwMxXcyG5xmpcrR3an4F36yH+Vz3S5dat5xs5PuPv+FI+WOVgZ 6OtYNX56sya9aVIJj+fEmyMBmtRyrP9QK9k4EFYa8F8S1/uap1/J/IwzzfoGOwr3 IhQRdyeb3NLImjwmV0wIj/zn2sPUM1RNisiOE6SxcKVh2C0LYq7PK3lF4yGAiWOa bP++6akF0mVSZuhKXgli+zv34MqfQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdelgdejieculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtugfgjggfsehtkedttddtredunecuhfhrohhmpeffrghn ihgvlhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqe enucfkphepjeelrddukeefrdegkedrudelgeenucfrrghrrghmpehmrghilhhfrhhomhep ugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvnecuvehluhhsthgvrhfuihiivg eptd X-ME-Proxy: Date: Tue, 8 Jan 2019 15:32:03 +0000 From: Daniel Shahaf To: Peter Stephenson Cc: zsh-users@zsh.org Subject: Re: how to make zsh tab-complete path after colon (instead of just `=`) Message-ID: <20190108153203.ni7lhxgpvt7f3jti@tarpaulin.shahaf.local2> References: <1546946484.4090.2.camel@samsung.com> <1546951129.4090.7.camel@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1546951129.4090.7.camel@samsung.com> User-Agent: NeoMutt/20170113 (1.7.2) Peter Stephenson wrote on Tue, Jan 08, 2019 at 12:37:31 +0000: > I'm told this is probably good enough, and it's certainly not a big > change, and it's safe if you don't have the style set, so we might as > well get it in. I'm not convinced we should. The functionality provided is extremely specific (only file completion; only single characters as the delimiter; etc). It is also "brutal" (to use your word), to the point that even the new documentation recommends against using it. Moreover, it could be implemented equivalently by a short and equally brutal zshrc change (fewer than 10 lines), with no changes to the completion standard library. The new functionality does not make _path_files easier to maintain (it adds four lines that everyone who changes this function from now one will have to decipher) nor the manual easier to use (it reduces the signal-to-noise ratio by adding a feature that self-describes as one that shouldn't normally be used). If we add and document this now, we'll be committed to supporting it for eternity, and I am unsure that the added value justifies the cost. I see you've pushed this already, so I would ask not to ship 5.7 with this patch this week, in order to give time for discussion before the backwards compatibility milk spills. Cheers, Daniel > Someone may see some useful tweaks, e.g. it's quite possible I haven't > taken account of quoting properly.  Here's a full patch with > documentation. > > pws > > diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files > index 9fa6ae9..1021c34 100644 > --- a/Completion/Unix/Type/_path_files > +++ b/Completion/Unix/Type/_path_files > @@ -2,6 +2,11 @@ >   >  local -a match mbegin mend >   > +local splitchars > +if zstyle -s ":completion:${curcontext}:" file-split-chars splitchars; then > +  compset -P "*[${(q)splitchars}]" > +fi > + >  # Look for glob qualifiers.  Do this first:  if we're really >  # in a glob qualifier, we don't actually want to expand >  # the earlier part of the path.  We can't expand inside > diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo > index a5a9e5b..3ce1c8c 100644 > --- a/Doc/Zsh/compsys.yo > +++ b/Doc/Zsh/compsys.yo > @@ -1568,6 +1568,16 @@ contains the string `tt(follow)', timestamps are associated with the >  targets of symbolic links; the default is to use the timestamps >  of the links themselves. >  ) > +kindex(file-split-chars, completion style) > +item(tt(file-split-chars))( > +A set of characters that will cause em(all) file completions for > +the given context to be split at the point where any of the characters > +occurs.  A typical use is to set the style to tt(:); then everything > +up to and including the last tt(:) in the string so far is ignored when > +completing files.  As this is quite heavy-handed, it is usually > +preferable to update completion functions for contexts where this > +behaviour is useful. > +) >  kindex(filter, completion style) >  item(tt(filter))( >  The tt(ldap) plugin of email address completion (see tt(_email_addresses)) uses