Browse Source

Agenda: Make sure all entries have a todo-state property

This is needed for sorting, and I had forgotten to add this property
to tag scans, and to sexps.

Reported by Christopher Suckling.
Carsten Dominik 16 years ago
parent
commit
a6c8fac4f9
3 changed files with 11 additions and 3 deletions
  1. 5 0
      lisp/ChangeLog
  2. 5 3
      lisp/org-agenda.el
  3. 1 0
      lisp/org.el

+ 5 - 0
lisp/ChangeLog

@@ -1,5 +1,10 @@
 2009-02-16  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-agenda.el (org-agenda-get-sexps): Add todo state as
+	property, for sorting.
+
+	* org.el (org-scan-tags): Add todo state as property, for sorting.
+
 	* org-agenda.el (org-agenda-custom-commands-local-options): Add
 	`org-agenda-overriding-header' as an option.
 	(org-agenda-list): Honor org-agenda-overriding-header'.

+ 5 - 3
lisp/org-agenda.el

@@ -3491,7 +3491,8 @@ the documentation of `org-diary'."
 		      (format "mouse-2 or RET jump to org file %s"
 			      (abbreviate-file-name buffer-file-name))))
 	 (regexp "^&?%%(")
-	 marker category ee txt tags entry result beg b sexp sexp-entry)
+	 marker category ee txt tags entry result beg b sexp sexp-entry
+	 todo-state)
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
       (catch :skip
@@ -3507,7 +3508,8 @@ the documentation of `org-diary'."
 	(setq result (org-diary-sexp-entry sexp sexp-entry date))
 	(when result
 	  (setq marker (org-agenda-new-marker beg)
-		category (org-get-category beg))
+		category (org-get-category beg)
+		todo-state (org-get-todo-state))
 
 	  (if (string-match "\\S-" result)
 	      (setq txt result)
@@ -3517,7 +3519,7 @@ the documentation of `org-diary'."
                      "" txt category tags 'time))
 	  (org-add-props txt props 'org-marker marker)
 	  (org-add-props txt nil
-	    'org-category category 'date date
+	    'org-category category 'date date 'todo-state todo-state
 	    'type "sexp")
 	  (push txt ee))))
     (nreverse ee)))

+ 1 - 0
lisp/org.el

@@ -9707,6 +9707,7 @@ only lines with a TODO keyword are included in the output."
 	      (setq marker (org-agenda-new-marker))
 	      (org-add-props txt props
 		'org-marker marker 'org-hd-marker marker 'org-category category
+		'todo-state todo
 		'priority priority 'type "tagsmatch")
 	      (push txt rtn))
 	     ((functionp action)