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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21864 invoked from network); 2 Jun 2021 23:24:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 2 Jun 2021 23:24:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=fGfNFyb+Ne6k5rhtmgzDDq0LD/sX0tIpJMVRVotbZqY=; b=C86+RZCm3EN5ZbHPaOSpmjRWFJ 9R17I17vLChLXlSxkEr+5ViGz82ouitPWF+6s8lH9AnKTyadSD+DB7ggfYLOG4EhgTG441nGA+4xl ChppqOz7A9LDVjBgifMd6lXXSVAMP7mEq9tqVfj7kATnzTjGlkPwYBj1yLdEk0nJNsMqMls1f1B3T PhhyLTKLBp6t+rQKrpMpFoBXtzYnif4cl9yT++K0a8JjpgexvqCE0sVhYNSE6jYNoDUdHFKMsai9y fBc5AaV5gNM61V77LlQLpHVvtMCBxVoZ7pPEJeD1gbXI6S+rkXBlZ8jYxEg2AMBO27BTJVOr8Y8XU fMyEtPDg==; Received: from authenticated user by zero.zsh.org with local id 1loaDb-000Jsh-Vu; Wed, 02 Jun 2021 23:24:12 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1loaDO-000Jc2-5W; Wed, 02 Jun 2021 23:23:58 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1loaDL-0009QK-QQ for zsh-workers@zsh.org; Thu, 03 Jun 2021 01:23:56 +0200 In-reply-to: From: Oliver Kiddle References: To: Zsh hackers list Subject: Re: [PATCH] Make _expand_alias more usable as a completer MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <36226.1622676235.1@hydra> Date: Thu, 03 Jun 2021 01:23:55 +0200 Message-ID: <36227-1622676235.815398@zrY_.ZerV.zhJL> X-Seq: 48992 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: On 29 May, Marlon Richert wrote: > When _expand_alias is invoked as a completer, if 'complete' is set to > 'true', let _expand_alias always return 1. This is analogous to how > this style behaves when _expand_alias is invoked as a widget or when > the _expand completer's 'accept-exact' style is set to 'continue', > which allows you to put it at the start of the 'completer' list. In practical tests, I'm not finding that this works too well, it ends up removing the characters typed. From _expand_aliases, you end up with a call to compadd -QU and later you get a compadd -Q. For testing play around with the following: _foo() { compadd -QU 'ls -al' compadd -Q lsusb lsvfs } compdef _foo foo foo ls I can see the motivation for the feature but it needs compstate[insert]=menu to be usable, at least from my setup. Setting that tends to be applicable wherever you're using -U to change what was typed so far. It feels like a bug that this example can't recognise the unambiguous "ls" prefix but aliases often expand to something quite different to the initial alias name. I also wonder if this would be better done from within _command_names directly but I'm not sure. Oliver