diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2014-10-15 10:49:40 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2014-10-28 14:23:53 +0100 |
commit | 03745338277e450e5989a29850114c735b19cf7a (patch) | |
tree | f3d24823dad6e035dbbb55ef74d1a24c1c74f1c3 | |
parent | 705a2cdeab8da1a9a736039886ee8f46f5bc5358 (diff) | |
download | org-mode-03745338277e450e5989a29850114c735b19cf7a.tar.gz |
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.
-rwxr-xr-x | lisp/org.el | 4 | ||||
-rw-r--r-- | testing/lisp/test-org.el | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index c940b2a..13c3b5b 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -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. diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 7a49510..3970fb1 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -1081,6 +1081,11 @@ (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" (org-mode-restart) |