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, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24793 invoked from network); 17 Mar 2022 19:33:06 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Mar 2022 19:33:06 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1647545586; b=pDBkXTgAJPZXzla0cS0aP6jUcwp78E5KsYhEn721uXR7TmfFBWymu3lM8oJvs06uf65VH6BCF2 L1AOXW0NCm/ZEDkNV+NfHm7SeHPoodXm7PFE31mz+PzCAaCD4mbkAO8UuKE93JAZWbG2VxA/Xf P8esT898GO5I0KjM1Fur9A6mwHOJhrkA4DI65niNohSUZ3S4izfF0U9KncorjyGikrskiErLLs +vuqGuJqX6/OQ7CdNT+osIjFh2tuNosu9jqsb8xxc8cq+95ODBGQPfaS2htjBPtP/b7Dh/auEG 430SgY3XQjxjMyFCZR5v+0DFBxQSya7i2HVajl/X5Yav2A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pl1-f179.google.com) smtp.remote-ip=209.85.214.179; 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=1647545586; bh=L/NC1m+OZBVnwjyLFfwYGdHEaNeZBKQjGNgO/UdcKPo=; 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:References: In-Reply-To:MIME-Version:DKIM-Signature:DKIM-Signature; b=AmgPHJOYQ7PZDF3B9CjdGCfhd1LGJp1ESJUHO2ojGIwjf4syGiql8vXYv9VEa8ZL/We0YlYTq1 DtrRvFjukmvj+JKLrfZCBdLwRAk0soMkVtGYVh8IPVFpBfdFDkimTV2QS+QXnfQvZ7U5IyaA/4 mn9n8juB7JiuGAVOdK0x0VZvUchSpwl3V/M3AUZ7IzNzZ+bFHNxAuuuUsOot3e5G5JgJiSGGks Xqmwl5dE6KswnZdV1WTZpdOwQKVDa+nvb8tDEXgFvH6Xa9r1F/4pH+JZDsYQIOeeB8GAjgbQhR zRr7VeF7GBH1OScluNxfL7MqmHVJsOWzWZy+SE3dplxJfg==; 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:References:In-Reply-To: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=9R5EPFduVegqQaHAwlsA67D3MAKd2jVDifVb//Xp6y8=; b=E8OVUz8tLtv2xHD8LVmHhwiQXF mzMUHNgMLwa0buPLtHlDlWJU2nNdb1dG7VYHriO31fQIHDZFbV1ctNYnPSwnVqDktWvisjtIZQ43g pF9HC45sw9UYmBzfYbYVTQgD7QHQ+dLtezKv+T8hMsbqbakBAyUyfqPgfbBmhTyVZs8CShxQaCtwc CDNMMuQTcKpd8TqJlpyYvZa0TVP4fASO+6Ctly66IzcOZArP7mRBY7xaUBhzecJ6Mg9h3QdT2q1Lt KdQIIfG/hDS9AusR7gndHWJG0doDtWe39ZRjoReippzi411YdBIE/7dvJ5OXMTRhz2cM/3lp207Rw ww1hc4pg==; Received: from authenticated user by zero.zsh.org with local id 1nUvrs-000444-Kn; Thu, 17 Mar 2022 19:33:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pl1-f179.google.com) smtp.remote-ip=209.85.214.179; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pl1-f179.google.com ([209.85.214.179]:40611) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nUvre-0003jD-Sz; Thu, 17 Mar 2022 19:32:51 +0000 Received: by mail-pl1-f179.google.com with SMTP id h5so5285744plf.7 for ; Thu, 17 Mar 2022 12:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9R5EPFduVegqQaHAwlsA67D3MAKd2jVDifVb//Xp6y8=; b=GLZjgiHNszn/8SAmhKsytL2hkLeWb6xDr1js/bD58DBjfV6AMWWpiwnbmjTe5vhHiY REUoHefwkygRa5UbUbTI6yfZDTcX1wULSVvP5Etxs1eyotPI0yhpVaul7XHGSa07/GHz QIx399+ZiGM/F82oDk2lUKBY/uFcW7gF0QOWCHjPkxdjrkumcahiMRmRNEoyjJxtRGbj RJHvVFKNb6Se8T8X7meit2I/CfDknP1Jq8L/mfCyyJlly9iLRLdvOYZr32ze+RF58qYS zR5jGsqPp9EyRsFIsV8w7dqRATGjO5DBGPft8RWIbcso2UzGyMYhwButxgny62RI90JM VFrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9R5EPFduVegqQaHAwlsA67D3MAKd2jVDifVb//Xp6y8=; b=QgXZ+gvv4nCZilsqnNvffCSm7IgNP0R1+BvaJK0Dz97EnE4jQ6SoBJ7LXh4ZhF/RNq RYkPP2rrsNzPuQhLKQtBhs3NO8Lrjz5cr5NOoYQ4aRYz8Zbxbc4vXcYzyY1h1EXqVxV5 HVWFeYa3lPb/G741Xs0IEkMIAy3dCn0l9ZjTzq9gyiLTJZ0bheC8k0m9qGpcIL6DwNgr SSyGXfQcSijA2QpbAbLmibZ0CthooZH7CH6OWDSfc3XTvg1HEY67DQptkiVDQgsgTv/M MMoyy3QFKCcwzB23CJv+YMM8lW1Gc1q5uE3vhNvephv/Yp/+pc27IKTb7emDvm2Oxu2F BR+A== X-Gm-Message-State: AOAM531Y8fxav+XJY6JwiQ6DD6YtZXaa1qlV2cG/NbYjBxmN0Pno5f+X Wf4Wbng3MB+E/ChpbXtxguV4NlSPvCoBwO4BlhtEyMwN X-Google-Smtp-Source: ABdhPJxEFc2XfWcaA6pdSat/GzNtFaUvCEhRj5BaEjtYWC9Yf1rTV8IDS1okvoGTE5KfqvxdTiDDt+76h4kmhB3R8oc= X-Received: by 2002:a17:90a:bb0d:b0:1bd:3baf:c8b4 with SMTP id u13-20020a17090abb0d00b001bd3bafc8b4mr7303338pjr.15.1647545569437; Thu, 17 Mar 2022 12:32:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6a10:466:0:0:0:0 with HTTP; Thu, 17 Mar 2022 12:32:49 -0700 (PDT) In-Reply-To: References: <20220315115648.10521-1-mikachu@gmail.com> From: Mikael Magnusson Date: Thu, 17 Mar 2022 20:32:49 +0100 Message-ID: Subject: Re: PATCH: Fix inverted condition for unique completions To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 49866 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 3/17/22, Bart Schaefer wrote: > On Thu, Mar 17, 2022 at 10:09 AM Mikael Magnusson > wrote: >> >> Okay, so UNIQALL means to remove only consecutive duplicates, and >> UNIQCON means keep all duplicates. Right. That doesn't make any sense, >> but it does match what the original code does (I think). > > I suppose it depends on what CON is supposed to mean. I think the > meaning is to collapse only consecutive duplicates down to one > occurrence, so duplicates with intervening non-duplicates may still be > left. E.g., similar to the difference between "sort -u" (UNIQALL) and > "uniq" (UNIQCON). Yeah, testing shows that one of the options keeps all duplicates and the other keeps non-consecutive duplicates, while the default is to remove all duplicates. I think the reason it's only noticably slow when sorting by file date is that when the completion code sorts by name, the deduplication algorithm is fairly linear. All the confusion stems from the fact that the comments say the exact opposite of what the code does and is documented to do :). >> With that in mind, I have the following patch instead, any objections >> to this? > > I don't immediately see any problem with it, unless my remark above > changes your understanding somehow. > >> PS the manpage says -V is required for -1/-2 but -J with -o nosort >> works as well which is what happens below. > > That makes some sense, yes. -- Mikael Magnusson