Function: org-in-archived-heading-p

org-in-archived-heading-p is a byte-compiled function defined in org.el.gz.

Signature

(org-in-archived-heading-p &optional NO-INHERITANCE ELEMENT)

Documentation

Non-nil if point is under an archived heading.

This function also checks ancestors of the current headline, unless optional argument NO-INHERITANCE is non-nil.

Optional argument ELEMENT contains element at point.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-in-archived-heading-p (&optional no-inheritance element)
  "Non-nil if point is under an archived heading.
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-property :parent element))))
      (save-excursion (and (org-up-heading-safe) (org-in-archived-heading-p)))))))