From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MEjTJ6zQY2RqPwEASxT56A (envelope-from ) for ; Tue, 16 May 2023 20:51:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eNHPJ6zQY2TT9AAAauVa8A (envelope-from ) for ; Tue, 16 May 2023 20:51:24 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 05BE71BBFE for ; Tue, 16 May 2023 20:51:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyzkb-0005cp-1j; Tue, 16 May 2023 14:50:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pyzkW-0005ao-M3 for emacs-orgmode@gnu.org; Tue, 16 May 2023 14:50:17 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pyzkT-0006ZH-QQ for emacs-orgmode@gnu.org; Tue, 16 May 2023 14:50:15 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 21520240038 for ; Tue, 16 May 2023 20:50:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1684263001; bh=u1oDuRbdmfrVfgS/nQFdBHnUBSZ0LNs7RGrURnIFzm4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=VrY59jSs2a7jA12viz5EKE6De9JjUUdG87tiO7BECzhWgYpyVmaeY7GYCDVG0v5Vb bvSXArOenvfS/TQJY7jWn06Lry9sFPp61rAaGHB7o5/OJKy1Ekfn6NCFn/heWOwIPZ 88/TikPBOEv4SyhJKJGP1tsW8hsIgGPtk9Wt41k0+4B+GSW84n8MPP5cbg3F4dyJka CcLNQszR4DVQ2A1TaawjGGJplY6LmoE+8nHpBWimVJpxS153NpKccdbrWySr4A6hMS c6Wu61xtm+LGr4NrJbrnjls7oC7LFIy7XoBNP/17YYt0olknNs3/ZtMO9km5n7jvl5 zybBUqOJHH5OQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QLQK24SG8z9rxV; Tue, 16 May 2023 20:49:58 +0200 (CEST) From: Ihor Radchenko To: "Christopher M. Miles" Cc: Org-mode Subject: Re: [PATCH v4] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist` In-Reply-To: <646375bd.170a0220.b1c70.dbf1@mx.google.com> References: <878rds1xta.fsf@localhost> <87a5y8iiak.fsf@localhost> <645fc094.170a0220.4d545.38e1@mx.google.com> <87wn1cgjij.fsf@localhost> <64604168.170a0220.99926.5b4f@mx.google.com> <87lehrgwqn.fsf@localhost> <6460f5e3.630a0220.b9085.17d2@mx.google.com> <87ilcvdknx.fsf@localhost> <64611586.a70a0220.53db4.4151@mx.google.com> <871qjiiziz.fsf@localhost> <64612e34.170a0220.28faa.5dcb@mx.google.com> <87v8gthnc9.fsf@localhost> <64624762.170a0220.fd372.5c0d@mx.google.com> <64625a39.620a0220.e2d74.706d@mx.google.com> <87v8gs4o88.fsf@localhost> <646375bd.170a0220.b1c70.dbf1@mx.google.com> Date: Tue, 16 May 2023 18:53:21 +0000 Message-ID: <87o7mk3y72.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684263084; a=rsa-sha256; cv=none; b=T5M/gmZ4USXpE8t6WrjGJzOYGIbiEvQpZy0q/cLK08CZiPx8pGtKo8nF9rKu962/8QgDjP SxLI3sXG0c2WbGQ2lRaU3WqUfNukMPwJGHrlcfqRiRWc4D52jx+FwAGU+00+FQu2hzyTUZ JRM2Gmtk2Tgg8qUinQnd9CLuqtWRptVXg75f8/qMEBTj29c/1PDbPdJ5pP9N3bkp4o2uLF 8BGPAqt6E2ccvl33JfzGK0f50975TaCYYzPFDs00jc60s2otm6u5QyIhbkYDJSVIk25fvX QA00QcaRYPxrLO+G8AmkeN8O6FAZf9LdAE9Za9xNWaap+SfddhUgvKlociMyWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=VrY59jSs; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684263084; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=NYtQYMgRSrgSOSRNJqcjEPFD7nO95RMM9I23ptI973g=; b=Y2wLTnMhEnsYxlHCl1JYpn92QCsMAvZTKFCDSlpxyDH2RXyPn434F4xlPvaTdffqr3oM3d 9GhiENExoUeDOCP3wDwUg54IHZiqBqtDhQKJQmWhle/QhTIFq0ieAHbZzL2RZ1Rvx4c1CJ y7QyCnrI0KfZTV72idvlABNK7Yl2eE9D8ReSCaYD/BcmGSWcKo3TcfYFvHKOAvTzq7/XMt NhnplRNCCppCZtA+HLu7hJbZHJe2kcaD8qNmTd8MTnPVHH20ed/HdenK7dpZhSGdKorlk1 wsXY4P84OiWyUg/MWMVja+UoGY/HDPCnFBSYWF0dz4WViRdxMLilUa9219WCGA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=VrY59jSs; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.17 X-Spam-Score: -6.17 X-Migadu-Queue-Id: 05BE71BBFE X-TUID: UZCU2n5De/6T "Christopher M. Miles" writes: >>> (seq-take (seq-uniq (append bound-tags fulltable)) >>> org-fast-tag-selection-maximum-tags)) >> >> This will behave awkwardly with tag groups. You may better use `org--tag-add-to-alist'. > > I think here should use `append' instead of `org--tag-add-to-alist' to merge. Yeah. `org--tag-add-to-alist' does not tell it, but it actually prefers keeping duplicate tag copies from its second argument. Yet, however, tags with their binding assigned might occur inside a group. Your code will incorrectly pull them out. I think that the right approach to handle tag groups and explicitly bound tags is showing them all the time, even when the total number of tags exceeds the limit: 1. If a tag is bound explicitly (cdr non-nil) show it 2. If a tag is inside a group - show it 3. If there is still some room left, show up to the limit. My logic is that tag groups and bound tags can only be customized by the user. So, it makes sense to display them all the time - users likely expect such behaviour. WDYT? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at