emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Improve the performance of `org-set-tags-command` on large `org-tag-alist`
@ 2023-05-13  4:49 stardiviner
  2023-05-13  7:43 ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: stardiviner @ 2023-05-13  4:49 UTC (permalink / raw)
  To: Org-mode


[-- Attachment #1.1: Type: text/plain, Size: 485 bytes --]

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.

Here are the profiler reports in the attachments.

I hope this can be improved the performance.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

[-- Attachment #1.2: Type: text/html, Size: 1309 bytes --]

[-- Attachment #2: cpu.profiler --]
[-- Type: application/octet-stream, Size: 30648 bytes --]


[profiler-profile "28.1" cpu #s(hash-table size 217 test equal rehash-size 1.5 rehash-threshold 0.8125 data ([profiler-stop funcall-interactively call-interactively command-execute "#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil] 3 [profiler-start funcall-interactively call-interactively command-execute "#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil] 4 [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 126 [file-remote-p redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 1 [if org-mode-clocking-outside-write-to-tempfile apply timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil] 4 ["#<compiled -0xd222d5f42ac1a06>" apply timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil nil] 1 ["#<compiled 0x1a044bbfab7010b2>" mapatoms execute-extended-command--shorter "#<compiled -0xd222d5f42ac1a06>" apply timer-event-handler nil nil nil nil nil nil nil nil nil nil] 6 [mapatoms execute-extended-command--shorter "#<compiled -0xd222d5f42ac1a06>" apply timer-event-handler nil nil nil nil nil nil nil nil nil nil nil] 1 [execute-extended-command--shorter "#<compiled -0xd222d5f42ac1a06>" apply timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil] 1 [append setq let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute nil nil nil nil nil nil] 120 [if "#<lambda 0xced60134>" mapcar apply if let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively] 1 [delete-other-windows if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively] 1 [or while if if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 4150 [cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively] 2975 [or if if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 3779 [not cond org-add-props setq cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 768 [insert progn if if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string] 159 [insert cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 3274 [setq cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 895 [matlab-scan-before-change-fcn insert cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 54 [if or setq if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 2 [car-safe setq while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 2 [if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 247 [insert if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 197 [org-add-props setq cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 468 [if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 7 [cond org-add-props setq cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 5 [string-to-char setq if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 150 [downcase string-to-char setq if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 167 [setq progn cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 420 [progn if if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 158 [car equal if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 118 [matlab-scan-before-change-fcn insert if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 3 [if if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 5 [cons setq cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 63 [while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively] 2 [syntax-ppss-flush-cache insert cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 2 [symbol-overlay-refresh insert if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 1 [eq cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 1 [= if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 1 [add-text-properties org-add-props setq cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 2 [while if if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 1 [symbol-overlay-refresh insert cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 1 [setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively] 1 ["#<compiled -0xd3bdadedb2266ad>" filtered-frame-list get-device-terminal frames-on-display-list framep-on-display display-multi-font-p window-default-font-height window-default-line-height fit-window-to-buffer cond org-fit-window-to-buffer if progn unwind-protect let save-excursion] 1 [fit-window-to-buffer cond org-fit-window-to-buffer if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 3 [while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 15 [let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 127 [and magit-file-accessible-directory-p not while let catch magit--safe-default-directory and let* if or magit-toplevel or cons setq if] 1 [generate-new-buffer let let if magit-git-str apply magit-rev-parse-safe and let* if let* if or magit-toplevel or cons] 2 [apply process-file apply let magit-process-file apply magit-process-git progn unwind-protect save-current-buffer let let if magit-git-str apply magit-rev-parse-safe] 3 [and unwind-protect save-current-buffer let let if magit-git-str apply magit-rev-parse-safe and let* if let* if or magit-toplevel] 1 [if let* if let* if or magit-toplevel or cons setq if magit-auto-revert-repository-buffer-p -filter let if auto-revert-buffers--buffer-list-filter] 1 [timer--time-less-p timer--activate timer-activate timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection] 32 [if org-mode-clocking-outside-write-to-tempfile apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection] 32 [redisplay_internal\ \(C\ function\) read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 1 [menu-bar-update-buffers redisplay_internal\ \(C\ function\) read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string] 3 [read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 62 [eval redisplay_internal\ \(C\ function\) read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string] 1 [timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 2 [files--transform-file-name make-lock-file-name write-region if org-mode-clocking-outside-write-to-tempfile apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let] 3 [apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string] 8 [jit-lock-context-fontify "#<compiled 0x12cd0987428de542>" apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection] 1 ["#<compiled 0x12cd0987428de542>" apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if] 20 [mapcar files--buffers-needing-to-be-saved save-some-buffers apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let*] 1 [map-y-or-n-p save-some-buffers apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection] 7 [backtrace-frame "#<compiled -0x91dce3623de086e>" called-interactively-p save-some-buffers apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion] 1 [timer--time-less-p timer--activate timer-activate-when-idle run-with-idle-timer setq progn if jinx--schedule jinx--reschedule redisplay_internal\ \(C\ function\) read-char-exclusive let setq while catch setq] 1 [replace-regexp-in-string mu4e--modeline-quote-and-truncate mu4e--modeline-string eval redisplay_internal\ \(C\ function\) read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let*] 1 [let while let while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 122 [while let while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 72 [add-text-properties let while let while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 7 [window--min-size-1 window-min-size frame-windows-min-size set-window-configuration unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 1 [unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute nil] 1 [goto-char save-restriction save-excursion save-excursion let if progn unwind-protect let org-get-tags let progn unwind-protect let save-restriction save-excursion] 1 [and not and or org-back-to-heading if save-restriction save-excursion save-excursion let if progn unwind-protect let org-get-tags let] 2 [progn if let progn unwind-protect let save-restriction save-excursion org-set-tags let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively] 1 [progn if progn if save-current-buffer org-element--cache-after-change delete-region progn if let progn unwind-protect let save-restriction save-excursion org-set-tags] 1 [global-hl-line-maybe-unhighlight global-hl-line-highlight nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 2 ["#<compiled 0x93c5540d1e03896>" mapc global-hl-line-maybe-unhighlight global-hl-line-highlight nil nil nil nil nil nil nil nil nil nil nil nil] 2 [sort winner-sorted-window-list winner-win-data winner-remember winner-save-old-configurations nil nil nil nil nil nil nil nil nil nil nil] 1 [easy-menu-lookup-name "#<compiled -0x38df6a6b6b06a73>" mapcar easy-menu-get-map easy-menu-add-item filesets-build-menu-now filesets-build-menu-maybe redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil] 1 [balance-windows golden-ratio redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil nil] 1 [jit-lock-function recenter golden-ratio redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil] 7 [cond let cond org-link-beautify--return-icon let* progn unwind-protect let progn if let org-link-beautify-display funcall progn if let] 1 [apply if let* make-process--with-editor-process-filter apply make-process cond if let* if org-link-beautify--preview-epub eq if cond let* progn] 2 [put-text-property org-link-beautify--display-icon progn if cond let* progn unwind-protect let progn if let org-link-beautify-display funcall progn if] 1 [rx--translate-or rx--translate-form rx--translate rx-to-string valign-region "#<compiled -0x7043cea1fb05ea7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil] 1 [timer-create run-with-idle-timer setq progn if jinx--schedule jinx--reschedule redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil] 1 [eyebrowse-mode-line-indicator eval redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil nil] 1 [jinx--check-region cdr setq if let* while let* jinx--check-pending progn unwind-protect save-current-buffer let progn if save-current-buffer let] 1 [let* while let* jinx--check-pending progn unwind-protect save-current-buffer let progn if save-current-buffer let while let let while] 2 [let progn if save-current-buffer let while let let while let jinx--timer-handler apply timer-event-handler nil nil nil] 1 [if eval redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil nil] 1 [posframe-hidehandler-daemon-function apply timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil nil] 1 [or and org-element--cache-interrupt-p if while let catch progn if catch save-current-buffer org-element--cache-process-request while catch let let] 3 [avl-tree--do-delete avl-tree-delete or save-current-buffer org-element--cache-remove progn if let if let while let catch progn if catch] 1 ["#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute nil nil nil] 103 [vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute] 18 [all-completions complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply vertico--all-completions vertico--recompute] 4 [complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply vertico--all-completions vertico--recompute vertico--update] 129 ["#<compiled 0x192476ad5107fc98>" "#<compiled 0x5fbda4ad12b2259>" all-completions complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply] 2 [version-to-list "#<compiled 0x5fbda4ad12b2259>" all-completions complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply] 10 [error version-to-list "#<compiled 0x5fbda4ad12b2259>" all-completions complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions] 1 ["#<compiled 0x5fbda4ad12b2259>" all-completions complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply vertico--all-completions] 3 [completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply vertico--all-completions vertico--recompute vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply] 3 ["#<compiled -0x7fd66fd2235be7a>" sort prescient-sort prescient-completion-sort vertico--recompute vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read] 2 [sort prescient-sort prescient-completion-sort vertico--recompute vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1] 4 [prescient-sort prescient-completion-sort vertico--recompute vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command] 3 [and and let* marginalia-annotate-binding concat if let* marginalia-annotate-command funcall let or let if marginalia--cached or let] 4 [progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or let if marginalia--cached] 3 [map-keymap keymap-canonicalize describe-map describe-map-tree substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command] 1 [and not cond not while let let* save-excursion org-element-paragraph-parser cond let cond setq let save-excursion if] 1 [describe-map describe-map-tree substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let] 7 [describe-map-tree substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 2 [frame-height posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice] 1 [fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>"] 5 [modify-frame-parameters fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply] 5 [replace-regexp-in-string mu4e--modeline-quote-and-truncate mu4e--modeline-string eval redisplay_internal\ \(C\ function\) modify-frame-parameters fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply] 1 [posframe--set-frame-position posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice] 1 [read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute nil nil] 33 [redisplay vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively] 15 [redisplay_internal\ \(C\ function\) redisplay vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code] 1 [or let cons setq while let* progn unwind-protect save-current-buffer let marginalia--align let* marginalia--affixate apply "#<compiled -0xae4fb688fd600bf>" vertico--affixate] 1 [posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply] 3 ["#<compiled -0x95a773ebe16eb10>" "#<compiled -0xad51861456db7c4>" mapcar completion-pcm--hilit-commonality "#<compiled 0x10f4157992d72f2e>" vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read] 3 [substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or let] 1 [set-frame-parameter posframe--create-posframe posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply] 2 [electric-pair-syntax-info electric-pair-post-self-insert-function self-insert-command funcall-interactively call-interactively command-execute read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1] 1 ["#<compiled -0xdc12fdf35afa00a>" apply "#<compiled 0x1dbdbef408ba58b3>" apply "#<compiled 0xa5b7d1f228cb0f1>" funcall setq my/vertico--format-candidate-prefix--advice apply vertico--format-candidate vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>"] 2 [posframe-poshandler-point-1 posframe-poshandler-point-bottom-left-corner posframe-poshandler-point-window-center posframe-run-poshandler posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply] 1 [easy-menu-lookup-name "#<compiled 0x134e732b2a48bb7b>" mapcar easy-menu-get-map easy-menu-add-item filesets-build-menu-now filesets-build-menu-maybe redisplay_internal\ \(C\ function\) redisplay vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply] 1 [apply completion-metadata-get vertico--metadata-get vertico--sort-function vertico--recompute vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read] 1 [describe-map--fill-columns describe-map--align-section describe-map describe-map-tree substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command] 1 [posframe-hidehandler-daemon-function apply timer-event-handler read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively] 1 ["#<compiled -0xa62f8a6331db7c4>" mapcar completion-pcm--hilit-commonality "#<compiled 0x10f416bf1b202f2e>" vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1] 1 [apply vertico--display-string "#<compiled -0xdc12fdf35afa00a>" apply "#<compiled 0x1dbdbef408ba58b3>" apply "#<compiled 0xa5b7d1f228cb0f1>" funcall setq my/vertico--format-candidate-prefix--advice apply vertico--format-candidate vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>"] 1 [posframe--create-posframe posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice] 1 [keymap-canonicalize redisplay_internal\ \(C\ function\) read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute] 2 [apply "#<compiled -0x18a51855555adfd0>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read] 1 [version< posframe--create-posframe posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply] 1 [vertico-prescient--remember apply vertico-insert vertico-exit vertico-directory-enter funcall-interactively call-interactively command-execute read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default] 1 [posframe--make-frame-invisible posframe-hide vertico-posframe--minibuffer-exit-hook read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively] 1 [add-hook mode-local-on-major-mode-change kill-all-local-variables minibuffer-inactive-mode read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code] 1 ["#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil nil nil nil nil] 1 [Automatic\ GC nil] 1214 [profiler-report funcall-interactively call-interactively command-execute "#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil] 5)) (25695 1295 133319 0) nil]

[-- Attachment #3: memory.profiler --]
[-- Type: application/octet-stream, Size: 52171 bytes --]


[profiler-profile "28.1" memory #s(hash-table size 325 test equal rehash-size 1.5 rehash-threshold 0.8125 data ([profiler-start funcall-interactively call-interactively command-execute "#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil] 656 [timer--time-setter timer-set-time run-at-time "#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil nil] 24 [timer--time-less-p timer--activate timer-activate run-at-time "#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil] 360 [corfu--match-symbol-p corfu--auto-post-command nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 2048 [timer--time-setter timer-set-idle-time run-with-idle-timer setq progn if jinx--schedule jinx--reschedule nil nil nil nil nil nil nil nil] 24 [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 249988 [menu-bar-update-buffers-1 menu-bar-update-buffers redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil nil] 16368 [golden-ratio redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 8192 [balance-windows golden-ratio redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil nil] 88944244 [window-resize enlarge-window golden-ratio--resize-window golden-ratio redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil] 1210 [file-remote-p redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 24240 [timer-relative-time timer-inc-time timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil nil] 400 [timer--time-setter timer-inc-time timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil nil] 168 [timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 168 [timer--time-less-p timer--activate timer-activate timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil] 3864 [if org-mode-clocking-outside-write-to-tempfile apply timer-event-handler nil nil nil nil nil nil nil nil nil nil nil nil] 140 [make-lock-file-name write-region if org-mode-clocking-outside-write-to-tempfile apply timer-event-handler nil nil nil nil nil nil nil nil nil nil] 8184 [execute-extended-command--shorter-1 execute-extended-command--shorter-1 execute-extended-command--shorter "#<compiled -0xd222d5f42ac1a06>" apply timer-event-handler nil nil nil nil nil nil nil nil nil nil] 1024 [and save-excursion org-at-heading-p and or org-back-to-heading save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute nil nil nil] 1024 [save-excursion org-match-line let org-inlinetask-end-p and not and or org-back-to-heading save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute] 1024 [delq and or if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute nil nil nil] 306912 [apply if let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute nil nil] 306912 [if let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute nil nil nil] 306920 [if save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute nil nil] 1024 [delete-other-windows if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively] 120321853 [split-window split-window-vertically set-window-buffer if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 59745613 [if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively] 605 ["#<compiled 0x16cc3208822e7544>" buffer-match-p display-buffer-assq-regexp display-buffer "#<compiled 0x2e27e91f80419d2>" ad-Advice-pop-to-buffer apply pop-to-buffer switch-to-buffer-other-window apply let org-switch-to-buffer-other-window if progn unwind-protect let] 134144 [if save-excursion org-fast-tag-show-exit progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 1024 [string-to-char setq if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 941160 [downcase string-to-char setq if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 1203048 [insert cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 7468952 [setq progn cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 1211232 [cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively] 5862928 [if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 1027360 [progn if if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 603320 [insert progn if if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string] 281792 [insert if progn if cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 414400 [org-add-props setq cond while progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 869696 [fit-window-to-buffer cond org-fit-window-to-buffer if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let] 11980 [file-remote-p window-text-pixel-size fit-window-to-buffer cond org-fit-window-to-buffer if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 10384 [eyebrowse-mode-line-indicator eval window-text-pixel-size fit-window-to-buffer cond org-fit-window-to-buffer if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 1016 [window-resize window-resize-no-error fit-window-to-buffer cond org-fit-window-to-buffer if progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 112528637 [while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command] 1412 [let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 34012 [timer-relative-time timer-inc-time timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if] 3488 [timer--time-setter timer-inc-time timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if] 1488 [timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let*] 1488 [timer-until timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string] 528 [timer--time-less-p timer--activate timer-activate timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection] 133536 [generate-new-buffer let let if magit-git-str apply magit-rev-parse-safe and let* if let* if or magit-toplevel or cons] 4165 [apply process-file apply let magit-process-file apply magit-process-git progn unwind-protect save-current-buffer let let if magit-git-str apply magit-rev-parse-safe] 516 [generate-new-buffer let let if magit-git-str apply magit-rev-parse-safe and let* if let* if let* if or magit-toplevel] 21 [timer-relative-time run-at-time apply run-with-timer auto-revert-set-timer if if auto-revert-buffers--buffer-list-filter apply auto-revert-buffers apply timer-event-handler read-char-exclusive let setq while] 16 [timer--time-setter timer-set-time run-at-time apply run-with-timer auto-revert-set-timer if if auto-revert-buffers--buffer-list-filter apply auto-revert-buffers apply timer-event-handler read-char-exclusive let setq] 24 [timer--time-less-p timer--activate timer-activate run-at-time apply run-with-timer auto-revert-set-timer if if auto-revert-buffers--buffer-list-filter apply auto-revert-buffers apply timer-event-handler read-char-exclusive let] 696 [rainbow-fart--timing-remind apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if] 120 [if org-mode-clocking-outside-write-to-tempfile apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection] 1722128 [files--transform-file-name make-lock-file-name write-region if org-mode-clocking-outside-write-to-tempfile apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let] 41336 [read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 440619 [replace-regexp-in-string mu4e--modeline-quote-and-truncate mu4e--modeline-string eval redisplay_internal\ \(C\ function\) read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let*] 4144 [eval redisplay_internal\ \(C\ function\) read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string] 4064 [call-interactively command-execute read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string] 32 [make-lock-file-name write-region if org-mode-clocking-outside-write-to-tempfile apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion] 24552 [save-some-buffers apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if] 4144 ["#<compiled 0x1957acc0d9b2>" save-some-buffers apply timer-event-handler read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection] 605 [eyebrowse-mode-line-indicator eval redisplay_internal\ \(C\ function\) read-char-exclusive let setq while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if] 1016 [while let while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond] 1024 [let while let while catch setq progn unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion] 10069728 [unwind-protect let save-excursion let* org-fast-tag-selection if replace-regexp-in-string let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively command-execute nil] 37510781 [split-string let cond let progn unwind-protect let save-restriction save-excursion org-set-tags let* save-excursion cond let org-set-tags-command funcall-interactively] 1024 [and save-excursion org-at-heading-p and or org-back-to-heading if save-restriction save-excursion save-excursion let if progn unwind-protect let org-get-tags] 1024 [save-excursion org-match-line let org-inlinetask-end-p and not and or org-back-to-heading if save-restriction save-excursion save-excursion let if progn] 1024 [save-excursion org-match-line if goto-char progn if let progn unwind-protect let save-restriction save-excursion org-set-tags let* save-excursion cond] 1024 [timer--time-setter timer-set-time run-at-time undo-auto--boundary-ensure-timer undo-auto--undoable-change delete-region progn if let progn unwind-protect let save-restriction save-excursion org-set-tags let*] 24 [timer--time-less-p timer--activate timer-activate run-at-time undo-auto--boundary-ensure-timer undo-auto--undoable-change delete-region progn if let progn unwind-protect let save-restriction save-excursion org-set-tags] 408 [if let progn unwind-protect let setq let prog1 let save-restriction save-excursion progn if save-current-buffer org-element--cache-before-change delete-region] 2104 [and while progn let progn if let progn unwind-protect let setq let prog1 let save-restriction save-excursion] 2048 [progn if let progn unwind-protect let save-restriction save-excursion org-set-tags let* save-excursion cond let org-set-tags-command funcall-interactively call-interactively] 64 [length 1- setq progn and while progn let progn if let progn unwind-protect let setq let] 1016 [looking-at-p if progn unwind-protect let if save-restriction save-excursion save-excursion let and let cond and or let] 1024 [if progn unwind-protect let if save-restriction save-excursion save-excursion let and let cond and or let if] 1024 [let save-excursion org-at-comment-p and while save-restriction save-excursion and let cond and or let if while let] 4144 [progn unwind-protect let save-excursion org-at-comment-p and while save-restriction save-excursion and let cond and or let if] 1024 [timer--time-setter timer-set-idle-time run-with-idle-timer setq org-element--cache-set-timer progn if progn if save-current-buffer org-element--cache-after-change delete-region progn if let progn] 24 [looking-at-p progn if let org-fontify-extend-region font-lock-extend-jit-lock-region-after-change run-hook-with-args jit-lock-after-change delete-region progn if let progn unwind-protect let save-restriction] 1024 [cond progn unwind-protect let let org-fontify-extend-region font-lock-extend-jit-lock-region-after-change run-hook-with-args jit-lock-after-change delete-region progn if let progn unwind-protect let] 2048 [save-excursion org-match-line org-tag-beautify-display-icon-refresh-headline run-hooks progn if let progn unwind-protect let save-restriction save-excursion org-set-tags let* save-excursion cond] 1024 [looking-at-p and if let org-set-tags-command funcall-interactively call-interactively command-execute nil nil nil nil nil nil nil nil] 1024 [winner-remember winner-save-old-configurations nil nil nil nil nil nil nil nil nil nil nil nil nil nil] 4144 [font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter golden-ratio redisplay_internal\ \(C\ function\) nil] 28349 [while let* org-inlinetask-fontify run-hook-with-args org-font-lock-hook font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now] 3072 [if org-fontify-drawers font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter golden-ratio] 1152 [while catch org-activate-links--text-properties if org-activate-links font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now] 27382 [if org-activate-tags font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter golden-ratio] 1344 [and if org-activate-dates font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter] 2064 [if while catch let org-footnote-next-reference-or-definition let org-activate-footnote-links font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock] 11576 [if org-fontify-macros font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter golden-ratio] 1152 [while org-font-lock-add-priority-faces font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter golden-ratio] 1024 [while progn if org-font-lock-add-tag-faces font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function] 4112 [while catch let org-do-emphasis-faces font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function] 3072 [looking-at-p save-excursion and not and save-excursion if let* while catch let org-do-emphasis-faces font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>"] 2048 [string-match-p and org-string-nw-p if org-do-latex-and-related font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now] 3072 [while catch progn if let org-fontify-entities font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply] 3072 [and if org-raise-scripts font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter] 1936 [if org-activate-code font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter golden-ratio] 1024 [if let org-fontify-meta-lines-and-blocks-1 condition-case org-fontify-meta-lines-and-blocks font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now] 3670 [while let org-fontify-inline-src-blocks-1 condition-case org-fontify-inline-src-blocks font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now] 3072 [if let* org-cite-activate font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter] 1024 [if let jupyter-org-font-lock-ansi-escapes font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter] 1024 [and save-excursion org-at-heading-p org-superstar-headline-or-inlinetask-p org-superstar--prettify-main-hbullet eval "#<compiled -0xf53eae089b200cc>" font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock] 2048 [and save-excursion org-at-heading-p org-superstar-headline-p org-superstar--prettify-leading-hbullets eval "#<compiled -0xf53eae089b200cc>" font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock] 2048 [valign-region "#<compiled -0x70438bd62246ca7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function recenter golden-ratio redisplay_internal\ \(C\ function\) nil nil nil] 1088 [font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil nil nil] 53728 [if org-fontify-drawers font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil] 2048 [if org-activate-tags font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil] 2048 [and if org-activate-dates font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\)] 2048 [if org-fontify-macros font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil] 2048 [while org-font-lock-add-priority-faces font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil] 2048 [and if org-raise-scripts font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\)] 2768 [if org-activate-code font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil] 2048 [if let* org-cite-activate font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\)] 2048 [if let jupyter-org-font-lock-ansi-escapes font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\)] 2048 [valign-region "#<compiled -0x70438bd6319c6a7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil nil nil nil nil] 10360 [timer--time-setter timer-set-time run-at-time apply run-with-timer "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil nil nil nil] 24 [timer--time-less-p timer--activate timer-activate run-at-time apply run-with-timer "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function redisplay_internal\ \(C\ function\) nil nil nil] 24 [let* org-inlinetask-fontify run-hook-with-args org-font-lock-hook font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x7043cea1fb05ea7>" run-hook-wrapped jit-lock--run-functions "#<compiled -0xebaca7148faf1f0>" apply jit-lock-fontify-now@ml/ad-jit-lock apply jit-lock-fontify-now jit-lock-function] 8184 [string-match-p not and if let* while catch org-activate-links--text-properties if org-activate-links font-lock-fontify-keywords-region font-lock-default-fontify-region font-lock-fontify-region "#<compiled -0x7043cea1fb05ea7>" run-hook-wrapped jit-lock--run-functions] 3076 [cond let catch org-element-link-parser progn unwind-protect let save-excursion let* progn if let* while catch org-activate-links--text-properties if] 1024 [replace-regexp-in-string org-link-unescape org-link-expand-abbrev setq cond let catch org-element-link-parser progn unwind-protect let save-excursion let* progn if let*] 2048 [not if org-link-expand-abbrev setq cond let catch org-element-link-parser progn unwind-protect let save-excursion let* progn if let*] 1024 [or cond cond let catch org-element-link-parser progn unwind-protect let save-excursion let* progn if let* while catch] 1024 [cond cond let catch org-element-link-parser progn unwind-protect let save-excursion let* progn if let* while catch org-activate-links--text-properties] 2584 [if let catch org-element-link-parser progn unwind-protect let save-excursion let* progn if let* while catch org-activate-links--text-properties if] 1024 [if progn if let catch org-element-link-parser progn unwind-protect let save-excursion let* progn if let* while catch] 1024 [replace-regexp-in-string setq progn if let catch org-element-link-parser progn unwind-protect let save-excursion let* progn if let* while] 1024 [file-name-extension or let* progn unwind-protect let progn if let org-link-beautify-display funcall progn if let let* progn] 8390 [file-name-sans-versions file-name-extension or let* progn unwind-protect let progn if let org-link-beautify-display funcall progn if let let*] 1024 [cond let cond org-link-beautify--return-icon let* progn unwind-protect let progn if let org-link-beautify-display funcall progn if let] 713 ["#<compiled -0x3ab24d206114b88>" cl--position cl-position apply cl-find apply cl-find-if nerd-icons-match-to-alist nerd-icons-icon-for-file cond let cond org-link-beautify--return-icon let* progn unwind-protect] 46080 [and cond let* progn unwind-protect let progn if let org-link-beautify-display funcall progn if let let* progn] 18829 [if org-link-beautify--preview-epub eq if cond let* progn unwind-protect let progn if let org-link-beautify-display funcall progn if] 1024 [replace-regexp-in-string org-link-unescape expand-file-name let* if org-link-beautify--preview-epub eq if cond let* progn unwind-protect let progn if let] 1024 [file-name-sans-versions file-name-sans-extension file-name-base format if expand-file-name let* if org-link-beautify--preview-epub eq if cond let* progn unwind-protect let] 1024 [file-name-sans-extension file-name-base format if expand-file-name let* if org-link-beautify--preview-epub eq if cond let* progn unwind-protect let progn] 1024 [if let* if org-link-beautify--preview-epub eq if cond let* progn unwind-protect let progn if let org-link-beautify-display funcall] 1528 [apply if let* make-process--with-editor-process-filter apply make-process cond if let* if org-link-beautify--preview-epub eq if cond let* progn] 1750 [timer--time-setter timer-set-idle-time run-with-idle-timer setq progn if jinx--schedule jinx--reschedule redisplay_internal\ \(C\ function\) nil nil nil nil nil nil nil] 24 [progn unwind-protect let save-excursion progn unwind-protect let* let jinx--check-region cdr setq if let* while let* jinx--check-pending] 2048 [let jinx--delete-overlays progn unwind-protect let save-excursion progn unwind-protect let* let jinx--check-region cdr setq if let* while] 80 [while progn unwind-protect let save-excursion progn unwind-protect let* let jinx--check-region cdr setq if let* while let*] 1024 [looking-at-p and if let save-excursion jinx--regexp-ignored-p run-hook-with-args-until-success let* progn if let while progn unwind-protect let save-excursion] 1024 [or and org-element--cache-interrupt-p if while let catch progn if catch save-current-buffer org-element--cache-process-request while catch let let] 32 ["#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute nil nil nil] 50246 ["#<compiled -0x1370b04a947a6a3c>" "#<compiled -0xebaed05fe56df3f>" mapc seq-do seq-find vertico-multiform--lookup vertico-multiform--setup minibuffer-setup read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default] 1024 ["#<compiled 0x211bbe31c705b67>" apply "#<compiled 0xdfc042c48de7c2d>" apply "#<compiled 0x771a27cce3618b7>" apply vertico--setup vertico-multiform--setup minibuffer-setup read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply] 184 [minibuf-eldef-setup-minibuffer read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute nil] 4096 [completion-pcm--string->pattern completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply vertico--all-completions vertico--recompute vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>"] 2048 [completion-pcm--pattern->regex completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply vertico--all-completions vertico--recompute vertico--update vertico--exhibit read-from-minibuffer] 1024 [complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply vertico--all-completions vertico--recompute vertico--update] 1024 [version-to-list "#<compiled 0x5fbda4ad12b2259>" all-completions complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply] 8192 ["#<compiled 0x5fbda4ad12b2259>" all-completions complete-with-action "#<compiled 0xc7fda4dfe4cd927>" all-completions completion-pcm--all-completions completion-pcm--find-all-completions completion-pcm-all-completions "#<compiled 0x1368548aa1ae9df3>" completion--some completion--nth-completion "#<compiled 0x7fac4f8032a30da>" apply completion-all-completions apply vertico--all-completions] 24552 [prescient-sort prescient-completion-sort vertico--recompute vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command] 285512 [vertico--format-count vertico--display-count vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively] 18000 [and and let* marginalia-annotate-binding concat if let* marginalia-annotate-command funcall let or let if marginalia--cached or let] 565488 [generate-new-buffer substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 1071 [documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or let if] 109800 [if progn unwind-protect let if let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or let] 3072 [string-blank-p if cons let cons setq while let* progn unwind-protect save-current-buffer let marginalia--align let* marginalia--affixate apply] 3072 [progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or let if marginalia--cached] 1328 [substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or let] 262312 ["#<compiled -0x14e59b7fe902baed>" apply if outline-on-heading-p@fix-for-org-fold apply outline-on-heading-p "#<compiled -0x16ef9f6452981647>" keymap--menu-item-binding keymap--merge-bindings keymap-canonicalize describe-map describe-map-tree substitute-command-keys documentation progn condition-case] 1728 [help--key-description-fontified describe-map describe-map-tree substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall] 32736 [describe-map-tree substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 37544 [outline-previous-heading let* progn if cond let* save-restriction save-excursion save-current-buffer progn unwind-protect let catch org-element--parse-to condition-case if] 2048 [progn unwind-protect let save-excursion org-at-comment-p and while save-restriction save-excursion or progn if let* save-restriction save-excursion org-element-org-data-parser] 2048 [if save-restriction save-excursion or progn if let* save-restriction save-excursion org-element-org-data-parser setq if cond let* save-restriction save-excursion] 2048 [while let save-restriction save-excursion save-excursion let if catch let* save-restriction save-excursion org-element-org-data-parser setq if cond let*] 2048 [looking-at-p let* progn cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect let* if if] 4096 [cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect let* if if while let let*] 8192 [not save-excursion let cond and cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect let*] 2048 [and while let if org-element--collect-affiliated-keywords let cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect] 2048 [if let if org-element--collect-affiliated-keywords let cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect let*] 2048 [cond let cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect let* if if while] 16384 [or cond let cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect let* if if] 2048 [and let or cond let cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect let*] 4096 [and not cond not while let let* save-excursion org-element-paragraph-parser cond let cond setq let save-excursion if] 18374 [cond not while let let* save-excursion org-element-paragraph-parser cond let cond setq let save-excursion if let* org-element--current-element] 8192 [if let* save-excursion org-element-table-parser cond let cond setq let save-excursion if let* org-element--current-element setq progn unwind-protect] 2048 [while let let* save-excursion org-element-table-parser cond let cond setq let save-excursion if let* org-element--current-element setq progn] 2048 [describe-map describe-map-tree substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let] 20610 [advice--make-single-doc advice--make-docstring documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 1000 [help-split-fundoc advice--make-docstring documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 1024 [help--make-usage-docstring advice--make-docstring documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 1000 [replace-regexp-in-string help--docstring-quote help--make-usage-docstring advice--make-docstring documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall] 1088 [generate-new-buffer advice--make-docstring documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 21 [matlab-scan-before-change-fcn advice--make-docstring documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 704 [ensure-empty-lines advice--make-docstring documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 1024 [help-add-fundoc-usage advice--make-docstring documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall let or] 2048 ["#<compiled -0xdc12fdf35afa00a>" apply "#<compiled 0x1dbdbef408ba58b3>" apply "#<compiled 0xa5b7d1f228cb0f1>" funcall setq my/vertico--format-candidate-prefix--advice apply vertico--format-candidate vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>"] 8184 ["#<compiled -0xd922a28679820a3>" cl-some vertico-posframe--show-minibuffer-p vertico-posframe--handle-minibuffer-window "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice] 2048 [vertico-posframe--handle-minibuffer-window "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read] 157934685 [vertico-posframe--get-border-color vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default] 9000 [version-to-list version< posframe--create-posframe posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>"] 3072 [fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>"] 50286542 [modify-frame-parameters fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply] 185752 [golden-ratio redisplay_internal\ \(C\ function\) modify-frame-parameters fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer] 4096 [file-remote-p redisplay_internal\ \(C\ function\) modify-frame-parameters fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer] 6792 [redisplay_internal\ \(C\ function\) modify-frame-parameters fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>"] 8184 [posframe-poshandler-point-1 posframe-poshandler-point-bottom-left-corner posframe-poshandler-point-window-center posframe-run-poshandler posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply] 11544 [read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute nil nil] 1165864 [call-interactively command-execute read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute] 144 [funcall-interactively call-interactively command-execute read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively] 520 [vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively command-execute] 480 [menu-bar-update-buffers-1 menu-bar-update-buffers redisplay_internal\ \(C\ function\) redisplay vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1] 8184 [redisplay vertico--update vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command byte-code call-interactively] 632926 [completion-pcm--pattern->regex completion-pcm--hilit-commonality "#<compiled 0x10f41579f706df2e>" vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command] 1024 ["#<compiled -0xad5c42c390db7c4>" mapcar completion-pcm--hilit-commonality "#<compiled 0x10f41579f706df2e>" vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1] 5120 [apply "#<compiled -0x18a51855555adfd0>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read] 21648 [apply string-replace substitute-quotes substitute-command-keys documentation progn condition-case and let* marginalia--function-doc marginalia--documentation concat if let* marginalia-annotate-command funcall] 8184 ["#<compiled 0x19818b4211de>" self-insert-command funcall-interactively call-interactively command-execute read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command] 8184 [if let* marginalia-annotate-command funcall let or let if marginalia--cached or let cons setq while let* progn] 8184 [file-remote-p posn-at-point posframe-poshandler-point-1 posframe-poshandler-point-bottom-left-corner posframe-poshandler-point-window-center posframe-run-poshandler posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit read-from-minibuffer] 6792 [eyebrowse-mode-line-indicator eval posn-at-point posframe-poshandler-point-1 posframe-poshandler-point-bottom-left-corner posframe-poshandler-point-window-center posframe-run-poshandler posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply "#<compiled 0x1bb996e55867750a>" apply vertico--display-candidates vertico--exhibit] 8184 [concat progn if marginalia--documentation concat if let* marginalia-annotate-command funcall let or let if marginalia--cached or let] 8184 [apply vertico--display-string "#<compiled -0xdc12fdf35afa00a>" apply "#<compiled 0x1dbdbef408ba58b3>" apply "#<compiled 0xa5b7d1f228cb0f1>" funcall setq my/vertico--format-candidate-prefix--advice apply vertico--format-candidate vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>"] 8184 [my/vertico--format-candidate-prefix--advice apply vertico--format-candidate vertico--arrange-candidates vertico--exhibit read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read read-extended-command-1 read-extended-command] 8184 ["#<compiled -0xd3bdadedb2266ad>" filtered-frame-list get-device-terminal frames-on-display-list framep-on-display display-multi-font-p window-default-font-height window-default-line-height fit-frame-to-buffer-1 posframe--fit-frame-to-buffer posframe--set-frame-size posframe-show apply vertico-posframe--show "#<compiled 0x78430d8ff1dc7b2>" apply] 8184 ["#<compiled 0x17a85a7bf1843c6a>" apply vertico-insert vertico-exit vertico-directory-enter funcall-interactively call-interactively command-execute read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default] 56 [apply vertico-insert vertico-exit vertico-directory-enter funcall-interactively call-interactively command-execute read-from-minibuffer "#<compiled 0x65dcd10eb6887eb>" apply "#<compiled -0x1c0fa6ff6f758296>" apply vertico--advice apply completing-read-default completing-read] 104 [call-interactively command-execute "#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil nil nil] 16 [profiler-report funcall-interactively call-interactively command-execute "#<compiled -0x1383dc241ee7b7bd>" ad-Advice-execute-extended-command apply execute-extended-command funcall-interactively call-interactively command-execute nil nil nil nil nil] 837424 [Automatic\ GC nil] 3362)) (25695 1295 149551 0) nil]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-13  4:49 Improve the performance of `org-set-tags-command` on large `org-tag-alist` stardiviner
@ 2023-05-13  7:43 ` Ihor Radchenko
  2023-05-13  9:39   ` Christopher M. Miles
  2023-05-13 11:13   ` stardiviner
  0 siblings, 2 replies; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-13  7:43 UTC (permalink / raw)
  To: stardiviner; +Cc: Org-mode

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: limit-tag.diff --]
[-- Type: text/x-patch, Size: 517 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 224 bytes --]


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-13  7:43 ` Ihor Radchenko
@ 2023-05-13  9:39   ` Christopher M. Miles
  2023-05-13 11:13   ` stardiviner
  1 sibling, 0 replies; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-13  9:39 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: stardiviner, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]


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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-13  7:43 ` Ihor Radchenko
  2023-05-13  9:39   ` Christopher M. Miles
@ 2023-05-13 11:13   ` stardiviner
  2023-05-13 11:26     ` Ihor Radchenko
  1 sibling, 1 reply; 30+ messages in thread
From: stardiviner @ 2023-05-13 11:13 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org-mode

[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]

I applied your diff with a testing. This indeed solved the performance
issue.
Will this be updated in Org-mode source code?
Also I come up with one thing, filter out tags which have shortcut
keybinding bound. Because user defined shortcut key defined tags are not
always on head of list.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sat, May 13, 2023 at 3:39 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> 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?
>
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 2547 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-13 11:13   ` stardiviner
@ 2023-05-13 11:26     ` Ihor Radchenko
  2023-05-13 14:24       ` [PATCH] " Christopher M. Miles
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-13 11:26 UTC (permalink / raw)
  To: stardiviner; +Cc: Org-mode

stardiviner <numbchild@gmail.com> writes:

> I applied your diff with a testing. This indeed solved the performance
> issue.
> Will this be updated in Org-mode source code?
> Also I come up with one thing, filter out tags which have shortcut
> keybinding bound. Because user defined shortcut key defined tags are not
> always on head of list.

It would be great if you can come up with a patch.
1. Keeping tags with explicitly assigned key binding indeed makes sense
2. If we limit the number of displayed tags (on top of explicitly
   assigned), it should be a defcustom.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-13 11:26     ` Ihor Radchenko
@ 2023-05-13 14:24       ` Christopher M. Miles
  2023-05-13 18:43         ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-13 14:24 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: stardiviner, Org-mode


[-- Attachment #1.1: Type: text/plain, Size: 659 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> I applied your diff with a testing. This indeed solved the performance
>> issue.
>> Will this be updated in Org-mode source code?
>> Also I come up with one thing, filter out tags which have shortcut
>> keybinding bound. Because user defined shortcut key defined tags are not
>> always on head of list.
>
> It would be great if you can come up with a patch.
> 1. Keeping tags with explicitly assigned key binding indeed makes sense
> 2. If we limit the number of displayed tags (on top of explicitly
>    assigned), it should be a defcustom.

Here is the patch.


[-- Attachment #1.2: 0001-org-Improve-the-tags-fast-selection-performance.patch --]
[-- Type: #("text/x-patch" 0 12 (prescient-regexps nil prescient-ignore-case t)), Size: 961 bytes --]

From 649ca2215e98c59b9a9c16128448c6bb1def3b62 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Sat, 13 May 2023 22:22:25 +0800
Subject: [PATCH] org: Improve the tags fast selection performance

* lisp/org.el (org-fast-tag-selection): Filter out only short key bound
tags for tag fast selection.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 542959f73..dfc15d134 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11935,7 +11935,7 @@ Returns the new tags string, or nil to not change the current settings."
 	(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-filter 'cdr fulltable) char ?a cnt 0)
 	(while (setq e (pop tbl))
 	  (cond
 	   ((eq (car e) :startgroup)
-- 
2.39.2 (Apple Git-143)


[-- Attachment #1.3: Type: text/plain, Size: 267 bytes --]


-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-13 14:24       ` [PATCH] " Christopher M. Miles
@ 2023-05-13 18:43         ` Ihor Radchenko
  2023-05-14  1:54           ` Christopher M. Miles
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-13 18:43 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

>> It would be great if you can come up with a patch.
>> 1. Keeping tags with explicitly assigned key binding indeed makes sense
>> 2. If we limit the number of displayed tags (on top of explicitly
>>    assigned), it should be a defcustom.
>
> Here is the patch.
> -	(setq tbl fulltable char ?a cnt 0)
> +	(setq tbl (seq-filter 'cdr fulltable) char ?a cnt 0)

Thanks, but it will make the tag selection useless for people who did
not customize explicit tag bindings.

You should instead only filter when the number of tags exceeds some
customized value.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-13 18:43         ` Ihor Radchenko
@ 2023-05-14  1:54           ` Christopher M. Miles
  2023-05-14  8:09             ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-14  1:54 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>>> It would be great if you can come up with a patch.
>>> 1. Keeping tags with explicitly assigned key binding indeed makes sense
>>> 2. If we limit the number of displayed tags (on top of explicitly
>>>    assigned), it should be a defcustom.
>>
>> Here is the patch.
>> -	(setq tbl fulltable char ?a cnt 0)
>> +	(setq tbl (seq-filter 'cdr fulltable) char ?a cnt 0)
>
> Thanks, but it will make the tag selection useless for people who did
> not customize explicit tag bindings.
>
> You should instead only filter when the number of tags exceeds some
> customized value.

What about like this?

#+begin_src emacs-lisp
(setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
                    (if (length> shortkeys 0)
                        bound-tags
                      (seq-take fulltable 26)))
              char ?a cnt 0)
#+end_src

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-14  1:54           ` Christopher M. Miles
@ 2023-05-14  8:09             ` Ihor Radchenko
  2023-05-14 14:27               ` Christopher M. Miles
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-14  8:09 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

> What about like this?
>
> #+begin_src emacs-lisp
> (setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
>                     (if (length> shortkeys 0)
>                         bound-tags
>                       (seq-take fulltable 26)))
>               char ?a cnt 0)
> #+end_src

What do you mean by "shortkeys"?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-14  8:09             ` Ihor Radchenko
@ 2023-05-14 14:27               ` Christopher M. Miles
  2023-05-14 14:58                 ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-14 14:27 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 953 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> What about like this?
>>
>> #+begin_src emacs-lisp
>> (setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
>>                     (if (length> shortkeys 0)
>>                         bound-tags
>>                       (seq-take fulltable 26)))
>>               char ?a cnt 0)
>> #+end_src
>
> What do you mean by "shortkeys"?

Sorry, wrong code, here is the correct code snippet:

#+begin_src emacs-lisp
(let ((bound-tags (seq-filter 'cdr temp-fulltable)))
  (if (length> bound-tags 0)
      bound-tags
    (seq-take temp-fulltable 26)))
#+end_src

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-14 14:27               ` Christopher M. Miles
@ 2023-05-14 14:58                 ` Ihor Radchenko
  2023-05-14 16:27                   ` Christopher M. Miles
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-14 14:58 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

> Sorry, wrong code, here is the correct code snippet:
>
> #+begin_src emacs-lisp
> (let ((bound-tags (seq-filter 'cdr temp-fulltable)))
>   (if (length> bound-tags 0)
>       bound-tags
>     (seq-take temp-fulltable 26)))
> #+end_src

This will unconditionally drop auto-labeled tags when user-bound tags
exist, even if the total number of tags in buffer does not exceed 26.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-14 14:58                 ` Ihor Radchenko
@ 2023-05-14 16:27                   ` Christopher M. Miles
  2023-05-14 17:38                     ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-14 16:27 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 945 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> Sorry, wrong code, here is the correct code snippet:
>>
>> #+begin_src emacs-lisp
>> (let ((bound-tags (seq-filter 'cdr temp-fulltable)))
>>   (if (length> bound-tags 0)
>>       bound-tags
>>     (seq-take temp-fulltable 26)))
>> #+end_src
>
> This will unconditionally drop auto-labeled tags when user-bound tags
> exist, even if the total number of tags in buffer does not exceed 26.

I try to read the source code of `org-fast-tag-selection', but the code is hard to read.
I don't know how to keep auto-labeled tags. Do you have any suggestions?


-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-14 16:27                   ` Christopher M. Miles
@ 2023-05-14 17:38                     ` Ihor Radchenko
  2023-05-14 18:14                       ` [PATCH v2] " Christopher M. Miles
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-14 17:38 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

>>> #+begin_src emacs-lisp
>>> (let ((bound-tags (seq-filter 'cdr temp-fulltable)))
>>>   (if (length> bound-tags 0)
>>>       bound-tags
>>>     (seq-take temp-fulltable 26)))
>>> #+end_src
>>
>> This will unconditionally drop auto-labeled tags when user-bound tags
>> exist, even if the total number of tags in buffer does not exceed 26.
>
> I try to read the source code of `org-fast-tag-selection', but the code is hard to read.

Yeah. I agree. But we have what we have.

> I don't know how to keep auto-labeled tags. Do you have any suggestions?

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'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v2] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-14 17:38                     ` Ihor Radchenko
@ 2023-05-14 18:14                       ` Christopher M. Miles
  2023-05-15 10:59                         ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-14 18:14 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode


[-- Attachment #1.1: Type: text/plain, Size: 981 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>>>> #+begin_src emacs-lisp
>>>> (let ((bound-tags (seq-filter 'cdr temp-fulltable)))
>>>>   (if (length> bound-tags 0)
>>>>       bound-tags
>>>>     (seq-take temp-fulltable 26)))
>>>> #+end_src
>>>
>>> This will unconditionally drop auto-labeled tags when user-bound tags
>>> exist, even if the total number of tags in buffer does not exceed 26.
>>
>> I try to read the source code of `org-fast-tag-selection', but the code is hard to read.
>
> Yeah. I agree. But we have what we have.
>
>> I don't know how to keep auto-labeled tags. Do you have any suggestions?
>
> 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'.


[-- Attachment #1.2: 0001-org-Improve-the-tags-fast-selection-performance.patch --]
[-- Type: #("text/x-patch" 0 12 (prescient-regexps nil prescient-ignore-case t)), Size: 2083 bytes --]

From 569368aa9b3c7aa5bf1063d3e9c152db5304f4f3 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Sat, 13 May 2023 22:22:25 +0800
Subject: [PATCH] org: Improve the tags fast selection performance

* lisp/org.el (org-fast-tag-selection): Filter out only maximum number
limited tags has fast selection bound when `org-use-fast-tag-selection'
is 'auto and tags has fast select bound keys.
* lisp/org.el (org-fast-tag-selection-maximum-tags): Add new custom
option to set maximum tags number for fast tag selection.
---
 lisp/org.el | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 542959f73..5d6687b7a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2775,6 +2775,12 @@ displaying the tags menu is not even shown, until you press `C-c' again."
 	  (const :tag "Yes" t)
 	  (const :tag "Expert" expert)))
 
+(defcustom org-fast-tag-selection-maximum-tags 26
+  "Set the maximum tags number for fast tag selection."
+  :group 'org-tags
+  :type 'number
+  :safe #'numberp)
+
 (defvar org-fast-tag-selection-include-todo nil
   "Non-nil means fast tags selection interface will also offer TODO states.
 This is an undocumented feature, you should not rely on it.")
@@ -11935,7 +11941,13 @@ Returns the new tags string, or nil to not change the current settings."
 	(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 (let ((bound-tags (seq-filter 'cdr fulltable)))
+                    (cl-case org-use-fast-tag-selection
+                      (auto (if (length> bound-tags org-fast-tag-selection-maximum-tags)
+                                bound-tags
+                              (seq-take fulltable org-fast-tag-selection-maximum-tags)))
+                      (t fulltable)))
+              char ?a cnt 0)
 	(while (setq e (pop tbl))
 	  (cond
 	   ((eq (car e) :startgroup)
-- 
2.39.2 (Apple Git-143)


[-- Attachment #1.3: Type: text/plain, Size: 267 bytes --]


-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH v2] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-14 18:14                       ` [PATCH v2] " Christopher M. Miles
@ 2023-05-15 10:59                         ` Ihor Radchenko
  2023-05-15 12:43                           ` Christopher M. Miles
  2023-05-15 14:40                           ` [PATCH v3] " Christopher M. Miles
  0 siblings, 2 replies; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-15 10:59 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> 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.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-15 10:59                         ` Ihor Radchenko
@ 2023-05-15 12:43                           ` Christopher M. Miles
  2023-05-15 13:14                             ` Ihor Radchenko
  2023-05-15 14:40                           ` [PATCH v3] " Christopher M. Miles
  1 sibling, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-15 12:43 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> 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.

I think we should consider the option `org-use-fast-tag-selection'.
Because it controls the behavior that whether auto assign short-key to
tags. Make condition decision based on this option is needed. I hope you
can reconsider this.

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-15 12:43                           ` Christopher M. Miles
@ 2023-05-15 13:14                             ` Ihor Radchenko
  0 siblings, 0 replies; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-15 13:14 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

>> 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.
>
> I think we should consider the option `org-use-fast-tag-selection'.
> Because it controls the behavior that whether auto assign short-key to
> tags. Make condition decision based on this option is needed. I hope you
> can reconsider this.

We probably have a misunderstanding about the role of
`org-use-fast-tag-selection'.

`org-use-fast-tag-selection' _currently_ determines whether to display
the tag selection window at all:

    Non-nil means use fast tag selection scheme.
    
    This is a special interface to select and deselect tags with single keys.
    When nil, fast selection is never used.
    When the symbol auto, fast selection is used if and only if selection
    characters for tags have been configured, either through the variable
    org-tag-alist or through a #+TAGS line in the buffer.
    When t, fast selection is always used and selection keys are assigned
    automatically if necessary.

Even when the value is t, not 'auto, the user bindings for tags are
honored. `org-fast-tag-selection' never checks the value of
`org-use-fast-tag-selection'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v3] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-15 10:59                         ` Ihor Radchenko
  2023-05-15 12:43                           ` Christopher M. Miles
@ 2023-05-15 14:40                           ` Christopher M. Miles
  2023-05-15 16:12                             ` [PATCH v3.1] " Christopher M. Miles
  1 sibling, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-15 14:40 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 2004 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> 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-maximum-tags)
                          (progn
                            (seq-take (seq-uniq (append bound-tags fulltable))
                                      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

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v3.1] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-15 14:40                           ` [PATCH v3] " Christopher M. Miles
@ 2023-05-15 16:12                             ` Christopher M. Miles
  2023-05-16  9:31                               ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-15 16:12 UTC (permalink / raw)
  To: Ihor Radchenko, Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 2965 bytes --]


"Christopher M. Miles" <numbchild@gmail.com> writes:

> [[PGP Signed Part:Undecided]]
>
> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> "Christopher M. Miles" <numbchild@gmail.com> 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-maximum-tags)
>                           (progn
>                             (seq-take (seq-uniq (append bound-tags fulltable))
>                                       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-tags)
                        fulltable
                      (if (length< bound-tags org-fast-tag-selection-maximum-tags)
                          (progn
                            (insert "Tags are limited displayed by `org-fast-tag-selection-maximum-tags'.\n")
                            (seq-take (seq-uniq (append bound-tags fulltable))
                                      org-fast-tag-selection-maximum-tags))
                        (insert "Tags are limited displayed only has key bound.\n")
                        bound-tags)))
              char ?a cnt 0)
#+end_src

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3.1] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-15 16:12                             ` [PATCH v3.1] " Christopher M. Miles
@ 2023-05-16  9:31                               ` Ihor Radchenko
  2023-05-16 12:12                                 ` [PATCH v4] " Christopher M. Miles
  2023-05-16 12:12                                 ` Christopher M. Miles
  0 siblings, 2 replies; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-16  9:31 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

> Updated version which fix the `message` error in upper code:

Thanks!

> #+begin_src emacs-lisp
> (setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
>                     (if (length< fulltable org-fast-tag-selection-maximum-tags)

Because of (:startgroup) markers and similar things, this condition is
not fully accurate. See `org-tag-alist' docstring.

You may also need to consider special alist items in the rest of the code.

>                         fulltable
>                       (if (length< bound-tags org-fast-tag-selection-maximum-tags)
>                           (progn
>                             (insert "Tags are limited displayed by `org-fast-tag-selection-maximum-tags'.\n")

If you want to have proper Elisp symbol markup when using `...', use `format-message'.

>                             (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'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v4] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-16  9:31                               ` Ihor Radchenko
  2023-05-16 12:12                                 ` [PATCH v4] " Christopher M. Miles
@ 2023-05-16 12:12                                 ` Christopher M. Miles
  2023-05-16 18:53                                   ` Ihor Radchenko
  1 sibling, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-16 12:12 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 7437 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> Updated version which fix the `message` error in upper code:
>
> Thanks!
>
>> #+begin_src emacs-lisp
>> (setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
>>                     (if (length< fulltable org-fast-tag-selection-maximum-tags)
>
> Because of (:startgroup) markers and similar things, this condition is
> not fully accurate. See `org-tag-alist' docstring.
>
> You may also need to consider special alist items in the rest of the code.
>
I added a let-binding to modify fulltable at first to filter out special tag markers.

>>                         fulltable
>>                       (if (length< bound-tags org-fast-tag-selection-maximum-tags)
>>                           (progn
>>                             (insert "Tags are limited displayed by `org-fast-tag-selection-maximum-tags'.\n")
>
> If you want to have proper Elisp symbol markup when using `...', use
> `format-message'.

Updated.

>
>>                             (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.

Using `append':

#+begin_example
Inherited:  video
Current:    

Tags are limited displayed by ‘org-fast-tag-selection-maximum-tags’.
  [d] drill                               [z] crypt                               [A] ARCHIVE                             
  [E] noexport                            [P] private                             [D] deprecated                          
  [O] outdated                            [t] translate                           [i] idea                                
  [h] book                                [b] bookmark                            [w] work                                
  [a] appointment                         [m] meeting                             [u] urgent                              
  [X] SEX                                 [k] wiki                                [C] code                                
  [e] Emacs                               [o] Org_mode                            [G] git                                 
  [L] Linux                               [M] macOS                               [W] Windows                             
  [l] LISP                                [c] Clojure                             [s] ClojureScript                       
  [J] Java                                [S] Shell                               [p] Python                              
  [r] Ruby                                [j] JavaScript                          [d] database                            
  [f] LOG                                 [g] @marks                              [n] on                                  
  [q] off                                 [v] star                                [x] like                                
  [y] favorite                            [{] suggested                           [|] heart                               
  [}] smile                               [~] brain                               [ ] check                               
  [ ] alert                               [ ] important                           [ ] flag                                
  [ ] error                               [ ] label                               
#+end_example

Using `org--tag-add-to-alist':

#+begin_example
Inherited:  video
Current:    

Tags are limited displayed by ‘org-fast-tag-selection-maximum-tags’.
  [d] drill                               [z] crypt                               [f] LOG                                 
  [A] ARCHIVE                             [E] noexport                            [P] private                             
  [D] deprecated                          [O] outdated                            [g] @marks                              
  [n] on                                  [q] off                                 [v] star                                
  [x] like                                [y] favorite                            [{] suggested                           
  [|] heart                               [}] smile                               [~] brain                               
  [ ] check                               [ ] alert                               [ ] important                           
  [ ] flag                                [ ] error                               [ ] label                               
  [ ] question                            [ ] info                                [ ] quote                               
  [ ] table                               [t] translate                           [ ] language                            
  [i] idea                                [ ] comment                             [ ] screenshot                          
  [ ] trash                               [ ] delete                              [ ] clear                               
  [ ] cancel                              [ ] lock                                [ ] unlock                              
  [ ] key                                 [ ] refresh                             [ ] repeat                              
  [ ] shuffle                             [h] book                                [b] bookmark                            
  [ ] note                                [ ] cheatsheet                          [ ] paperclip                           
  [ ] plot                                [ ] diagram                             
#+end_example

You can see the bound key tags are not fully displayed in buffer at second solution.

Here is the updated code:

#+begin_src emacs-lisp
(setq tbl (let* ((fulltable-accurate
                          (delq nil
                                (seq-filter
                                 (lambda (tag)
                                   (and (not (member tag '((:startgrouptag) (:grouptags) (:endgrouptag)))) tag))
                                 fulltable)))
                         (bound-tags (seq-filter 'cdr fulltable-accurate)))
                    (if (length< fulltable-accurate org-fast-tag-selection-maximum-tags)
                        fulltable
                      (if (length< bound-tags org-fast-tag-selection-maximum-tags)
                          (progn
                            (insert (format-message "Tags are limited displayed by `org-fast-tag-selection-maximum-tags'.\n"))
                            (seq-take (seq-uniq (append bound-tags fulltable-accurate)) ; TODO: consider to use `org--tag-add-to-alist'?
                                      org-fast-tag-selection-maximum-tags))
                        (insert "Tags are limited displayed only has key bound.\n")
                        bound-tags)))
              char ?a cnt 0)
#+end_src

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v4] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-16  9:31                               ` Ihor Radchenko
@ 2023-05-16 12:12                                 ` Christopher M. Miles
  2023-05-16 12:12                                 ` Christopher M. Miles
  1 sibling, 0 replies; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-16 12:12 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 7437 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> Updated version which fix the `message` error in upper code:
>
> Thanks!
>
>> #+begin_src emacs-lisp
>> (setq tbl (let ((bound-tags (seq-filter 'cdr fulltable)))
>>                     (if (length< fulltable org-fast-tag-selection-maximum-tags)
>
> Because of (:startgroup) markers and similar things, this condition is
> not fully accurate. See `org-tag-alist' docstring.
>
> You may also need to consider special alist items in the rest of the code.
>
I added a let-binding to modify fulltable at first to filter out special tag markers.

>>                         fulltable
>>                       (if (length< bound-tags org-fast-tag-selection-maximum-tags)
>>                           (progn
>>                             (insert "Tags are limited displayed by `org-fast-tag-selection-maximum-tags'.\n")
>
> If you want to have proper Elisp symbol markup when using `...', use
> `format-message'.

Updated.

>
>>                             (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.

Using `append':

#+begin_example
Inherited:  video
Current:    

Tags are limited displayed by ‘org-fast-tag-selection-maximum-tags’.
  [d] drill                               [z] crypt                               [A] ARCHIVE                             
  [E] noexport                            [P] private                             [D] deprecated                          
  [O] outdated                            [t] translate                           [i] idea                                
  [h] book                                [b] bookmark                            [w] work                                
  [a] appointment                         [m] meeting                             [u] urgent                              
  [X] SEX                                 [k] wiki                                [C] code                                
  [e] Emacs                               [o] Org_mode                            [G] git                                 
  [L] Linux                               [M] macOS                               [W] Windows                             
  [l] LISP                                [c] Clojure                             [s] ClojureScript                       
  [J] Java                                [S] Shell                               [p] Python                              
  [r] Ruby                                [j] JavaScript                          [d] database                            
  [f] LOG                                 [g] @marks                              [n] on                                  
  [q] off                                 [v] star                                [x] like                                
  [y] favorite                            [{] suggested                           [|] heart                               
  [}] smile                               [~] brain                               [ ] check                               
  [ ] alert                               [ ] important                           [ ] flag                                
  [ ] error                               [ ] label                               
#+end_example

Using `org--tag-add-to-alist':

#+begin_example
Inherited:  video
Current:    

Tags are limited displayed by ‘org-fast-tag-selection-maximum-tags’.
  [d] drill                               [z] crypt                               [f] LOG                                 
  [A] ARCHIVE                             [E] noexport                            [P] private                             
  [D] deprecated                          [O] outdated                            [g] @marks                              
  [n] on                                  [q] off                                 [v] star                                
  [x] like                                [y] favorite                            [{] suggested                           
  [|] heart                               [}] smile                               [~] brain                               
  [ ] check                               [ ] alert                               [ ] important                           
  [ ] flag                                [ ] error                               [ ] label                               
  [ ] question                            [ ] info                                [ ] quote                               
  [ ] table                               [t] translate                           [ ] language                            
  [i] idea                                [ ] comment                             [ ] screenshot                          
  [ ] trash                               [ ] delete                              [ ] clear                               
  [ ] cancel                              [ ] lock                                [ ] unlock                              
  [ ] key                                 [ ] refresh                             [ ] repeat                              
  [ ] shuffle                             [h] book                                [b] bookmark                            
  [ ] note                                [ ] cheatsheet                          [ ] paperclip                           
  [ ] plot                                [ ] diagram                             
#+end_example

You can see the bound key tags are not fully displayed in buffer at second solution.

Here is the updated code:

#+begin_src emacs-lisp
(setq tbl (let* ((fulltable-accurate
                          (delq nil
                                (seq-filter
                                 (lambda (tag)
                                   (and (not (member tag '((:startgrouptag) (:grouptags) (:endgrouptag)))) tag))
                                 fulltable)))
                         (bound-tags (seq-filter 'cdr fulltable-accurate)))
                    (if (length< fulltable-accurate org-fast-tag-selection-maximum-tags)
                        fulltable
                      (if (length< bound-tags org-fast-tag-selection-maximum-tags)
                          (progn
                            (insert (format-message "Tags are limited displayed by `org-fast-tag-selection-maximum-tags'.\n"))
                            (seq-take (seq-uniq (append bound-tags fulltable-accurate)) ; TODO: consider to use `org--tag-add-to-alist'?
                                      org-fast-tag-selection-maximum-tags))
                        (insert "Tags are limited displayed only has key bound.\n")
                        bound-tags)))
              char ?a cnt 0)
#+end_src

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v4] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-16 12:12                                 ` Christopher M. Miles
@ 2023-05-16 18:53                                   ` Ihor Radchenko
  2023-05-17  5:57                                     ` [PATCH v4.1] " Christopher M. Miles
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2023-05-16 18:53 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> 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 <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v4.1] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-16 18:53                                   ` Ihor Radchenko
@ 2023-05-17  5:57                                     ` Christopher M. Miles
  2023-06-30 12:55                                       ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-05-17  5:57 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 3165 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> 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?

I improved the code a little. Can't figure out how to implement upper logic.
Can you finish the last part? Thanks

#+begin_src emacs-lisp
(setq tbl (let* ((tags-grouped (org-tag-alist-to-groups fulltable))
                         (fulltable-accurate (flatten-list (org-tag-alist-to-groups fulltable)))
                         (bound-tags (seq-filter 'cdr fulltable)))
                    ;; TODO: consider tag groups.
                    ;; 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.
                    (if (length< fulltable-accurate org-fast-tag-selection-maximum-tags)
                        fulltable
                      (if (length< bound-tags org-fast-tag-selection-maximum-tags)
                          (progn
                            (insert (format-message "Tags are limited displayed by `org-fast-tag-selection-maximum-tags'.\n"))
                            ;; TODO:
                            (seq-take (seq-uniq (org--tag-add-to-alist bound-tags fulltable))
                                      org-fast-tag-selection-maximum-tags))
                        (insert "Tags are limited displayed only has key bound.\n")
                        bound-tags)))
              char ?a cnt 0)
#+end_src

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v4.1] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-05-17  5:57                                     ` [PATCH v4.1] " Christopher M. Miles
@ 2023-06-30 12:55                                       ` Ihor Radchenko
  2023-07-01 10:31                                         ` [PATCH v5] " Christopher M. Miles
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2023-06-30 12:55 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

> I improved the code a little. Can't figure out how to implement upper logic.
> Can you finish the last part? Thanks
>
> #+begin_src emacs-lisp
> (setq tbl (let* ((tags-grouped (org-tag-alist-to-groups fulltable))
>...

I tried to improve the code readability in `org-fast-tag-selection'.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a19654583c6f2070096402bc712591a0a2c80d01

May you look at it again and see if you can manage to implement a full
patch now?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v5] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-06-30 12:55                                       ` Ihor Radchenko
@ 2023-07-01 10:31                                         ` Christopher M. Miles
  2023-07-01 11:34                                           ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2023-07-01 10:31 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode


[-- Attachment #1.1: Type: text/plain, Size: 741 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> I improved the code a little. Can't figure out how to implement upper logic.
>> Can you finish the last part? Thanks
>>
>> #+begin_src emacs-lisp
>> (setq tbl (let* ((tags-grouped (org-tag-alist-to-groups fulltable))
>>...
>
> I tried to improve the code readability in `org-fast-tag-selection'.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a19654583c6f2070096402bc712591a0a2c80d01
>
> May you look at it again and see if you can manage to implement a full
> patch now?

Ok, I update and re-generated the patch, also add new document and Org NEWS entries.

Review it, if has problem, notify me to modify. Thanks


[-- Attachment #1.2: 0001-org-Improve-the-tags-fast-selection-performance.patch --]
[-- Type: #("text/x-patch" 0 12 (prescient-regexps nil prescient-ignore-case t)), Size: 4459 bytes --]

From 77fdbf8552a0a2ff451bf9071f6646ac016cb262 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Sat, 1 Jul 2023 18:29:02 +0800
Subject: [PATCH] org: Improve the tags fast selection performance

* lisp/org.el (org-fast-tag-selection): Filter out only maximum number
limited tags has fast selection bound when `org-use-fast-tag-selection'
is 'auto and tags has fast select bound keys.
* lisp/org.el (org-fast-tag-selection-maximum-tags): Add new custom
option to set maximum tags number for fast tag selection.
* doc/org-manual.org (org-fast-tag-selection-maximum-tags): Add new
custom option document.
* etc/ORG-NEWS: declare this new custom option.
---
 doc/org-manual.org | 10 ++++++++++
 etc/ORG-NEWS       | 11 +++++++++++
 lisp/org.el        | 14 +++++++++++++-
 3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 3a49917d7..30fcf32dc 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -5073,6 +5073,16 @@ effect: start selection with {{{kbd(C-c C-c C-c)}}} instead of
 the special window is not even shown for single-key tag selection, it
 comes up only when you press an extra {{{kbd(C-c)}}}.
 
+#+vindex: org-fast-tag-selection-maximum-tags
+Limit the tags table when you have many tags. You can set the maximum
+tags number for fast tag selection interface. When the variable
+~org-use-fast-tag-selection~ is ~auto~ and
+~org-fast-tag-selection-maximum-tags~ variable value number is smaller
+than single key bound tags number, the fast tag selection will only
+show single key bound tags, in contrary, will show the maximum number
+limited tags. If ~org-use-fast-tag-selection~ is other values, will
+show full tags.
+
 ** Tag Hierarchy
 :PROPERTIES:
 :DESCRIPTION: Create a hierarchy of tags.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index cb4bc632b..dfabbfbed 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -322,6 +322,17 @@ special repeaters ~++~ and ~.+~ are skipped.
 A capture template can target ~(here)~ which is the equivalent of
 invoking a capture template with a zero prefix.
 
+*** Add new option ~org-fast-tag-selection-maximum-tags~ to limit fast tag selection interface displayed tags
+
+Limit the tags table when you have many tags. You can set the maximum
+tags number for fast tag selection interface. When the variable
+~org-use-fast-tag-selection~ is ~auto~ and
+~org-fast-tag-selection-maximum-tags~ variable value number is smaller
+than single key bound tags number, the fast tag selection will only
+show single key bound tags, in contrary, will show the maximum number
+limited tags. If ~org-use-fast-tag-selection~ is other values, will
+show full tags.
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries
 
diff --git a/lisp/org.el b/lisp/org.el
index fdb920864..f077cde12 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2775,6 +2775,12 @@ displaying the tags menu is not even shown, until you press `C-c' again."
 	  (const :tag "Yes" t)
 	  (const :tag "Expert" expert)))
 
+(defcustom org-fast-tag-selection-maximum-tags 26
+  "Set the maximum tags number for fast tag selection."
+  :group 'org-tags
+  :type 'number
+  :safe #'numberp)
+
 (defvar org-fast-tag-selection-include-todo nil
   "Non-nil means fast tags selection interface will also offer TODO states.
 This is an undocumented feature, you should not rely on it.")
@@ -11929,7 +11935,13 @@ these have keys assigned to them.
 If the keys are nil, a-z are automatically assigned.
 Returns the new tags string, or nil to not change the current settings."
   (let* (;; Combined alist of all the tags and todo keywords.
-         (tag-alist (append tag-table todo-table))
+         (tag-alist (let* ((tags-table (append tag-table todo-table))
+                           (binding-tags (seq-filter 'cdr tags-table)))
+                      (cl-case org-use-fast-tag-selection
+                        (auto (if (length> binding-tags org-fast-tag-selection-maximum-tags)
+                                  binding-tags
+                                (seq-take tags-table org-fast-tag-selection-maximum-tags)))
+                        (t tags-table))))
          ;; Max width occupied by a single tag record in the completion buffer.
 	 (field-width
           (+ 3 ; keep space for "[c]" binding.
-- 
2.39.2 (Apple Git-143)


[-- Attachment #1.3: Type: text/plain, Size: 267 bytes --]


-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH v5] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-07-01 10:31                                         ` [PATCH v5] " Christopher M. Miles
@ 2023-07-01 11:34                                           ` Ihor Radchenko
  2024-01-09 14:12                                             ` [PATCH v6] " Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2023-07-01 11:34 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

> Ok, I update and re-generated the patch, also add new document and Org NEWS entries.

Thanks!
See my comments below.

> * lisp/org.el (org-fast-tag-selection): Filter out only maximum number
> limited tags has fast selection bound when `org-use-fast-tag-selection'
> is 'auto and tags has fast select bound keys.

Why only for 'auto?

> * doc/org-manual.org (org-fast-tag-selection-maximum-tags): Add new
> custom option document.

*documentation.

> --- a/doc/org-manual.org
> +++ b/doc/org-manual.org
> @@ -5073,6 +5073,16 @@ effect: start selection with {{{kbd(C-c C-c C-c)}}} instead of
>  the special window is not even shown for single-key tag selection, it
>  comes up only when you press an extra {{{kbd(C-c)}}}.
>  
> +#+vindex: org-fast-tag-selection-maximum-tags
> +Limit the tags table when you have many tags. You can set the maximum

#+vindex entry will not be visible in the rendered manual. So, the first
 sentence of the paragraph reads awkwardly.

Also, please use double space between sentences. It is the convention
for Org manual, docstrings, and commit messages. See
doc/Documentation_Standards.org

> +(defcustom org-fast-tag-selection-maximum-tags 26
> +  "Set the maximum tags number for fast tag selection."
> +  :group 'org-tags
> +  :type 'number
> +  :safe #'numberp)

Why 26?
We use a-zA-Z{|}~

;; Characters available for auto-assignment.
         (tag-binding-char-list
          (eval-when-compile
            (string-to-list "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~")))

Also, please add :package-version keyword in the defcustom.

>    (let* (;; Combined alist of all the tags and todo keywords.
> -         (tag-alist (append tag-table todo-table))
> +         (tag-alist (let* ((tags-table (append tag-table todo-table))
> +                           (binding-tags (seq-filter 'cdr tags-table)))
> +                      (cl-case org-use-fast-tag-selection
> +                        (auto (if (length> binding-tags org-fast-tag-selection-maximum-tags)
> +                                  binding-tags
> +                                (seq-take tags-table org-fast-tag-selection-maximum-tags)))
> +                        (t tags-table))))

May you please instead:

1. Store the total number of bound tags, but using a bit more complex
   filter (`(:startgroup "foo")', `(:endgroup "bar")' are also valid alist
   members, but do not correspond to tag bindings). See `(pcase
   tag-binding-spec ...)'
2. Store the total number of tag in tag groups. See `ingroup'.
3. Add these two numbers and compare them with
   `org-fast-tag-selection-maximum-tags', calculating how many extra
   tags can be displayed.
4. Do not filter `tag-alist', but instead plug a code into `(while (setq
   tag-binding-spec (pop tag-alist)) ...)', counting how many tags are in
   There, in `;; Insert the tag.', only insert the tag when (1) tag has
   binding - (cdr tag-binding-spec); (2) tag is in a group - ingroup;
   (3) we still have space for extra tags, according to (3), then also
   decrease the leftover tag count.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v6] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2023-07-01 11:34                                           ` Ihor Radchenko
@ 2024-01-09 14:12                                             ` Ihor Radchenko
  2024-01-10  3:48                                               ` Christopher M. Miles
  0 siblings, 1 reply; 30+ messages in thread
From: Ihor Radchenko @ 2024-01-09 14:12 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

I have incorporated my suggestions into an updated patch.

Note that I dropped the condition that new customization only works for
org-use-fast-tag-selection = 'auto.

Please let me know if anything you wanted to see in this patch is
missing.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v6-0001-org-fast-tag-selection-Limit-the-number-of-displa.patch --]
[-- Type: text/x-patch, Size: 8290 bytes --]

From 79fee381dc5ecbaed5bfe3ba66b11bb2a02aa97f Mon Sep 17 00:00:00 2001
Message-ID: <79fee381dc5ecbaed5bfe3ba66b11bb2a02aa97f.1704809509.git.yantar92@posteo.net>
From: stardiviner <numbchild@gmail.com>
Date: Sat, 1 Jul 2023 18:29:02 +0800
Subject: [PATCH v6] org-fast-tag-selection: Limit the number of displayed tags

* lisp/org.el (org-fast-tag-selection): Do not print tags without
explicit bindings and tags outside groups when the number of displayed
tags exceeds new customization.
* lisp/org.el (org-fast-tag-selection-maximum-tags): Add new custom
option to set maximum tags number for fast tag selection.
(org--fast-tag-selection-keys): New internal variable holding keys
available for auto-assigning tag bindings.
* doc/org-manual.org (org-fast-tag-selection-maximum-tags): Add new
custom option documentation.
* etc/ORG-NEWS: Declare this new custom option.

Co-Authored-by: Ihor Radchenko <yantar92@posteo.net>
Link: https://list.orgmode.org/orgmode/CAL1eYuK7GUx_=47e8+N5Jh+ZJnDexY+CDMUjPjJHNmcMiVVRrQ@mail.gmail.com/
---
 doc/org-manual.org |  5 ++++
 etc/ORG-NEWS       |  5 ++++
 lisp/org.el        | 73 +++++++++++++++++++++++++++++++++++-----------
 3 files changed, 66 insertions(+), 17 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index acc6d07ff..bb4b6e625 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -5090,6 +5090,11 @@ ** Setting Tags
 the special window is not even shown for single-key tag selection, it
 comes up only when you press an extra {{{kbd(C-c)}}}.
 
+#+vindex: org-fast-tag-selection-maximum-tags
+The number of tags displayed in the fast tag selection interface is
+limited by ~org-fast-tag-selection-maximum-tags~ to avoid running out
+of keyboard keys.  You can customize this variable.
+
 ** Tag Hierarchy
 :PROPERTIES:
 :DESCRIPTION: Create a hierarchy of tags.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index b808357d8..847ddf614 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -371,6 +371,11 @@ The change is breaking when ~org-use-property-inheritance~ is set to ~t~.
 
 The =TEST= parameter is better served by Emacs debugging tools.
 ** New and changed options
+*** New option ~org-fast-tag-selection-maximum-tags~
+
+You can now limit the total number of tags displayed in the fast tag
+selection interface.  Useful in buffers with huge number of tags.
+
 *** New variable ~org-clock-out-removed-last-clock~
 
 The variable is intended to be used by ~org-clock-out-hook~.  It is a
diff --git a/lisp/org.el b/lisp/org.el
index 57379c26a..3d3099c48 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2790,6 +2790,25 @@ (defcustom org-fast-tag-selection-single-key nil
 	  (const :tag "Yes" t)
 	  (const :tag "Expert" expert)))
 
+(defvar org--fast-tag-selection-keys
+  (string-to-list "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~")
+  "List of chars to be used as bindings by `org-fast-tag-selection'.")
+
+(defcustom org-fast-tag-selection-maximum-tags (length org--fast-tag-selection-keys)
+  "Set the maximum tags number for fast tag selection.
+This variable only affects tags without explicit key bindings outside
+tag groups.  All the tags with user bindings and all the tags
+corresponding to tag groups are always displayed.
+
+When the number of tags with bindings + tags inside tag groups is
+smaller than `org-fast-tag-selection-maximum-tags', tags without
+explicit bindings will be assigned a binding and displayed up to the
+limit."
+  :package-version '(Org . "9.7")
+  :group 'org-tags
+  :type 'number
+  :safe #'numberp)
+
 (defvar org-fast-tag-selection-include-todo nil
   "Non-nil means fast tags selection interface will also offer TODO states.
 This is an undocumented feature, you should not rely on it.")
@@ -11983,9 +12002,8 @@ (defun org-fast-tag-selection (current-tags inherited-tags tag-table &optional t
 	 (inherited-face 'org-done)
 	 (current-face 'org-todo)
          ;; Characters available for auto-assignment.
-         (tag-binding-char-list
-          (eval-when-compile
-            (string-to-list "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~")))
+         (tag-binding-char-list org--fast-tag-selection-keys)
+         (tag-binding-chars-left org-fast-tag-selection-maximum-tags)
          field-number ; current tag column in the completion buffer.
          tag-binding-spec ; Alist element.
          current-tag current-tag-char auto-tag-char
@@ -11995,6 +12013,22 @@ (defun org-fast-tag-selection (current-tags inherited-tags tag-table &optional t
 	 (exit-after-next org-fast-tag-selection-single-key)
 	 (done-keywords org-done-keywords)
 	 groups ingroup intaggroup)
+    ;; Calculate the number of tags with explicit user bindings + tags in groups.
+    ;; These tags will be displayed unconditionally.  Other tags will
+    ;; be displayed only when there are free bindings left according
+    ;; to `org-fast-tag-selection-maximum-tags'.
+    (dolist (tag-binding-spec tag-alist)
+      (pcase tag-binding-spec
+        (`((or :startgroup :startgrouptag) . _)
+         (setq ingroup t))
+        (`((or :endgroup :endgrouptag) . _)
+         (setq ingroup nil))
+        ((guard (cdr tag-binding-spec))
+         (cl-decf tag-binding-chars-left))
+        (`((or :newline :grouptags))) ; pass
+        ((guard ingroup)
+         (cl-decf tag-binding-chars-left))))
+    (setq ingroup nil) ; It t, it means malformed tag alist.  Reset just in case.
     ;; Move global `org-tags-overlay' overlay to current heading.
     ;; Calls to `org-set-current-tags-overlay' will take care about
     ;; updating the overlay text.
@@ -12083,6 +12117,9 @@ (defun org-fast-tag-selection (current-tags inherited-tags tag-table &optional t
 	     (if (cdr tag-binding-spec)
                  ;; Custom binding.
 		 (setq current-tag-char (cdr tag-binding-spec))
+               ;; No auto-binding.  Update `tag-binding-chars-left'.
+               (unless (or ingroup intaggroup) ; groups are always displayed.
+                 (cl-decf tag-binding-chars-left))
 	       ;; Automatically assign a character according to the tag string.
 	       (setq auto-tag-char
                      (string-to-char
@@ -12116,20 +12153,22 @@ (defun org-fast-tag-selection (current-tags inherited-tags tag-table &optional t
 				               ((member current-tag inherited-tags) inherited-face))))
 	     (when (equal (caar tag-alist) :grouptags)
 	       (org-add-props current-tag nil 'face 'org-tag-group))
-             ;; Insert the tag.
-	     (when (and (zerop field-number) (not ingroup) (not intaggroup)) (insert "  "))
-	     (insert "[" current-tag-char "] " current-tag
-                     ;; Fill spaces up to FIELD-WIDTH.
-                     (make-string
-		      (- field-width 4 (length current-tag)) ?\ ))
-             ;; Record tag and the binding/auto-binding.
-	     (push (cons current-tag current-tag-char) tag-table-local)
-             ;; Last column in the row.
-	     (when (= (cl-incf field-number) (/ (- (window-width) 4) field-width))
-	       (unless (memq (caar tag-alist) '(:endgroup :endgrouptag))
-	         (insert "\n")
-	         (when (or ingroup intaggroup) (insert "  ")))
-	       (setq field-number 0)))))
+             ;; Respect `org-fast-tag-selection-maximum-tags'.
+             (when (or ingroup intaggroup (cdr tag-binding-spec) (> tag-binding-chars-left 0))
+               ;; Insert the tag.
+	       (when (and (zerop field-number) (not ingroup) (not intaggroup)) (insert "  "))
+	       (insert "[" current-tag-char "] " current-tag
+                       ;; Fill spaces up to FIELD-WIDTH.
+                       (make-string
+		        (- field-width 4 (length current-tag)) ?\ ))
+               ;; Record tag and the binding/auto-binding.
+	       (push (cons current-tag current-tag-char) tag-table-local)
+               ;; Last column in the row.
+	       (when (= (cl-incf field-number) (/ (- (window-width) 4) field-width))
+	         (unless (memq (caar tag-alist) '(:endgroup :endgrouptag))
+	           (insert "\n")
+	           (when (or ingroup intaggroup) (insert "  ")))
+	         (setq field-number 0))))))
         (insert "\n")
         ;; Keep the tags in order displayed.  Will be used later for sorting.
         (setq tag-table-local (nreverse tag-table-local))
-- 
2.43.0


[-- Attachment #3: Type: text/plain, Size: 224 bytes --]


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH v6] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2024-01-09 14:12                                             ` [PATCH v6] " Ihor Radchenko
@ 2024-01-10  3:48                                               ` Christopher M. Miles
  2024-01-12 12:00                                                 ` Ihor Radchenko
  0 siblings, 1 reply; 30+ messages in thread
From: Christopher M. Miles @ 2024-01-10  3:48 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Christopher M. Miles, Org-mode

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]


Thanks for updating, this patch looks great to me.

-- 

[ 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v6] Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`
  2024-01-10  3:48                                               ` Christopher M. Miles
@ 2024-01-12 12:00                                                 ` Ihor Radchenko
  0 siblings, 0 replies; 30+ messages in thread
From: Ihor Radchenko @ 2024-01-12 12:00 UTC (permalink / raw)
  To: Christopher M. Miles; +Cc: Org-mode

"Christopher M. Miles" <numbchild@gmail.com> writes:

> Thanks for updating, this patch looks great to me.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=dea7780d6

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-01-12 11:57 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-13  4:49 Improve the performance of `org-set-tags-command` on large `org-tag-alist` stardiviner
2023-05-13  7:43 ` Ihor Radchenko
2023-05-13  9:39   ` Christopher M. Miles
2023-05-13 11:13   ` stardiviner
2023-05-13 11:26     ` Ihor Radchenko
2023-05-13 14:24       ` [PATCH] " Christopher M. Miles
2023-05-13 18:43         ` Ihor Radchenko
2023-05-14  1:54           ` Christopher M. Miles
2023-05-14  8:09             ` Ihor Radchenko
2023-05-14 14:27               ` Christopher M. Miles
2023-05-14 14:58                 ` Ihor Radchenko
2023-05-14 16:27                   ` Christopher M. Miles
2023-05-14 17:38                     ` Ihor Radchenko
2023-05-14 18:14                       ` [PATCH v2] " Christopher M. Miles
2023-05-15 10:59                         ` Ihor Radchenko
2023-05-15 12:43                           ` Christopher M. Miles
2023-05-15 13:14                             ` Ihor Radchenko
2023-05-15 14:40                           ` [PATCH v3] " Christopher M. Miles
2023-05-15 16:12                             ` [PATCH v3.1] " Christopher M. Miles
2023-05-16  9:31                               ` Ihor Radchenko
2023-05-16 12:12                                 ` [PATCH v4] " Christopher M. Miles
2023-05-16 12:12                                 ` Christopher M. Miles
2023-05-16 18:53                                   ` Ihor Radchenko
2023-05-17  5:57                                     ` [PATCH v4.1] " Christopher M. Miles
2023-06-30 12:55                                       ` Ihor Radchenko
2023-07-01 10:31                                         ` [PATCH v5] " Christopher M. Miles
2023-07-01 11:34                                           ` Ihor Radchenko
2024-01-09 14:12                                             ` [PATCH v6] " Ihor Radchenko
2024-01-10  3:48                                               ` Christopher M. Miles
2024-01-12 12:00                                                 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).