mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-25 07:27:57 +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:
parent
e9bd219e35
commit
c35a856048
10
lisp/org.el
10
lisp/org.el
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user