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 21008 invoked from network); 29 Sep 2020 06:10:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Sep 2020 06:10:39 -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:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=CeDmNMEzvYX+8Xc1QNo8TYme+BXyntuS4OpAU0FEnI0=; b=NxqdVt/E1VNtElZFyDvBRZ9dLW iNUXF9MtnKS6Gf0RgLVyMVbQR0HMBEbh/RQDqWBBoGidTBI11cLTy0Tosh7I+Wm8+WOd136RFH+fA 1I41phhzIGXytTOvryZ5RsyRLEwZK3wywKXJ5U9rGZ82JLvsbTpt5YkGNCH8DSp6G0WUcwr49b4WU cvAy+LMxZ0XzzhmPIkGysdTKfGZ+e6tpyDU7wsO79CRcDfXZPgiE5saHzuIKsNiv6bEoOo2utqGfr EQ2hB1OXdqQEXu8rI4pXUPLwD3OSgwAllX6KhNQe7K9jlOQxInkXno62iw4WMqSKnGAJixRTZ80HC YgrS41IA==; Received: from authenticated user by zero.zsh.org with local id 1kN8qS-0006aD-CJ; Tue, 29 Sep 2020 06:10:36 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kN8q9-0006QN-Rd; Tue, 29 Sep 2020 06:10:18 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.93.0.4) (envelope-from ) id 1kN8q7-000BBg-U0; Tue, 29 Sep 2020 08:10:16 +0200 cc: lilydjwg , Mikael Magnusson , Zsh hackers list In-reply-to: From: Oliver Kiddle References: <20200928153930.GA2332142@lilyforest.localdomain> To: Bart Schaefer Subject: Re: bad math expression error inside _pick_variant when running insert-all-matches for ls MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <43006.1601359815.1@hydra> Date: Tue, 29 Sep 2020 08:10:15 +0200 Message-ID: <43007-1601359815.927012@l4Ug.3FSk.dcnq> X-Seq: 47413 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: Archived-At: Bart Schaefer wrote: > I think the issue is that _insert_all_matches is expecting to be > called as a completer from inside _main_complete, not as a standalone > widget. Yes, I think you're right. > If we want _pick_variant to work in this context, we need PWS's patch, > but there may be other oddities as well. Perhaps 20 years ago it was > OK to call _complete directly like that, but it's not OK any longer. To create custom completion widgets that make use of the existing compsys system, bind to _generic and set the completer style. zstyle ':completion:all-matches::::' completer _all_matches _complete zstyle ':completion:all-matches:*' old-matches true zstyle ':completion:all-matches:*' insert true zstyle ':completion:all-matches:*' file-patterns \ '%p:globbed-files' '*(-/):directories' '*:all-files' zle -C all-matches complete-word _generic bindkey '^Xx' all-matches _generic dates to June 2000, _all_matches October of that year and my use of it, more-or-less like this, is the following year. I had zle -C directly binding _history before that but, as indicated in a comment, it was specifically designed to work either way. At some point I switched to using it via _generic too and that's what I'd recommend now. Oliver