0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-24 09:48:51 +00:00

org-in-archived-heading-p: Improve performance

* lisp/org.el (org-in-archived-heading-p): Use explicit `while' loop
instead of `org-element-lineage'.
This commit is contained in:
Ihor Radchenko 2022-09-21 12:26:04 +08:00
parent e9bd219e35
commit c35a856048
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -20156,9 +20156,13 @@ Optional argument ELEMENT contains element at point."
(cl-some (apply-partially #'string= org-archive-tag) tags)))))
(no-inheritance nil)
(t
(if (org-element--cache-active-p)
(cl-some (lambda (el) (org-element-property :archivedp el))
(org-element-lineage (or element (org-element-at-point)) nil t))
(if (or element (org-element--cache-active-p))
(catch :archived
(unless element (setq element (org-element-at-point)))
(while element
(when (org-element-property :archivedp element)
(throw :archived t))
(setq element (org-element-property :parent element))))
(save-excursion (and (org-up-heading-safe) (org-in-archived-heading-p)))))))
(defun org-at-comment-p nil