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=-2.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3669 invoked from network); 27 Jul 2021 03:58:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Jul 2021 03:58:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1627358290; b=PVGK/M8QqxLJuV7EMGnwW3LxW3n9w4aCyfpl6YkxkdYY7215sjyAR7vQuI/grjao4g4cN79U1A etWrTfi7HtoiXOyZLRBUDES9KVImoaxHd08roU4ypIIlBpjtZPnxp49B7bn3Wc7IL3eYCM2V29 pGNjAkEh1SrJjyH/NvlQJQM2OD56b+XmqpW9qe2Sc2fQpAqoxICIJ2j+U5HVdqmqX7fslQVjr7 X6qRyaVba88BNDLI9dZ++9CHtV8Q2tX/8MP0ZMCV40L7EhDtQC5qoxnwd5QyIRer1rSLddBbi8 tizZK4o2Blgje8mE5XKCKBkdhDGTT0efU8mySh4sAayZ3g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd00013-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.13; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1627358290; bh=SzHxpN9+rsAp/pNFv39GgJ05gY+ZXXMkPZQlPOma78c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=JMkQgFWVRhC+esIr+vkUk8NY4Fjm0OzH81tdxA6EtBcP6a9vQjLa88OfVlpVRBup/81wwMYZj3 oSElIkIYuhS750xHxZQYR10SEvrci18plSpyNUR+GKAD6hGPc6WsDUxISxoPaoUe+2SDl3jYDO unlTRn6L3suXiyKVZGUmWfKnkaU5jXGaZPciQ3Hi968EUjl1rXcBfJFbdKJ2BEpIjV4a/hcZ+S AyTkPMiAKsbNmGtQWuUT9Jux0pG088D4+HpL9UrIZH67bx0B5XWJdw7lWT8sCGGad6762il0jU RbPyIAWt6g+NqtRvvcU1m5UgHuAQhBVFBSDK1G4aE/wbmw==; 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:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=eqqs+Gu/uyViJkg+kAe21ZdHi0/HEXPwHb5XJxeD12k=; b=dBwT+QVX4zU8rcrqYoTxBsTAXk moGa7C2ahvbaOeBuUSIORb1ETb6xYzguC1o6PD8bhg2imWDJyi0brBkAag1S4WFYhSZaqrxK9ldWU ms3ALrZfMRtcFzax+P4+lqDksCI0H/6XzKgjK04BsxeDmguKvLRtobDKPHg73jEO0fwPg9XFoIJif tSmN2DsHUJdsxIU/7iV2FEtz2eibFC2ueOYtMqXr3injHwmeOnMYM7PWOqI3lTYnfNYP6FakME5Sz Y+6hvo/JZYndwXu+6NO3jR6RM6DHuV1hg+JZ8jzms7Z511GeJ9PEQadHhUoo2CBya3MR4dtazqmJk uNHggFOQ==; Received: from authenticated user by zero.zsh.org with local id 1m8EEL-0009fE-5e; Tue, 27 Jul 2021 03:58:09 +0000 Authentication-Results: zsh.org; iprev=pass (snd00013-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.13; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd00013-bg.im.kddi.ne.jp ([27.86.113.13]:11489 helo=dfmta0020.biglobe.ne.jp) by zero.zsh.org with esmtp id 1m8EDm-0009Nu-Do; Tue, 27 Jul 2021 03:57:36 +0000 Received: from mail.biglobe.ne.jp by omta0020.biglobe.ne.jp with ESMTP id <20210727035729643.EFRC.84721.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Tue, 27 Jul 2021 12:57:29 +0900 From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [BUG] _gnu_generic completer produces broken output Date: Tue, 27 Jul 2021 12:57:28 +0900 References: To: zsh-workers@zsh.org In-Reply-To: Message-Id: <8FC07840-27C0-48AD-A8AF-120924B44491@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 49198 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: > 2021/07/23 4:39l Marlon Richert wrote: >=20 > Looks like the same bug as workers 48091. It seems the problem occurs if the completion function (_gnu_generic in this case or _typeset in workers/48091) is called more than once during the completion. This causes _describe to be called more than = once. As noted in the comment at the top of _describe, this may generate garbled output, but I don't know how to fix this. In the case of _gnu_generic: > % autoload compinit && compinit > % compdef _gnu_generic -command- -P '*' > % pip3 - _complete_debug shows: +_normal:39> _dispatch -s pip3 pip3 /usr/local/bin/pip3 -default- _dispatch calls _gnu_generic at line 73 +_dispatch:73> eval _gnu_generic for three times with service =3D pip3, /usr/local/bin/pip3 and = -default-. A workaround is _gnu_generic_once () { _gnu_generic; _compskip=3Dall } compdef _gnu_generic_once -P '*' The case in workers/48091 is more obscure for me: > autoload -Uz compinit; compinit > zstyle ':completion:*:functions' ignored-patterns = '[[:punct:]]*[[:alnum:]]*' > zstyle ':completion:*:options' matcher 'b:-=3D+' First _main_complete:218 calls _complete, but it fails (returns 1); why? Anyway _typeset is called once here. Since _complete fails, _main_complete calls _ignored. If the = ignored-patterns style is set as above,=20 +_ignored:5> [[ _matcher_num -gt 1 || 958 -eq 0 ]] there are many (958) ignored words and _ignored thinks it must = re-generate the words and calls _typset again. The patch below for _typeset may be a possible workaround. diff --git a/Completion/Zsh/Command/_typeset = b/Completion/Zsh/Command/_typeset index aecacb112..0976d9347 100644 --- a/Completion/Zsh/Command/_typeset +++ b/Completion/Zsh/Command/_typeset @@ -128,7 +128,7 @@ if [[ "$state" =3D vars_eq ]]; then args=3D(${args:#_*}) fi _wanted functions expl 'shell function' compadd -a args - else + elif [[ $PREFIX !=3D [-+]* ]]; then _functions fi elif [[ "$PREFIX" =3D *\=3D* ]]; then