emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/org 771074ba5e 047/101: org-in-archived-heading-p: Use


From: ELPA Syncer
Subject: [elpa] externals/org 771074ba5e 047/101: org-in-archived-heading-p: Use org-element API
Date: Sat, 1 Jul 2023 09:59:08 -0400 (EDT)

branch: externals/org
commit 771074ba5e3e7eb6fcd7792a93fc7b312869af86
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-in-archived-heading-p: Use org-element API
---
 lisp/org.el | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 72ae318b9f..44a41f9f63 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20530,23 +20530,15 @@ This function also checks ancestors of the current 
headline,
 unless optional argument NO-INHERITANCE is non-nil.
 
 Optional argument ELEMENT contains element at point."
-  (cond
-   ((and (not element) (org-before-first-heading-p)) nil)
-   ((if element
-        (org-element-property :archivedp element)
-      (let ((tags (org-get-tags element 'local)))
-        (and tags
-            (cl-some (apply-partially #'string= org-archive-tag) tags)))))
-   (no-inheritance 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-parent element))))
-      (save-excursion (and (org-up-heading-safe) 
(org-in-archived-heading-p)))))))
+  (unless element
+    (setq
+     element
+     (org-element-lineage
+      (org-element-at-point)
+      '(headline inlinetask) 'with-self)))
+  (if no-inheritance
+      (org-element-property :archivedp element)
+    (org-element-property-inherited :archivedp element 'with-self)))
 
 (defun org-at-comment-p nil
   "Return t if cursor is in a commented line."



reply via email to

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