emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Improve the performance of `org-set-tags-command` on large `org-tag-


From: Christopher M. Miles
Subject: Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
Date: Sat, 13 May 2023 17:39:37 +0800
User-agent: mu4e 1.10.3; emacs 30.0.50

Ihor Radchenko <yantar92@posteo.net> writes:

> stardiviner <numbchild@gmail.com> 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?
>
> 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)

I applied your diff with a testing. This indeed solved the performance issue.
Will this be updated in Org-mode source code?

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]