org--at-headline-data-p: Fix when at :post-blank after heading

* lisp/org.el (org--at-headline-data-p): Fix infinite loop when within
blank lines after empty heading.

Reported-by: David Lukeš <dafydd.lukes@gmail.com>
Link: https://orgmode.org/list/CAEPTPEw9hugOWmzhNWCzCeXzV_qNePAdz4BbOp_sanTH9ZJ+AA@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2022-11-08 21:18:42 +08:00
parent 0de063a521
commit 8a827437a5
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -18657,7 +18657,8 @@ Optional argument ELEMENT contains element at BEG."
(org-with-wide-buffer (org-with-wide-buffer
(when beg (goto-char beg)) (when beg (goto-char beg))
(setq element (or element (org-element-at-point))) (setq element (or element (org-element-at-point)))
(if (not (org-element-lineage element '(headline inlinetask))) (if (or (eq (org-element-type element) 'headline)
(not (org-element-lineage element '(headline inlinetask))))
nil ; Not inside heading. nil ; Not inside heading.
;; Skip to top-level parent in section. ;; Skip to top-level parent in section.
(while (not (eq 'section (org-element-type (org-element-property :parent element)))) (while (not (eq 'section (org-element-type (org-element-property :parent element))))