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=-1.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,LONGWORDS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 987 invoked from network); 28 Sep 2020 17:52:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Sep 2020 17:52:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1601315523; b=ABiI5BWwuaKnY/fdyxwubjsZd9fisiEdcfZxlVwS+MvTwXQ7M55PXbuJTTsL2R8A0CfVCCtJDU TCbhIM+vHeDDdD4FZNGW78LNVo032HSrfUqt7UdDn3EsP8eSBixpfDhlR4wLpukxYSj/ad3VRo pzpgeLa3LJZSRkUEAEcMUXsuY65EX1ELMFOXVzJ8rsDMFsBpwcE0rt3XIYmgrQNFlsPYVxlDpJ CYM0//bgJdfNJHZ3W9lv5iv+6cCAnMlPs/hTsYw0aCuwIsu8u4je7RKXGol3tzA0497aztg0Ke OWmVlyG1U4R9/oiW3rmveBj9rlQXqy5oHdP1tUpMpJq63A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f44.google.com) smtp.remote-ip=209.85.218.44; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1601315523; bh=y74I5CT4Z5ZzNalN66vK6sIxeUPG54sk0jtSbYj3hV4=; 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=LdegYcC2fmK85xx75anF4qGtM7bLmci+Z76SP5gK1t7ipSkZdHbHNUB7P9X1Xc4f1DVm2Lgb+B 0bg+5h2iUfwKbX/S+kb1t8l8FHHQHqTgbWUH8bpbExV74Rf1qb+xbcVYN9YpsrZP5r472iL+xo Q/7kMAZ2N05Bd+A9hrVIr7npPhVG4TY5bHRcpIJw0seA04MWRSE94La/7GMFwPFvlag043fRj5 6zEdXZOt9jSNHrD1/NzBIuQaWLU85C07oyRDR1Z3Ln2DUAZOyp3+oeqJYa8OwqGP2aZbi5YNSX tuELis7ESKvr9DC/UfplMpy4YRVCw2lKCVGTi3Av7n5VBw==; 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=x3z6y31/DvpiMzsnAu+jE7wl+CJVtyUQGS4es//INHQ=; b=WhnSSn8wokARGBdbouvYZASlPJ nR8nHgAgzbu9mto0pfA57gcfRijUjPUxqdVrdzzMXXFhG6LaSzUSdYav69TFfzUg/NFI07Z8/8qes LvtK1a2KOe+379KJYplin2K2PKI8diVX+qWIOVCq7WbArVl0UkTYXXZZdcywH85h2FZh24+xIpD88 3TsLt7vjLXu934++qj7Ib2JRnGqwMXI+jJRj+pwEcycZwuLb9ksSvX418z4R42n51+b6VtBfYQTNt QOrjoL5RARjd7rWruVew5g5KwXq8NF+MLCnvHY3n51QAxQ02iRe8W/pysBQ09eXsD3I0+gOyBfUh8 bG0rkOGQ==; Received: from authenticated user by zero.zsh.org with local id 1kMxJf-000AKW-Ey; Mon, 28 Sep 2020 17:51:59 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f44.google.com) smtp.remote-ip=209.85.218.44; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ej1-f44.google.com ([209.85.218.44]:42353) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kMxJM-000ABB-7b; Mon, 28 Sep 2020 17:51:42 +0000 Received: by mail-ej1-f44.google.com with SMTP id q13so9822900ejo.9 for ; Mon, 28 Sep 2020 10:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x3z6y31/DvpiMzsnAu+jE7wl+CJVtyUQGS4es//INHQ=; b=XKoVYfKk/kHvRAw8AeVtwuaduOMdqTdvUE44OMtbFxwiLmMTSGzOojtkMa4NysFqy/ w7cU1XmwgkDMC6ZJW59+JCWRgeGu23x8b1ChJo0Ckz1UIeWBGPyMUXepmJcwgouiHcnA Qdi9akJZUyKVYF/S9vmGimGxs1GpX9PbOLd0JmF1eUQM8YgLHHO0klxT4D741Mlrkw8k pTsxAgs6QsRoegpTvrflRQmY7enu7OSn9r+XhDD8m9u5XllXB4wxrVy+uDTayDmNBOPK UkeHJ4Y8IvwkmF4ywPZXgzGYOU6mZ4NRY3ZF7M5woq4DFYBS1F7CKCww/vLtPRVWSm9a d+tQ== 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=x3z6y31/DvpiMzsnAu+jE7wl+CJVtyUQGS4es//INHQ=; b=jOaZIsTAGzNIAD+ZdeOGQM4nhsRoe0lwoLgxUdsHdRY5hm4vK0VXmKHZ6KFOYLhs3S a5Ql61E/HnriHPOVqD/3MSMEnEDUTei5/tkcNF/ZvzRuwarqzL0ThHX9+916O/x3lDo9 /v9CUTeKRgbiQlNM+QkZFRTgT5mn1A5MS8CISffaJMWihXvuwHE6JCUPFsyanhFZEcPi dz10VxNfizQY8FnLCpUIkDZvLTZTweh5Vn8X6AfqO1WKc4s3bfandT1b2C+LABi1l8Q0 97QW5WHg+7tVPAWy64hKDYb6a6+Wuf0NrzWYvvTCFuti/HV3cKSv7nmHf5av1o47/9jv AchQ== X-Gm-Message-State: AOAM532adkahnep1puEW+k4X5dgQ/6EC0o8Ef7JGwZsuNUq+rH0W2gAT 8x4OK4WjhsJgCFm3RkC35k+Iu6siyL/xEiDsHzk= X-Google-Smtp-Source: ABdhPJwBNMB3hNdsX8OoZbGbRWgaXi5EUAghn7Hr1WgQ04KTPEvUVToE4G1gVp3eCZvkMnTCqJ9yqsyFSJ5QO1qMQTw= X-Received: by 2002:a17:906:c8ca:: with SMTP id gc10mr2660223ejb.461.1601315499608; Mon, 28 Sep 2020 10:51:39 -0700 (PDT) MIME-Version: 1.0 References: <20200928153930.GA2332142@lilyforest.localdomain> In-Reply-To: From: lilydjwg Date: Tue, 29 Sep 2020 01:51:26 +0800 Message-ID: Subject: Re: bad math expression error inside _pick_variant when running insert-all-matches for ls To: Mikael Magnusson Cc: Zsh hackers list Content-Type: multipart/alternative; boundary="00000000000087104405b06351b3" X-Seq: 47411 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: --00000000000087104405b06351b3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm sorry I thought it came with zsh, but it turned out that I got it from a zsh-users message. The code is _insert_all_matches () { setopt localoptions nullglob rcexpandparam extendedglob noshglob unsetopt markdirs globsubst shwordsplit nounset ksharrays compstate[insert]=3Dall compstate[old_list]=3Dkeep _complete } zle -C insert-all-matches complete-word _insert_all_matches This code has worked for me for a few years until today I noticed that it didn't work well with ls. Mikael Magnusson =E4=BA=8E 2020=E5=B9=B49=E6=9C=8829=E6= =97=A5=E5=91=A8=E4=BA=8C 00:30=E5=86=99=E9=81=93=EF=BC=9A > On 9/28/20, lilydjwg wrote: > > bindkey '^Xi' insert-all-matches > > > > And then type: > > > > ls ^Xi > > > > There is an error message: > > > > _pick_variant:19: bad math expression: operand expected at `|| 0 ) ' > > > > I'm using zsh 5.8 on Arch Linux. > > You should either complain to the person who wrote insert-all-matches, > or provide the code here, otherwise nobody has any chance to guess > what's wrong. > > -- > Mikael Magnusson > --00000000000087104405b06351b3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm sorry I thought it came with zs= h, but it turned out that I got it from a zsh-users message. The code is=C2= =A0

