From 8a0b03fb3bb3b76cb45a64f2bab5ad63a83b1b0d Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 12 Jun 2022 13:02:39 +0800 Subject: [PATCH] org-element-headline-parser: Fix headings like * COMMENTnospace * lisp/org-element.el (org-element-headline-parser): Do not parse headings like * COMMENTnospace as commented. --- lisp/org-element.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 59a7fd461..63e7c5632 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -1095,7 +1095,9 @@ Assume point is at beginning of the headline." (commentedp (and (let ((case-fold-search nil)) (looking-at org-element-comment-string)) - (goto-char (match-end 0)))) + (goto-char (match-end 0)) + (when (looking-at-p "\\(?:[ \t]\\|$\\)") + (point)))) (title-start (prog1 (point) (unless (or todo priority commentedp) ;; Headline like "* :tag:"