summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-01-20 16:06:19 +0100
committerBastien Guerry <bzg@altern.org>2014-01-20 16:06:19 +0100
commit80fc5adb58c13297214799cc924c294b771169f9 (patch)
tree548ec019f07365ae6192b0425b1aeea65c979771
parentea0d35674f2f19a5d005eb981eeda8aa21a91b46 (diff)
downloadorg-mode-80fc5adb58c13297214799cc924c294b771169f9.tar.gz
org.el (org-provide-todo-statistics): Allow to set to a list of two lists, for TODO and DONE keywords
* org.el (org-provide-todo-statistics): Allow to set to a list of two lists, one with TODO keywords, the other one with DONE keywords. (org-update-parent-todo-statistics): Correctly handle `org-provide-todo-statistics' when it is set as a list of two lists, for TODO and DONE keywords. Thanks to Fletcher Charest for reporting this and requesting this feature.
-rw-r--r--lisp/org.el24
1 files changed, 21 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 7ed7490..4af10cd 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2567,6 +2567,9 @@ ALL-HEADLINES means update todo statistics by including headlines
with no TODO keyword as well, counting them as not done.
A list of TODO keywords means the same, but skip keywords that are
not in this list.
+When set to a list of two lists, the first list contains keywords
+to consider as TODO keywords, the second list contains keywords
+to consider as DONE keywords.
When this is set, todo statistics is updated in the parent of the
current entry each time a todo state is changed."
@@ -2576,6 +2579,9 @@ current entry each time a todo state is changed."
(const :tag "Yes, including all entries" all-headlines)
(repeat :tag "Yes, for TODOs in this list"
(string :tag "TODO keyword"))
+ (list :tag "Yes, for TODOs and DONEs in these lists"
+ (repeat (string :tag "TODO keyword"))
+ (repeat (string :tag "DONE keyword")))
(other :tag "No TODO statistics" nil)))
(defcustom org-hierarchical-todo-statistics t
@@ -12710,13 +12716,25 @@ statistics everywhere."
(match-string 2)))
(if (or (eq org-provide-todo-statistics 'all-headlines)
(and (listp org-provide-todo-statistics)
+ (stringp (car org-provide-todo-statistics))
(or (member kwd org-provide-todo-statistics)
- (member kwd org-done-keywords))))
+ (member kwd org-done-keywords)))
+ (and (listp org-provide-todo-statistics)
+ (listp (car org-provide-todo-statistics))
+ (or (member kwd (car org-provide-todo-statistics))
+ (and (member kwd org-done-keywords)
+ (member kwd (cadr org-provide-todo-statistics))))))
(setq cnt-all (1+ cnt-all))
(if (eq org-provide-todo-statistics t)
(and kwd (setq cnt-all (1+ cnt-all)))))
- (and (member kwd org-done-keywords)
- (setq cnt-done (1+ cnt-done)))
+ (when (or (and (listp org-provide-todo-statistics)
+ (listp (car org-provide-todo-statistics))
+ (member kwd org-done-keywords)
+ (member kwd (cadr org-provide-todo-statistics)))
+ (and (listp org-provide-todo-statistics)
+ (stringp (car org-provide-todo-statistics))
+ (member kwd org-done-keywords)))
+ (setq cnt-done (1+ cnt-done)))
(outline-next-heading)))
(setq new
(if is-percent