summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@mit.edu>2010-02-12 18:06:15 -0500
committerCarsten Dominik <carsten.dominik@gmail.com>2010-02-14 22:33:40 +0100
commit36268491a0d18226d1d464a06fdda8cf5965ea6a (patch)
tree22e6e273f10719e6473b202e5c6ac11a3fcf7e1e
parentb3e92a81931ac831b6f5e22f5f3762eb879bdef1 (diff)
downloadorg-mode-36268491a0d18226d1d464a06fdda8cf5965ea6a.tar.gz
org-agenda: Allow finer control of ignored todos.
Add new options to org-agenda-todo-ignore-{scheduled,deadlines}. These will be convenient for users who want to see only todos that need attention.
-rwxr-xr-xlisp/ChangeLog10
-rw-r--r--lisp/org-agenda.el70
2 files changed, 68 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 31f5fc0..7624a14 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2010-02-14 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-todo-ignore-scheduled): More allowed
+ values.
+ (org-agenda-todo-ignore-scheduled)
+ (org-agenda-todo-ignore-deadlines): More control with different
+ allowed values.
+ (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
+ Honor the new option settings.
+
2010-02-12 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-get-location): Make sure the selection buffer is
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 21c605f..c808a67 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -532,24 +532,59 @@ See also the variable `org-agenda-tags-todo-honor-ignore-options'."
:type 'boolean)
(defcustom org-agenda-todo-ignore-scheduled nil
- "Non-nil means don't show scheduled entries in the global todo list.
-The idea behind this is that by scheduling it, you have already taken care
-of this item.
+ "Non-nil means, ignore some scheduled TODO items when making TODO list.
+This applie when creating the global todo list.
+Valid values are:
+
+past Don't show entries scheduled today or in the past.
+
+future Don't show entries scheduled in the future.
+ The idea behind this is that by scheduling it, you don't want to
+ think about it until the scheduled date.
+
+t Don't show any scheduled entries in the global todo list.
+ The idea behind this is that by scheduling it, you have already
+ \"taken care\" of this item.
+
See also `org-agenda-todo-ignore-with-date'.
-See also the variable `org-agenda-tags-todo-honor-ignore-options'."
+See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
+to make his option also apply to the tags-todo list."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
- :type 'boolean)
+ :type '(choice
+ (const :tag "Ignore future-scheduled todos" future)
+ (const :tag "Ignore past- or present-scheduled todos" past)
+ (const :tag "Ignore all scheduled todos" all)
+ (const :tag "Ignore all scheduled todos (compatibility)" t)
+ (const :tag "Show scheduled todos" nil)))
(defcustom org-agenda-todo-ignore-deadlines nil
- "Non-nil means don't show near deadline entries in the global todo list.
-A deadline is near when it is closer than `org-deadline-warning-days' days.
-The idea behind this is that such items will appear in the agenda anyway.
+ "Non-nil means ignore some deadlined TODO items when making TODO list.
+
+This applie when creating the global todo list.
+Valid values are:
+
+near Don't show near deadline entries. A deadline is near when it is
+ closer than `org-deadline-warning-days' days. The idea behind this
+ is that such items will appear in the agenda anyway.
+
+t For backward compatibility, this means the same as `near'.
+
+far Don't show far deadline entries. This is useful if you don't want
+ to use the todo list to figure out what to do now.
+
+all Ignore all TODO entries that do have a deadline.
+
See also `org-agenda-todo-ignore-with-date'.
See also the variable `org-agenda-tags-todo-honor-ignore-options'."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
- :type 'boolean)
+ :type '(choice
+ (const :tag "Ignore near deadlines" near)
+ (const :tag "Ignore far deadlines" far)
+ (const :tag "Ignore near deadlines (compatibility)" t)
+ (const :tag "Ignore all TODOs with a deadlines" all)
+ (const :tag "Show all TODOs, even if they have a deadline" nil)))
(defcustom org-agenda-tags-todo-honor-ignore-options nil
"Non-nil means honor todo-list ...ignore options also in tags-todo search.
@@ -4065,7 +4100,8 @@ the documentation of `org-diary'."
(nreverse ee)))
;;;###autoload
-(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item (&optional end)
+(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
+ (&optional end)
"Do we have a reason to ignore this todo entry because it has a time stamp?"
(when (or org-agenda-todo-ignore-with-date
org-agenda-todo-ignore-scheduled
@@ -4075,10 +4111,20 @@ the documentation of `org-diary'."
(or (and org-agenda-todo-ignore-with-date
(re-search-forward org-ts-regexp end t))
(and org-agenda-todo-ignore-scheduled
- (re-search-forward org-scheduled-time-regexp end t))
+ (re-search-forward org-scheduled-time-regexp end t)
+ (cond
+ ((eq org-agenda-todo-ignore-scheduled 'future)
+ (> (org-days-to-time (match-string 1)) 0))
+ ((eq org-agenda-todo-ignore-scheduled 'past)
+ (<= (org-days-to-time (match-string 1)) 0))
+ (t)))
(and org-agenda-todo-ignore-deadlines
(re-search-forward org-deadline-time-regexp end t)
- (org-deadline-close (match-string 1)))))))
+ (cond
+ ((memq org-agenda-todo-ignore-deadlines '(t all)) t)
+ ((eq org-agenda-todo-ignore-deadlines 'far)
+ (not (org-deadline-close (match-string 1))))
+ (t (org-deadline-close (match-string 1)))))))))
(defconst org-agenda-no-heading-message
"No heading for this item in buffer or region.")