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 gOy3MO0+X2T3BAAASxT56A (envelope-from ) for ; Sat, 13 May 2023 09:40:29 +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 kDbNL+0+X2Qb7QAAG6o9tA (envelope-from ) for ; Sat, 13 May 2023 09:40:29 +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 94FB229D60 for ; Sat, 13 May 2023 09:40:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxjrB-0004fB-QM; Sat, 13 May 2023 03:39:57 -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 1pxjr9-0004dF-Ho for emacs-orgmode@gnu.org; Sat, 13 May 2023 03:39:55 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxjr4-00006X-2R for emacs-orgmode@gnu.org; Sat, 13 May 2023 03:39:55 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DDB0C24012D for ; Sat, 13 May 2023 09:39:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1683963587; bh=H3zoFkxUcGOaAyW4flUcMgEWHFBvdPb5yQDEBFnX37w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=MokfKmJJ/KtukLbJ9nRomjBWGUaYVRkYgz/fM7DnpAmwphtEf5PIYEEHNaUTz+Q4T j8gUaAcGTHzt+etXL0QbSa4thbK+NugQFKFiBSZD9XB7xtA7fuuBlcoMWw64yH57dm F43/tlG96C4FqR4k8DtPFy5pv9xZuhlDgriTAKY4vah60tk4Jlw8xt+v5NkNpZwyWq D4w7SSlRFoUdJsYGoPp+v/hNuOF2+2VzDY+/NBiiRFp9+m/Nan5pHkIMOLNt6SeHUp X5HRWjvHoIFF6d5dPkrl0hcXCuW2L05tWDgl+ZTJ2lVs/WVp9W0hXsRRCOmlJbyqs4 slJpQRrd40r+w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QJHb72tzLz6twQ; Sat, 13 May 2023 09:39:47 +0200 (CEST) From: Ihor Radchenko To: stardiviner Cc: Org-mode Subject: Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist` In-Reply-To: References: Date: Sat, 13 May 2023 07:43:13 +0000 Message-ID: <878rds1xta.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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=1683963629; a=rsa-sha256; cv=none; b=Zzktj/FS6DfitEITY0EffTaxBer1yv+VH2fxXb8glTSh3fkgjXZdBAkkndtIKj+rDRIp8n ZxLke7IT4rLEvZpsYbo74OwRE5t1EoFMtDg3CC+9+S1nMIyzodEYUuhoRi9xdko2Kv+1Li Pg0NYRFKaFWqVZYFrSjyQZGzrryPCHTeXvYZI+GYDDKocQ5PdN+tqqwMPM1XWvUKdS2LMf kBqzp4hASKlbuzyOncT4+DKtgyctcw1ZVi9ikcPUmOwQAMos9lNFR7nF/+ejOWtxNdXXRQ clDR9VEpx/fFtMWXn+MbTk+ETzhZjdIfwylRYmGeKI9tfKKm+deo+qEkxqD0ig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=MokfKmJJ; 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=1683963629; 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=lY8EIy73WXnHbICBBnJ40gQD2LJwCDZPAyOiSlvJieg=; b=sFPy8Bod2KAyAHbalMG2l8sDTowT6CmbYd4ZXeqfdQ0khTEAfRm24bq+NV4ei3tYNOOzwr lQ8MkBuYwBxsEqhkuuxb8B2R602qPPL3uKWbBqTArHZnS+3DmbX2GbE1ZbwvC10Di8D6f+ NwUUFKyIVuyQ4YftJlJp/u4S8xp/MV+9Xma7IJamQiW72KolJrggV8qde5OSk/OAkWbHRX bHDDqylhLXkjFz8T9ev0ZMo7jyY2+HVD+DRiuLRPOqGVZr5kq4tN9ztPEHv9Zk4rHREhM8 c0GMhUjuP32u7cQyAf8fL+b7TOd4TVhhRq+k4vQ/8ND+91u/Ne59t7OEXjFkIQ== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=MokfKmJJ; 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.16 X-Spam-Score: -6.16 X-Migadu-Queue-Id: 94FB229D60 X-TUID: dIO78Af8a4vF --=-=-= Content-Type: text/plain stardiviner writes: > I have a large `org-tag-alist` value that contains about ~7000 tags. > When I press [C-c C-q] `org-set-tags-command`. Emacs suspends a long time. Indeed. That's because `org-fast-tag-selection' tries to put all those 7k tags into tag selection window. We can probably limit the maximum number of tags in the quick selection window. Can you try the attached simple diff for `org-fast-tag-selection' and check if it is enough to solve the hang? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=limit-tag.diff diff --git a/lisp/org.el b/lisp/org.el index c148409d9..d745fd01e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11765,7 +11765,7 @@ (defun org-fast-tag-selection (current inherited table &optional todo-table) (org-fast-tag-insert "Current" current c-face "\n\n") (org-fast-tag-show-exit exit-after-next) (org-set-current-tags-overlay current ov-prefix) - (setq tbl fulltable char ?a cnt 0) + (setq tbl (seq-take fulltable 26) char ?a cnt 0) (while (setq e (pop tbl)) (cond ((eq (car e) :startgroup) --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--