diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2009-01-25 07:39:26 +0100 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2009-01-25 07:39:26 +0100 |
commit | 3fed83614e01ea6392278e3d5c434d676561fb5e (patch) | |
tree | 0d723a8a1225046f781996d6242ddc08d22c9f15 | |
parent | 22a6dccce1315e4518f022b96a28b6f108d51aaf (diff) | |
download | org-mode-3fed83614e01ea6392278e3d5c434d676561fb5e.tar.gz |
Agenda: A tags-todo search can now ignore timestamped items
The variables =org-agenda-todo-ignore-with-date=,
=org-agenda-todo-ignore-with-date=, and
=org-agenda-todo-ignore-with-date= make it possible to
exclude TODO entries which have this kind of planning info
associated with them. This is most useful for people who
schedule everything, and who use the TODO list mainly to find
things that are not yet scheduled. Thomas Morgan pointed out
that also the tags-todo search may serve exactly this
purpose, and that it might be good to have a way to make
these variables also apply to the tags-todo search. I can
see than, but could not convince myself to make this the
default. A new variable must be set to make this happen:
=org-agenda-tags-todo-honor-ignore-options=.
-rw-r--r-- | ORGWEBPAGE/Changes.org | 15 | ||||
-rwxr-xr-x | lisp/ChangeLog | 13 | ||||
-rw-r--r-- | lisp/org-agenda.el | 71 | ||||
-rw-r--r-- | lisp/org.el | 11 |
4 files changed, 90 insertions, 20 deletions
diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org index 48ffb53..23eb871 100644 --- a/ORGWEBPAGE/Changes.org +++ b/ORGWEBPAGE/Changes.org @@ -65,6 +65,21 @@ table. Note that since there is no "current filed" for the cursor, all row and column references must be absolute, not relative. +*** A tags-todo search can now ignore timestamped items + The variables =org-agenda-todo-ignore-with-date=, + =org-agenda-todo-ignore-with-date=, and + =org-agenda-todo-ignore-with-date= make it possible to + exclude TODO entries which have this kind of planning info + associated with them. This is most useful for people who + schedule everything, and who use the TODO list mainly to find + things that are not yet scheduled. Thomas Morgan pointed out + that also the tags-todo search may serve exactly this + purpose, and that it might be good to have a way to make + these variables also apply to the tags-todo search. I can + see than, but could not convince myself to make this the + default. A new variable must be set to make this happen: + =org-agenda-tags-todo-honor-ignore-options=. + * Version 6.18 ** Incompatible changes diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3267db2..cd8fd73 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2009-01-25 Carsten Dominik <carsten.dominik@gmail.com> + + * org.el (org-scan-tags): Call + `org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item'. + + * org-agenda.el (org-agenda-todo-list, org-agenda-match-view): New + customization groups. + (org-agenda-tags-todo-honor-ignore-options): New option. + (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item): + New function. + (org-agenda-get-todos): Use + `org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item'. + 2009-01-24 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-format-source-code-or-example): Escape diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 6eda9d5..2567df5 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -409,6 +409,18 @@ this one will be used." "Options concerning skipping parts of agenda files." :tag "Org Agenda Skip" :group 'org-agenda) +(defgroup org-agenda-daily/weekly nil + "Options concerning the daily/weekly agenda." + :tag "Org Agenda Daily/Weekly" + :group 'org-agenda) +(defgroup org-agenda-todo-list nil + "Options concerning the global todo list agenda view." + :tag "Org Agenda Todo List" + :group 'org-agenda) +(defgroup org-agenda-match-view nil + "Options concerning the general tags/property/todo match agenda view." + :tag "Org Agenda Match View" + :group 'org-agenda) (defvar org-agenda-archives-mode nil "Non-nil means, the agenda will include archived items. @@ -428,7 +440,7 @@ When nil, these trees are also scanned by agenda commands." When nil, the sublevels of a TODO entry are not checked, resulting in potentially much shorter TODO lists." :group 'org-agenda-skip - :group 'org-todo + :group 'org-agenda-todo-list :type 'boolean) (defcustom org-agenda-todo-ignore-with-date nil @@ -439,7 +451,7 @@ When this is set, it also covers deadlines and scheduled items, the settings of `org-agenda-todo-ignore-scheduled' and `org-agenda-todo-ignore-deadlines' will be ignored." :group 'org-agenda-skip - :group 'org-todo + :group 'org-agenda-todo-list :type 'boolean) (defcustom org-agenda-todo-ignore-scheduled nil @@ -448,7 +460,7 @@ 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'." :group 'org-agenda-skip - :group 'org-todo + :group 'org-agenda-todo-list :type 'boolean) (defcustom org-agenda-todo-ignore-deadlines nil @@ -457,7 +469,22 @@ Near means closer than `org-deadline-warning-days' days. The idea behind this is that such items will appear in the agenda anyway. See also `org-agenda-todo-ignore-with-date'." :group 'org-agenda-skip - :group 'org-todo + :group 'org-agenda-todo-list + :type 'boolean) + +(defcustom org-agenda-tags-todo-honor-ignore-options nil + "Non-nil means, honor todo-list ...ignore options also in tags-todo search. +The variables + `org-agenda-todo-ignore-with-date', + `org-agenda-todo-ignore-scheduled' + `org-agenda-todo-ignore-deadlines' +make the global TODO list skip entries that have time stamps of certain +kinds. If this option is set, the same options will also apply for the +tags-todo search, which is the general tags/property matcher +restricted to unfinished TODO entries only." + :group 'org-agenda-skip + :group 'org-agenda-todo-list + :group 'org-agenda-match-view :type 'boolean) (defcustom org-agenda-skip-scheduled-if-done nil @@ -467,6 +494,7 @@ it applies only to the actual date of the scheduling. Warnings about an item with a past scheduling dates are always turned off when the item is DONE." :group 'org-agenda-skip + :group 'org-agenda-daily/weekly :type 'boolean) (defcustom org-agenda-skip-deadline-if-done nil @@ -476,11 +504,13 @@ This is relevant for the daily/weekly agenda. And it applied only to the actually date of the deadline. Warnings about approaching and past-due deadlines are always turned off when the item is DONE." :group 'org-agenda-skip + :group 'org-agenda-daily/weekly :type 'boolean) (defcustom org-agenda-skip-timestamp-if-done nil "Non-nil means don't select item by timestamp or -range if it is DONE." :group 'org-agenda-skip + :group 'org-agenda-daily/weekly :type 'boolean) (defcustom org-timeline-show-empty-dates 3 @@ -559,11 +589,6 @@ option will be ignored.." :group 'org-agenda-windows :type 'boolean) -(defgroup org-agenda-daily/weekly nil - "Options concerning the daily/weekly agenda." - :tag "Org Agenda Daily/Weekly" - :group 'org-agenda) - (defcustom org-agenda-ndays 7 "Number of days to include in overview display. Should be 1 or 7." @@ -640,7 +665,8 @@ and timeline buffers." (defcustom org-agenda-include-all-todo nil "Set means weekly/daily agenda will always contain all TODO entries. The TODO entries will be listed at the top of the agenda, before -the entries for specific days." +the entries for specific days. +This option is deprecated, it is better to define a block agenda instead." :group 'org-agenda-daily/weekly :type 'boolean) @@ -1000,7 +1026,6 @@ or a list like `(:background \"Red\")'." (list (character :tag "Priority" :value ?A) (sexp :tag "face"))))) - (defgroup org-agenda-column-view nil "Options concerning column view in the agenda." :tag "Org Agenda Column View" @@ -3248,13 +3273,7 @@ the documentation of `org-diary'." (save-match-data (beginning-of-line) (setq beg (point) end (progn (outline-next-heading) (point))) - (when (or (and org-agenda-todo-ignore-with-date (goto-char beg) - (re-search-forward org-ts-regexp end t)) - (and org-agenda-todo-ignore-scheduled (goto-char beg) - (re-search-forward org-scheduled-time-regexp end t)) - (and org-agenda-todo-ignore-deadlines (goto-char beg) - (re-search-forward org-deadline-time-regexp end t) - (org-deadline-close (match-string 1)))) + (when (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item end) (goto-char (1+ beg)) (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible)) (throw :skip nil))) @@ -3277,6 +3296,22 @@ the documentation of `org-diary'." (org-end-of-subtree 'invisible)))) (nreverse ee))) +;;;###autoload +(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 + org-agenda-todo-ignore-deadlines) + (setq end (or end (save-excursion (outline-next-heading) (point)))) + (save-excursion + (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)) + (and org-agenda-todo-ignore-deadlines + (re-search-forward org-deadline-time-regexp end t) + (org-deadline-close (match-string 1))))))) + (defconst org-agenda-no-heading-message "No heading for this item in buffer or region.") diff --git a/lisp/org.el b/lisp/org.el index f114862..349c547 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -2497,6 +2497,9 @@ Normal means, no org-mode-specific context." (declare-function org-agenda-save-markers-for-cut-and-paste "org-agenda" (beg end)) (declare-function org-agenda-copy-local-variable "org-agenda" (var)) +(declare-function org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item + "org-agenda" (&optional end)) + (declare-function parse-time-string "parse-time" (string)) (declare-function remember "remember" (&optional initial)) (declare-function remember-buffer-desc "remember" ()) @@ -2651,7 +2654,8 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables." (org-autoload "org-agenda" '(org-agenda org-agenda-list org-search-view org-todo-list org-tags-view org-agenda-list-stuck-projects - org-diary org-agenda-to-appt))) + org-diary org-agenda-to-appt + org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))) ;; Autoload org-remember @@ -9327,7 +9331,10 @@ only lines with a TODO keyword are included in the output." ;; selective inheritance, remove uninherited ones (setcdr (car tags-alist) (org-remove-uniherited-tags (cdar tags-alist)))) - (when (and (or (not todo-only) (member todo org-not-done-keywords)) + (when (and (or (not todo-only) + (and (member todo org-not-done-keywords) + (or (not org-agenda-tags-todo-honor-ignore-options) + (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))))) (let ((case-fold-search t)) (eval matcher)) (or (not (member org-archive-tag tags-list)) |