From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YHQfDG5aYmTg8gAASxT56A (envelope-from ) for ; Mon, 15 May 2023 18:14:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0A4lC25aYmSx7gAAG6o9tA (envelope-from ) for ; Mon, 15 May 2023 18:14:38 +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 C38D811DFB for ; Mon, 15 May 2023 18:14:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyape-0007Ju-6a; Mon, 15 May 2023 12:13:54 -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 1pyapZ-0007Jg-Uy for emacs-orgmode@gnu.org; Mon, 15 May 2023 12:13:49 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pyapY-0003gQ-6r for emacs-orgmode@gnu.org; Mon, 15 May 2023 12:13:49 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-64cb307d91aso729929b3a.3 for ; Mon, 15 May 2023 09:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684167226; x=1686759226; h=mime-version:in-reply-to:reply-to:date:subject:to:from:user-agent :references:message-id:from:to:cc:subject:date:message-id:reply-to; bh=2BQ6sd+mfGnt0POlVGc30FG+hXeEyKkqXvoYRDYuKbo=; b=UgKdfK/prIwldi3uJ3klr4Adae6i6kMFiYfG7iGlen2CiSyzcGh687j/hTeYLQPeVX 2EDZp5HeOnkhc2l4Uw5A763VQIBBZ8QmgPfxHRQJYGJFRHzARpHkNVBKCtJ/naXGFhcZ /P7cx3gLh6PUM5kwEJhU5GkMyUchOsWfx0LEJqqlbVDX1oQyrE4Ty+AOHekaJnJ+R++Y h7UZURfw/y8sEX2SyWy9n7IObwYUSpARKWKyhjsOFKzP4pi6P7AWHBK1ckhA4S8D/9AO vVpOw4n+0q059M5nwCmZA5Tw5WC9J+EUjdfhVXpy7B/oa4b6Y09JoyBn85QpASxNZn5g UgNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684167226; x=1686759226; h=mime-version:in-reply-to:reply-to:date:subject:to:from:user-agent :references:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2BQ6sd+mfGnt0POlVGc30FG+hXeEyKkqXvoYRDYuKbo=; b=c3rqmiNMXX0awF/AwGCGjgdCpLQ/9+yzpBQek154FEfVqoSZE++AW6vZa/86mPtWpu NeKS8VzfyKGgHdzi6s7cyih8Ze0PPaYeXZDhRLe4kfDBUBUQZ6jIwu9DYH2KGanlLPCC JE3mw/6aQjmNhJ7UDoL0To8WtIjpC6xS5wbK/PWzwidU4w2FwZrEp9zvt+SDditZzsWx tQKwjENXlFTLvaAPERBpBVd9XRbaVFHYl/SQxCXIuXrhZommF1dZtXCLCrqTaSNgk3jn Kfygqb4FYK17qxNGvNl/QY/nYfhXGNMyY1/q9mnaYYj8iPe58pLrTjtWqNGZfqAaw7g2 IIHQ== X-Gm-Message-State: AC+VfDxJFll+U2A1Wwg5WvB20vvVJQDQH1R7VKt7St0xhmds4NlLZdBG b6q5FAiy1QdTaWVj/3kaeDFnc7XtoIXE X-Google-Smtp-Source: ACHHUZ5VQPK2Jhs5KRmS9QW+FeAyC9a/bDoJbUmiC93/sYZRpW0u78t6DNLdXdsxKiBWsjdenRvbTw== X-Received: by 2002:a05:6a00:8ca:b0:64a:f9c7:1365 with SMTP id s10-20020a056a0008ca00b0064af9c71365mr12737826pfu.30.1684167226656; Mon, 15 May 2023 09:13:46 -0700 (PDT) Received: from Mac-mini.local ([39.171.215.147]) by smtp.gmail.com with ESMTPSA id q17-20020a62ae11000000b0063b8ce0e860sm11997306pff.21.2023.05.15.09.13.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 15 May 2023 09:13:45 -0700 (PDT) Message-ID: <64625a39.620a0220.e2d74.706d@mx.google.com> X-Google-Original-Message-ID: Received: by Mac-mini.local (Postfix, from userid 501) id 4E09E8DB5B0F; Tue, 16 May 2023 00:13:41 +0800 (CST) 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> User-agent: mu4e 1.10.3; emacs 30.0.50 From: "Christopher M. Miles" To: Ihor Radchenko , "Christopher M. Miles" , Org-mode Subject: [PATCH v3.1] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist` Date: Tue, 16 May 2023 00:12:55 +0800 In-reply-to: <64624762.170a0220.fd372.5c0d@mx.google.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=numbchild@gmail.com; helo=mail-pf1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Reply-To: numbchild@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684167277; a=rsa-sha256; cv=none; b=dKtywKFfSA6v8Wd9TX4TV7bQm9OwRnlJndY2fx0MDGr0NwDPk4lrefcQCVKFMSevTDrABk 5YZ0m5gA1py6jiwj/FNVjdDbYocuNdmWCTkuuWJmV5KvEDoom/hCS1OWxocK4ncYpiQbWx FlSaKZWzKGNAkUOkuD+iwU5jb/UUtRjoa2CDatzO5lyw4MvIiNv7Qy1xZrCqpOPc0GHlls 37hp9AxKSOKn8ZiLY1i7HwWhOCdzRpX6bbJBfIuu/p7TojPC3q2hcGuayMWjq4rS0Fy84W Uttn+Wj7TqTjLDDYbv1KOVDUA93FTDSLEKgkeLXw+KHHUvrRemfMZ2+QW9ehrw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="UgKdfK/p"; dmarc=pass (policy=none) header.from=gmail.com; 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=1684167277; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=2BQ6sd+mfGnt0POlVGc30FG+hXeEyKkqXvoYRDYuKbo=; b=WC3LhJIAYhP5o6C/N9hEI/gzmFXpiTjvm8uS15JlOpTt9NDltbwKztPyjMSMjOX7dltD3S Uv6OGcE3wxNLp0Ny2453LYRR9sJqJocpKphDstNokhp8GazAPAbS23PlS7ri+/HQTp25Iz AXf18cgRgWQF67Q+IHReopMY5YVXOiDSnJ9oPAgqSJD9E86VAC1k9S3djzijxwM27MPlMn qVQ78fhOHcXbQySoGat2SBI5qTMMDuVy2Ohpxfp8RU5dCWFZJHiqMy78iVpQP5dXM4Az97 PhVsc96uJxOd2AUwDfVn1g3dpwbq3xduOVIZ6ZGHDVfS1F02YzsvFporMg6o5w== X-Migadu-Spam-Score: -6.19 X-Spam-Score: -6.19 X-Migadu-Queue-Id: C38D811DFB X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="UgKdfK/p"; dmarc=pass (policy=none) header.from=gmail.com; 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-TUID: k0ACBhhnyZAk --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable "Christopher M. Miles" writes: > [[PGP Signed Part:Undecided]] > > Ihor Radchenko writes: > >> "Christopher M. Miles" writes: >> >>>> You are almost there. >>>> Just run your code only when (lentgh> fulltable 26). >>>> >>>> Of course, 26 should be a defcustom rather than a hard-coded constant. >>>> And do the same for `org-fast-todo-selection'. >>> >>> Ok, I added defcustom option, and add cl-case condition on custom option >>> `org-use-fast-tag-selection'. >> >> I do not think that we need to care about the value of >> `org-use-fast-tag-selection'. Instead, just >> >> 1. If the total number of tags does not exceed >> `org-fast-tag-selection-maximum-tags', display them all. >> 2. If the total number of tags is larger, just display all the bound >> tags + any extra tags, up to `org-fast-tag-selection-maximum-tags', >> and add a note in the tag selection buffer that more tags are not >> displayed. > > Ok, I re-implemented the mechanism like bellowing, can you check whether = it fits? > > #+begin_src emacs-lisp > (setq tbl (let ((bound-tags (seq-filter 'cdr fulltable))) > (if (length< fulltable org-fast-tag-selection-maximum= -tags) > fulltable > (if (length< bound-tags org-fast-tag-selection-maxi= mum-tags) > (progn > (seq-take (seq-uniq (append bound-tags fullta= ble)) > org-fast-tag-selection-maximum-tags) > (message "Tags are limited displayed by `org-= fast-tag-selection-maximum-tags'.")) > bound-tags > (message "Tags are limited displayed only has key= bound.")))) > char ?a cnt 0) > #+end_src Updated version which fix the `message` error in upper code: #+begin_src emacs-lisp (setq tbl (let ((bound-tags (seq-filter 'cdr fulltable))) (if (length< fulltable org-fast-tag-selection-maximum-t= ags) fulltable (if (length< bound-tags org-fast-tag-selection-maximu= m-tags) (progn (insert "Tags are limited displayed by `org-fas= t-tag-selection-maximum-tags'.\n") (seq-take (seq-uniq (append bound-tags fulltabl= e)) org-fast-tag-selection-maximum-tags)) (insert "Tags are limited displayed only has key bo= und.\n") bound-tags))) char ?a cnt 0) #+end_src =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmRiWjUACgkQG13xyVro msNOcgf+LLaJYTAPvdkhn/XCgHl6K7rxCFJCmlEPRTblXyTav+SB60CIwgtP5MNH 5GNx94Ipvf71LJnQgXUrO46whR9BlgkhU9pkcG/MHlTZPU6fa2qNGnQY9h4r0KG1 e4d8eMQFq+Av+rBshTUk8eCbeY+gNKizaHXFJMO/H8xTTHJsH3O+6F6iz37GvaNn Ix8Dby0l+nOZuRqsC/KnHMN1vJNnVexsuaDvmkg8+Y2dGoIPR4W+FVESKEUfnrHA IwEuGWamxXcv84xeJInuqpmxoVp1AMg+AzDqflntqCTDIKKPoLg4YEHiPcRztfLu R7gizohFn+6OxkujkMHR6xwzdpOpSQ== =4uZx -----END PGP SIGNATURE----- --=-=-=--