Fix multiple TODO keywords

* lisp/org.el (org--setup-collect-keywords): Correctly collect
  multiple TODO lines.
* testing/lisp/test-org.el (test-org/set-regexps-and-options): Add
test.

Thanks to Eric Abrahamsen for reporting it.
This commit is contained in:
Nicolas Goaziou 2014-10-15 10:49:40 +02:00
parent 705a2cdeab
commit 0374533827
2 changed files with 7 additions and 2 deletions

View File

@ -5170,10 +5170,10 @@ Return value contains the following keys: `archive', `category',
(org-split-string value)))
(push (cons 'tags (org-split-string value)) alist))))
((member key '("TODO" "SEQ_TODO" "TYP_TODO"))
(let ((todo (cdr (assq 'todo alist)))
(let ((todo (assq 'todo alist))
(value (cons (if (equal key "TYP_TODO") 'type 'sequence)
(org-split-string value))))
(if todo (push value todo)
(if todo (push value (cdr todo))
(push (list 'todo value) alist))))
((equal key "SETUPFILE")
(unless buffer-read-only ; Do not check in Gnus messages.

View File

@ -1080,6 +1080,11 @@
(org-test-with-temp-text "#+TODO: A B | C"
(org-mode-restart)
(list org-not-done-keywords org-done-keywords))))
(should
(equal '(("A" "C") ("B" "D"))
(org-test-with-temp-text "#+TODO: A | B\n#+TODO: C | D"
(org-mode-restart)
(list org-not-done-keywords org-done-keywords))))
(should
(equal '(("A" "B") ("C"))
(org-test-with-temp-text "#+TYP_TODO: A B | C"