org-element-headline-parser: Treat "* TODO" as empty title + TODO keyword
* lisp/org-element.el (org-element-headline-parser): Allow end of line instead of space after todo keyword. * testing/lisp/test-org-element.el (test-org-element/headline-todo-keyword): Add new test.
This commit is contained in:
parent
cd2355a204
commit
93bf820384
|
@ -1103,7 +1103,7 @@ Assume point is at beginning of the headline."
|
|||
(skip-chars-forward " \t")))
|
||||
(level (org-reduced-level true-level))
|
||||
(todo (and org-todo-regexp
|
||||
(let (case-fold-search) (looking-at (concat org-todo-regexp " ")))
|
||||
(let (case-fold-search) (looking-at (concat org-todo-regexp "\\(?: \\|$\\)")))
|
||||
(progn (goto-char (match-end 0))
|
||||
(skip-chars-forward " \t")
|
||||
(match-string 1))))
|
||||
|
|
|
@ -1206,7 +1206,10 @@ Some other text
|
|||
;; Todo keyword is prefix of headlines first word.
|
||||
(org-test-with-temp-text "* TODOHeadline"
|
||||
(let ((org-todo-keywords '((sequence "TODO" "DONE"))))
|
||||
(should-not (org-element-property :todo-keyword (org-element-at-point))))))
|
||||
(should-not (org-element-property :todo-keyword (org-element-at-point)))))
|
||||
(org-test-with-temp-text "* TODO"
|
||||
(let ((org-todo-keywords '((sequence "TODO" "DONE"))))
|
||||
(should (org-element-property :todo-keyword (org-element-at-point))))))
|
||||
|
||||
(ert-deftest test-org-element/headline-comment-keyword ()
|
||||
"Test COMMENT keyword recognition."
|
||||
|
|
Loading…
Reference in New Issue