瀏覽代碼

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.
Nicolas Goaziou 10 年之前
父節點
當前提交
0374533827
共有 2 個文件被更改,包括 7 次插入2 次删除
  1. 2 2
      lisp/org.el
  2. 5 0
      testing/lisp/test-org.el

+ 2 - 2
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.

+ 5 - 0
testing/lisp/test-org.el

@@ -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"