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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27293 invoked from network); 3 Jan 2022 15:42:17 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Jan 2022 15:42:17 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1641224537; b=rsAobTLckCpQyk4u34gb4ka3X+0BahV/bWIyApCAV1IOr1/4JrRv6tLo+1rkjoSixjKwWMorcv VE8S6A2azwUFRch7QFiREkpImsph97FFbK1ndNtlg3QSA/Kkd8sPfUOe0KLKdWPdOPs24FWB5H PD1e7li++35MJHlkFf2rOc1i1IpwYhhx0IBhHklfkUdfcjpsz7mVte1W199lgGqWQ+HSJmg25o V1gumJyfiawoe+Grq4gFeEaBal2scpTGXp//igoLig8ZtA8NBpqYhHDbl6zaBG6K+X8s744H4D leF+TVKS/GyLcCcGTdkVI9CEU6w0H2TZGFQ5Cr8gfx1ffA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (pepin.polanet.pl) smtp.remote-ip=193.34.52.2; dmarc=none header.from=polanet.pl; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1641224537; bh=CjNoWuF1ydPIL6xbs7RDW1SPQym5iF/MPsi2EZ6fzmc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:DKIM-Signature; b=ca+IRzyrfWV2T2ZNX4zs54nZwZjIKRS+GqbRFu5pSJTzP71zlsWxSELBg6E9p+vfuhyXFEQsSY 8T/W6LjfwrCeDkF6x5LGdYJskllIpr23iIlJydouGKNw+OfOo0whoilKA7GiQjIFVlfTD2/kFV KgQsq2HoPfUX9YUj7mjxDDji1fbi3uF3zpPwKSkrAVG9tl3Pe/UdC9X8oki6AJoE0EM2FqtTnD OYvD63MjoXMNbhumaNXzQM5q0s9KSelXb1kGBE2YVap2tSXRpWrnYE6n9UsFJy4J+sLDFrhKqX 6gBOdHoTyK2FNfk/MNkTXnWnex3WMWZepB44vP16eyMp6Q==; 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:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=YakkoKciypSFNux80QWIBmJaEBPzeXSQF66gEePhwNc=; b=nBgId/CwFTNY+ZQKTEKMZ84mok yTGZW94p+zP3JjJ2hXtST6wuADCDoOJSwvFBg5SNr/ypMn5xtjRTkZ20vxtGkXAZXZ5V03OuRBPst 5eKwi34bQTL6DgCw5r4194cTZwJeAmeDwD+OQH3se15BXtkLmaXWQ2WK9KMuS/+W1EudgB3ZPiBWW DX/a+eOlKlFJlJahcrVRBclA9FW01O4EcB0v351rvvWaRNrwBAvNDjvJDA7qqum9yRZrjp5jZ2+ac Qz6qld7XuUlUXQVO5EweNMKzThx0f4KcivD3en2VIB52yZVMK+/uqNNXaOLMGHWNtgMWPAh5BR11y z0p4xI4g==; Received: from authenticated user by zero.zsh.org with local id 1n4PTU-000LZf-Jw; Mon, 03 Jan 2022 15:42:16 +0000 Authentication-Results: zsh.org; iprev=pass (pepin.polanet.pl) smtp.remote-ip=193.34.52.2; dmarc=none header.from=polanet.pl; arc=none Received: from pepin.polanet.pl ([193.34.52.2]:52488) by zero.zsh.org with esmtps (TLS1:DHE-RSA-AES256-SHA:256) id 1n4PS6-000Kog-Ie; Mon, 03 Jan 2022 15:40:51 +0000 Date: Mon, 3 Jan 2022 16:40:49 +0100 From: Tomasz Pala To: zsh-users@zsh.org Subject: Re: _complete: insert unambiguous when globbing Message-ID: <20220103154049.GA5954@polanet.pl> References: <20220103123903.GA20434@polanet.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <20220103123903.GA20434@polanet.pl> User-Agent: Mutt/1.5.20 (2009-06-14) X-Seq: 27448 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Sorry for mailing this to @sunsite.dk - please reply using this forward... On Mon, Jan 03, 2022 at 13:39:03 +0100, Tomasz Pala wrote: > I'm struggling with something which felt basic, yet I cannot find a > valid solution (in any combination of remaining styles)... > > mkdir empty > cd empty > touch 20{a,b,c,d}.x > > ls 2[tab] ==> 20 this is expected > ls 2*[tab] !=> 20 how to make this to be expanded first to > > "20", and then the regular rules to proceed (either menu complete I > always use, or _expand)? > > More advanced example: > ls 2*x[tab] ?=> 20[completions]x > > And the most advanced: > ls 2*[tab] ?=> 20*.x with the cursor placed after "*" > > > In the most advanced form, the _completion expands "2*", finds out there > is unambiguous "20" prefix and ".x" suffix and puts them into ZLE before > performing completion (in my case, menu). > > In other words, I want the globbing _complete to behave like non-globbing one. > > > While the initial case is pointless (simply don't put the "*" at the > end), I'd like to use it when looking for specific file types. I often > look for logs in 2021.*.xz form and when there is too many matches I > want to narrow them down, but I could simply type 2*z[tab] to have the > same effect. One more note - zsh knows where the first ambiguous character is, even with globbing, as it's shown with show-ambiguity style. The question remains: how to make it complete the common parts when globbing. -- Tomasz Pala