From 8a827437a5f3e5c4f45d00c0926c317f1209415b Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Tue, 8 Nov 2022 21:18:42 +0800 Subject: [PATCH] org--at-headline-data-p: Fix when at :post-blank after heading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org.el (org--at-headline-data-p): Fix infinite loop when within blank lines after empty heading. Reported-by: David Lukeš Link: https://orgmode.org/list/CAEPTPEw9hugOWmzhNWCzCeXzV_qNePAdz4BbOp_sanTH9ZJ+AA@mail.gmail.com --- lisp/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 68f596c3d..17f5d9c1d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18657,7 +18657,8 @@ Optional argument ELEMENT contains element at BEG." (org-with-wide-buffer (when beg (goto-char beg)) (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. ;; Skip to top-level parent in section. (while (not (eq 'section (org-element-type (org-element-property :parent element))))