_insert_= all_matches () {
=C2=A0 =C2=A0 setopt localoptions n= ullglob rcexpandparam extendedglob noshglob
=C2=A0 = =C2=A0 unsetopt markdirs globsubst shwordsplit nounset ksharrays
=C2=A0 =C2=A0 compstate[insert]=3Dall
= =C2=A0 =C2=A0 compstate[old_list]=3Dkeep
=C2=A0 =C2= =A0 _complete
}
zle -C insert= -all-matches complete-word _insert_all_matches

<= /div>
This code has worked for me for a few years until to= day I noticed that it didn't work well with ls.

Mikael Magnu= sson <mikachu@gmail.com> =E4=BA=8E 2020=E5=B9=B49=E6=9C=8829=E6=97= =A5=E5=91=A8=E4=BA=8C 00:30=E5=86=99=E9=81=93=EF=BC=9A
On 9/28/20, lilydjwg <lilydjwg@gmail.com<= /a>> wrote:
> bindkey '^Xi' insert-all-matches
>
> And then type:
>
> ls ^Xi
>
> There is an error message:
>
> _pick_variant:19: bad math expression: operand expected at `|| 0 ) = 9;
>
> I'm using zsh 5.8 on Arch Linux.

You should either complain to the person who wrote insert-all-matches,
or provide the code here, otherwise nobody has any chance to guess
what's wrong.

--
Mikael Magnusson
--00000000000087104405b06351b3--