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 19912 invoked from network); 28 Sep 2020 20:42:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Sep 2020 20:42:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1601325757; b=pYU9gB7Ci87n7EcNI22KZX7gT9Lh3g7zY/fuG4aDcDA0olwpOAw77fxiqzRHUT0wH3bM4NJ3lQ FUnu4ymSkSrHbBftGaYfNlnbZF9JAHQ5G1bgxgTlq52WMu9oY2rNdoWiPE+LPcRThMib1ie72H +6VS6bqP41CJISASIBuu3gQ7vuCInfvDRkf3VilDz8Mx8/RbYgpMyMbJliBI4UMotFHHjj0YxD ybF3xXYg39sFOltRkvme3SX4YXDfsdAQqihaDhmt8mmJxp/c0KMLj6mcLqmZvUpc2YI3V7LRJ+ 11N1Z4KAKTyMbNwlaqrUFNL75+YlfiVY/WgIUWhHlpAz7g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oo1-f48.google.com) smtp.remote-ip=209.85.161.48; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1601325757; bh=bzlqrS4Wqr7Rv2XBPFYbUidVKx+wMh70whhvAMUGF5I=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=U5HcPtuJAILOXCQFHH8NYU7Xle0RPXXkcOkWno5JyKUbcslKHHahrHs+8CVGZziHi/DnRqx60n 3+vs7LB4OrkiE3xBDWIvyZpcZ49+Wsnva32vCJodwGbcnu8PHGOKgLobWetd7rmgXgUG1fYRop tCJH0QBoxHzuFndUDoYU07NyxGhCgbncLLbICfmn6hYj+T//i5bzxuNMIdocL/qfv5CtCO8MFr MN0nD4b2dIV/ZkYMRy2t3EdWwBGitqqXPpWizfWXSpaLarU/Mi5K/ve0UNyGxh8UyCEMDWsfgC iwjJDlK2LCCytf42b44ifGfBreHg6P94n2ZFLBAO7Cm4Tg==; 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:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References: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=2+e0XPmIaOFDmi8Bzlm6xOF/PsszfY/93optn6s30/w=; b=Y4RMweyMh86PZ1DcXcjN921vfx ItrlKJKzA/Z26nYSsP/f384AC0gQxm1chxhtJakauJz72wvDPkNRs7i5UychDtWbNZqkjS0Z0EHKu VAdL82MnfqhyUnnR1dfh+H+wIZL1t02A5P4QJlxB+c7/7jok8rjJBRNLWd2H+j8ee5Hz5OUFDL+ab PeEbkskYEXI8sbCbEaGhv+zyXOa1BcjKnaCuk2QzDGX1ftOHPJPcs7+yzdv2NRwp07INxnrZcrXrP FIxz3hNxR30gwVhk94xQFWxhpYPpWW6Sa0yFqwszq0oXUrUIAoJUHah9RnED3lFvaZXDZ4aQHLicT F9L/xJlw==; Received: from authenticated user by zero.zsh.org with local id 1kMzyj-000FF8-7a; Mon, 28 Sep 2020 20:42:33 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oo1-f48.google.com) smtp.remote-ip=209.85.161.48; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oo1-f48.google.com ([209.85.161.48]:40533) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kMzyR-000F1M-Po; Mon, 28 Sep 2020 20:42:16 +0000 Received: by mail-oo1-f48.google.com with SMTP id r4so681952ooq.7 for ; Mon, 28 Sep 2020 13:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2+e0XPmIaOFDmi8Bzlm6xOF/PsszfY/93optn6s30/w=; b=aKW4zaE2Y9uA8TrdGIZIZ1uebY8+Bh4d1WL7/IzuSRJCN3x+I5rEim1+lgaFivkDiw elBTAbahbslhNkoB74gGCdYdv4Yw0UiTjmKxrT+WiycpaMngKcbZvrGvFvJGkpzTXTwY kkAvBv+F31T723CzSN6tbJy5dgWnO9iFezAxXXKb4uYkm/ryhrtXCzK8lQxQY/+QLt/b kAU8p3HoBWBvasD7pWhYX43119m3iTz5pWdDsidQ3dhoUbrVyv/D6yrCe+W0sarH++ap VtH03l+PqE8+BPfkn3wuKLevtcQiWTdrlYKgGHp6c6UEk3rIkfbWpJ7cx8gSKiP8OeK/ VhSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2+e0XPmIaOFDmi8Bzlm6xOF/PsszfY/93optn6s30/w=; b=oeMzWCyrqfjd44vb8z7h10p9OttxPoqLUZ6Z5v7b/Odo0gkwLiAhXtznXbANllhrx2 qUmw9c8lLCFQ0UhU4bA2tX3vmCxFu/G34eDrTF2NQWNwY1QvcczyxqESYQ4jHa+cE72Q guz72Q/L4rTAiR8HX0fRhnFgAPlueQSkJr2y/G2m39SfK7PEcu0GQZROaGtrNsHelrR0 xdY0POkMPtjqCxUTghNkiO0Mg1pi6GL+8hMR5VhCDn1Z7j3WTXvxKYTIcoEeU0GCGUFG 5Xu3uTRd6fvHblZGvgoBaE3XfNA840DssNODeYQz+niXKVq+lSYzXWES8a3aCT69D1s4 6abg== X-Gm-Message-State: AOAM530djqtH4RKL4eu84vNKsyXp8JxPQ3qIlzGgVdvk4t6DF01JufDh aUknN+trPYNfAojm+Eh18pNe41SVLRACwWv3yyQgGQ== X-Google-Smtp-Source: ABdhPJx5JCiHyEcUngd9qsA17CpwvpD3KSDn4scD6c59FCXhyhgoAwzv5uzZZXPleOLL54HLE+bCoDXKejs5U7LkdK4= X-Received: by 2002:a4a:e75a:: with SMTP id n26mr2085940oov.29.1601325734304; Mon, 28 Sep 2020 13:42:14 -0700 (PDT) MIME-Version: 1.0 References: <20200928153930.GA2332142@lilyforest.localdomain> In-Reply-To: From: Bart Schaefer Date: Mon, 28 Sep 2020 13:42:03 -0700 Message-ID: Subject: Re: bad math expression error inside _pick_variant when running insert-all-matches for ls To: lilydjwg Cc: Mikael Magnusson , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47412 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: On Mon, Sep 28, 2020 at 10:52 AM lilydjwg wrote: > > I'm sorry I thought it came with zsh, but it turned out that I got it from a zsh-users message. Wow. That's from Andrej B. back in 1999/2000. In fact I can't even find the message that actually defines the function, just a couple of the ones that discuss what it might do. > This code has worked for me for a few years until today I noticed that it didn't work well with ls. I can reproduce from zsh -f plus your function. According to _main_complete: # _precommand sets this to indicate we are following a precommand modifier local -a precommands 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. 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.