Function: org-in-commented-heading-p
org-in-commented-heading-p is a byte-compiled function defined in
org.el.gz.
Signature
(org-in-commented-heading-p &optional NO-INHERITANCE ELEMENT)
Documentation
Non-nil if point is under a commented 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-commented-heading-p (&optional no-inheritance element)
"Non-nil if point is under a commented 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."
(save-match-data
(let ((el (or element
(org-element-at-point nil 'cached)
(org-with-wide-buffer
(org-back-to-heading-or-point-min t)
(org-element-at-point)))))
(catch :found
(setq el (org-element-lineage el '(headline inlinetask) 'include-self))
(if no-inheritance
(org-element-property :commentedp el)
(while el
(when (org-element-property :commentedp el)
(throw :found t))
(setq el (org-element-property :parent el))))))))