From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aAZLCp1HYmS1lwAASxT56A (envelope-from ) for ; Mon, 15 May 2023 16:54:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id I1kVCp1HYmSLIwAAauVa8A (envelope-from ) for ; Mon, 15 May 2023 16:54:21 +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 DF8A713F5A for ; Mon, 15 May 2023 16:54:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pyZZp-0005EL-4K; Mon, 15 May 2023 10:53:29 -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 1pyZZn-00058x-CA for emacs-orgmode@gnu.org; Mon, 15 May 2023 10:53:27 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pyZZl-0002Az-H1 for emacs-orgmode@gnu.org; Mon, 15 May 2023 10:53:27 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1ab267e3528so91823845ad.0 for ; Mon, 15 May 2023 07:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684162403; x=1686754403; h=mime-version:in-reply-to:reply-to:date:subject:cc:to:from :user-agent:references:message-id:from:to:cc:subject:date:message-id :reply-to; bh=5h+gY3ihF+UMROk1MtAgzqZFL4HNcsvgWPH4QhehCyU=; b=Qs6z5Twwg0yQ2xc+Dajnmw1Pn1YHcDgfggjjsKq41I/lu2kgcg4Sn7D33J8TFAjDpb uvmUMyKIhXgyTOphEOakmJ+a8ZHRy0BlHkFT4pwhG1ckT0O/b4kCrOvfha6qVccs8G4R 0+xsz3LM6KYOWNpgoLEbTzNCHT6CLifkdAm5V4KsinIE5zVkNEF2/JgauhZ02IZFLQc4 lszIPirmu8WzC5OHrg1Mkp1wrSzZUNlM9UZBeYtnvGJ3ORf9afPCEUixkvJtdi99ITxp DcoPOSFwn3KVKjuqIfpL30YDDVTzbebt9DEqD8UGUFwDvCH5uJ+qupMb2uqgUQtANfjN nsHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684162403; x=1686754403; h=mime-version:in-reply-to:reply-to:date:subject:cc:to:from :user-agent:references:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5h+gY3ihF+UMROk1MtAgzqZFL4HNcsvgWPH4QhehCyU=; b=AxGXhsykh+LIR8xoXxWr77mc3No0tZQ5QYtt3NXJgUwfoBPhtc5dftLVwEuhz+GkSb o6AxoOACO7Z3u4kO8KAhSlny5nMHlXFJ/xS+oOba2vv/rUzfr2nbcK+ikouyk1tpF1ns Nz+nI+Vi3zkwiMWIg55Laf71hWbeqRmrJGKbUUSDTW1UJt3U7mTc7gc/kG4hMEdzBe2H lDrIG1GJowybV3Oo5blAlcDHyCgQyncug8UceKjWX0CxA6ATwNj5zuD6a1kCGXJGAfD+ JlIduekYfzVLZpuF+tjJYl55u2Jx3ru3DwRWwqktxa1kozXCN88/v8QESTsaZu7mxVRV 47lA== X-Gm-Message-State: AC+VfDzeBBQJ+vIn7nFgsF6YlTVD4TopMax8Pujf9Jb/WIqwTwyGfAoh PGsgYHi1cDbk3pE1NtjhemLHUVKR3iW5 X-Google-Smtp-Source: ACHHUZ5lb1UXPtKeiO23mZkwak3SGO5Wk4Or+kMNKpLP5AoG2I7mjN79wZvkdscrTlKA3A/ZjlcWvQ== X-Received: by 2002:a17:902:d714:b0:1ad:f138:b2f1 with SMTP id w20-20020a170902d71400b001adf138b2f1mr11299263ply.26.1684162402822; Mon, 15 May 2023 07:53:22 -0700 (PDT) Received: from Mac-mini.local ([39.171.215.147]) by smtp.gmail.com with ESMTPSA id n18-20020a170903111200b001ab061e352bsm3636453plh.195.2023.05.15.07.53.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 15 May 2023 07:53:22 -0700 (PDT) Message-ID: <64624762.170a0220.fd372.5c0d@mx.google.com> X-Google-Original-Message-ID: Received: by Mac-mini.local (Postfix, from userid 501) id 119BD8DB20F4; Mon, 15 May 2023 22:47:09 +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> User-agent: mu4e 1.10.3; emacs 30.0.50 From: "Christopher M. Miles" To: Ihor Radchenko Cc: "Christopher M. Miles" , Org-mode Subject: [PATCH v3] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist` Date: Mon, 15 May 2023 22:40:29 +0800 In-reply-to: <87v8gthnc9.fsf@localhost> 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::631; envelope-from=numbchild@gmail.com; helo=mail-pl1-x631.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-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684162461; a=rsa-sha256; cv=none; b=KDp7YCcDyAhtNnloMCLawL8kg6ZWXiFdkJVV5d4MD+Q4ZNJPaX+P/iuWc4uypptQ4JOocV kNV/P+wye447DigzRkAJWF1j4FzfDYPMxI+oY/RaIHEMVWlz2eEntycJrZhvB8W3HTzgmd d5XbSQRzXzylMY9sqhYaRaSt7cD7P5wWkY29wchNYolE5UxPm6tM9ai76ZmGRJm5Lw5Ga2 krYXWBlMx4chdhs0YUZEN7ktfA0FgNOeFLiWAwIbyN6N2NVAqplZJ0nKJAyw2JqVlLZBA0 4sVWOvCLauB4G6W7QqXO1TON7GTyWOYKNaNaFWgp+QNxxgbPtXJZjRLeOSJ5Aw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=Qs6z5Tww; 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=1684162461; h=from:from:sender:sender:reply-to: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=5h+gY3ihF+UMROk1MtAgzqZFL4HNcsvgWPH4QhehCyU=; b=DQN9SBnIgHRgk42ftl83WI8HwqCRXIE1VENf4JLueptvBSp9VeP88SDqsOQ6B7S7L7MeHY W2FCtKrPa+vYAvf6GIyqSvNxJ57USsMLIH75xqThNNqqUVMydylJyCUuv8+a2e/SmYOcyu a0uccYFE5+ARv4Uh1Z4f2E8024xwr864oQUknnaowv3nYkAaJb3r7WGkbKeHJdxU8ILXzO GkUL0u8SPVj20DuIdaoJDvOSy1GJ78EVbCe6L5WfL5ynjG4bu8wy7oHJqREGgNHnfc5HAq D3xsdREab9S7kWJ7VrF+eCaQMQ927ls4UVT2lBK8DqjlwNpmdjzFFYZEJDFDXw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=Qs6z5Tww; 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-Migadu-Spam-Score: -6.47 X-Spam-Score: -6.47 X-Migadu-Queue-Id: DF8A713F5A X-TUID: 2+m6+5tc2Toc --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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-t= ags) fulltable (if (length< bound-tags org-fast-tag-selection-maximu= m-tags) (progn (seq-take (seq-uniq (append bound-tags fulltabl= e)) org-fast-tag-selection-maximum-tags) (message "Tags are limited displayed by `org-fa= st-tag-selection-maximum-tags'.")) bound-tags (message "Tags are limited displayed only has key b= ound.")))) 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----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmRiRekACgkQG13xyVro msOcGwgArnOK9jybtSA58n7gKVkEsmewRjUeeM7muV0LIiPf8C3ShvKP+DHrK6Df hN56x8gtwK25bGmwGNRFefchIPm2dDLvw9z9X5e0A4ryrmNc+CCWdhXsBsaMgdSP 6Glt3S4sptiJthJQ7m7Q6mTEvfAvcl9MsfeiCRgIcq+llT3K5CXehTPcUXQFRdMl x9tzmIxTwUDPpQLHQEmH0zf6HbO1ObCKl+Jdp3pn9IXGi2fEGDN90l7eRLsSUG/l 96K60qxCtdZrTxV3SwMcN6P3q+djdhkNWKVxGF1S8BPOGA8V0IMqiBm9dQt2JMnK tlkTvk/D/bQPwVjXtLWM9SnKCETWow== =x206 -----END PGP SIGNATURE----- --=-=-=--