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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5982 invoked from network); 10 Sep 2021 08:45:41 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Sep 2021 08:45:41 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1631263541; b=LrSzit3sXoS0oXgNgBqGROoe9eihk+3/aql+GBa6/j9aL4XybnMu1bK7XJUFgmM4q/Yawz6Rnq 9/ryIIR0eFblov3LhIpfECtX0/gks2qIBbbU67Gw5uiuwL1OqaT/jzf4QV4wsdx77MXWKixcDk KipkTf2J/CxqFei+zE2khbWzTyBjte5lavg2tqjAnOK+Z1ZJjlHOQ0xzHVPRMHAIsGyOsZ9RPw 3jWtg+ss6c4/ThpJXaTDKgh7z/URxrY8UrmEsNr9VLbiBqnQVAPVNdYbHchYokFtcFqswuXnHf 1WsCK2x0rPEmDUNj8NlvfcFn4dvm0qmeZFItN6frmsRrBg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vk1-f177.google.com) smtp.remote-ip=209.85.221.177; dkim=pass header.d=gmail.com header.s=20210112 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-20210803; t=1631263541; bh=GNc1bEajZrGu24+UaRE89RhFbGiECY7UFe/SzkUhPD8=; 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=NMxp2wnaPa8w5JKnHzFQnkl/ddIQshl3iiT2CCpvTsvsuEd4agRx761jfea26K3aiKsx8589PA O7xZZkEDSoZh9opsdc8GWarL1wnr3zk5YNgM6td0jsSjdIe9fouSOZyxHpSRILNdthBjkrwoFj Pm7GbPwK1mrkD/fxqetgHUtQ3Oomk5MNRgy3NQ293np/5pmEXYbPc+VPb79jqpp6lhJ0Fjuvzq xH2zv+cFQQaxpzhBEutCRew2NZVPpTe/wiQ1MFdzc8f0WhktW7CA/winZf0vuD+R/P8TQBrwiS tfX4fop7IWgJa0HTkU+KAHzCrR71fXJqok3cCet3/VI7HQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; 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=GNc1bEajZrGu24+UaRE89RhFbGiECY7UFe/SzkUhPD8=; b=rTXM3Uhdycl47ciSibHwIE6aAS tlgojMtgaZaU+YaIR0Mhaqu1wgYISW48euodwSAD+T4A//MKJEvfTUxtSMafzZbZdwBZj6FTrvK4K BGVf9sBPmGbzYtKcjW9nYhUHHZaNZkP7K/UbrEqtjy6Blpo5MHCDnpitVcKW0FNXj7CG6+iEG2BRY iehQAqV4K1DA3Lq8bNDDXoBaSmD9pFK5t3yDHix+Cz65FOWqDOgNywjyaphdbXIxT2FupgFGD5D5y xqeT14KevQ1/G9CBGpFTwOnUSB/mwXMnbab5vaJ25OWHLVqatLpwVDVJmk7umFGr+l41mzL7eYYGd COGKoyJA==; Received: from authenticated user by zero.zsh.org with local id 1mOcAF-00045J-Eu; Fri, 10 Sep 2021 08:45:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vk1-f177.google.com) smtp.remote-ip=209.85.221.177; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vk1-f177.google.com ([209.85.221.177]:36569) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mOc9f-0003o6-9l; Fri, 10 Sep 2021 08:45:03 +0000 Received: by mail-vk1-f177.google.com with SMTP id t186so367122vkd.3 for ; Fri, 10 Sep 2021 01:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GNc1bEajZrGu24+UaRE89RhFbGiECY7UFe/SzkUhPD8=; b=JEIQKi123nPXZG/B0RDXDyEP/JsdDqEq3JHq5Oqzl7uxt8Slk406LFRf7HDS6efuK3 IGcN/4FS0+CtkDeErhCeXkBP6Uk9icMj4nYKuA4NshSjgxtTlnVx06EzGoR13AZ2A957 vGPXrB7RzpPwWF5i6kpk0flxocel6PSYuINGykTYsM3/N8J75CDeKU2QXHRekFPjRjYf ETQPLZ4GguZtOD7zoKvvgN007aN0GS4JlajZVYabP++jKEffNPke6h5qM1cpPbKP5W+g a6YUndw/4ZzSRTfMD5wrFOoTfeuU61KZ0DfTfBZALEmqy8LAYgWad4AFr/z7EO/sq2vG BpXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GNc1bEajZrGu24+UaRE89RhFbGiECY7UFe/SzkUhPD8=; b=fAJOdZE05fzcd4NX/vORZl9LlO/CJfJxkUXUVwqF0Q+NJPJNv1UUgbiIpMeuksRyKK sSrGutFQxoYbMqga/3RHQ3gBsRjTdK2jr+Q9ByNc/O421tPQprt4bN9TyGXL+X21fv+z fpT9ag0hUGNGvntL1Dl1clnD+KERBVZ2RBu5MHuHeqFhj1UOefWrwsse41Te4HFy3OEH iW0pmoUM66GCnN2wXIBi/Lk/L1P8nsUh1MLidt/QUt4KbdnoTS1025xvczjHv0dczfBj DQPFkUXW+ASq8jrbr6vnogopqOZT41++zky5TpYrLvGuJIIvXKwsdUFtVEOP6uG0E4hH n/2w== X-Gm-Message-State: AOAM533OziFwMJjtVpwKWsCFJMZ1DTOCKceWgr4sAHcTteO1FOKxM0df IfvakTV3EKNxV5g7sxW5Izr04S582Cz2B/r+DWw= X-Google-Smtp-Source: ABdhPJzuY+L1xs+k+kCRN1RlM80ARY7lTI/2GU6SVzF2tjsrOo29S88uCl5F2cjocjwF1X7mtNXq3sNeZ8Aeqby4j6s= X-Received: by 2002:a1f:d902:: with SMTP id q2mr4613565vkg.20.1631263502068; Fri, 10 Sep 2021 01:45:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Marlon Richert Date: Fri, 10 Sep 2021 11:44:26 +0300 Message-ID: Subject: Re: [BUG] _describe -x adds same completion group header twice To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 49405 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 Thu, Sep 9, 2021 at 10:04 PM Bart Schaefer wrote: > > On Thu, Sep 9, 2021 at 9:50 AM Marlon Richert wrote: > > > > When _describe is called with -x, it adds the same group header twice: > > I think this is probably the same thing as in the thread starting > workers/48091 (Bug in compdescribe ...) that was partly addressed by > workers/49211. The problem still exists on master and it looks to me like it isn't in compdescribe. Here's a diff on the trace output from _describe without -x (a) and with -x (b): % diff a b 8c8,14 < +_describe:36> shift 0 --- > +_describe:22> case x (o) > +_describe:22> case x (O) > +_describe:22> case x (t) > +_describe:22> case x (1|2|J|V|x) > +_describe:33> _jvx12+=( -x ) > +_describe:21> getopts oOt:12JVx _opt > +_describe:36> shift 1 26c32 < +_describe:68> _next_label values _expl desc --- > +_describe:68> _next_label -x values _expl desc 48c54 < +_describe:114> compadd -2 -o nosort -J values -X --desc-- -D _a_11 - foo bar --- > +_describe:114> compadd -2 -o nosort -J values -x --desc-- -D _a_11 - foo bar 57c63 < +_describe:134> compadd -J values -X --desc-- -d _tmpd -a _tmpm --- > +_describe:134> compadd -J values -x --desc-- -d _tmpd -a _tmpm 60c66 < +_describe:68> _next_label values _expl desc --- > +_describe:68> _next_label -x values _expl desc % The problem here looks to me that compadd -x *always* adds a header, even when used with -D, whereas compadd -X does *not* add a header when used with -D (since the operation doesn't add any completions). And because compadd treats -2 -o nosort -J values -x --desc-- as a different namespace from -J values -x --desc--, the header ends up being added twice. Which of these two should we consider at fault: _describe or compadd? It would be trivial to fix in _describe, but I feel like it would be better to fix in compadd, so this problem cannot possibly occur again. I find it hard to believe it is ever anyone's intention to add a visible header when calling compadd -D (or -O or -A).