diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2011-05-08 11:18:58 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2011-05-10 08:58:04 +0200 |
commit | 9dba548cd54a000bd24d15452ac4340ba995febb (patch) | |
tree | 6269b45519bc6fb53a1f280246fcf137881d9b90 | |
parent | cd05598dcd30f98f3919213752c72f911d9c2489 (diff) | |
download | org-mode-9dba548cd54a000bd24d15452ac4340ba995febb.tar.gz |
Agenda Views: Call `org-agenda-skip' first.
* lisp/org-agenda.el (org-agenda-get-todos): Call `org-agenda-skip' first,
then check if timestamps cause exclusion.
* lisp/org.el (org-scan-tags): Call `org-agenda-skip' first,
then check if timestamps cause exclusion.
For more information, see the following mailing list thread:
http://thread.gmane.org/gmane.emacs.orgmode/41052/focus=41052
-rw-r--r-- | lisp/org-agenda.el | 3 | ||||
-rw-r--r-- | lisp/org.el | 36 |
2 files changed, 26 insertions, 13 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 609edd4..84e3247 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4575,13 +4575,12 @@ the documentation of `org-diary'." (catch :skip (save-match-data (beginning-of-line) + (org-agenda-skip) (setq beg (point) end (save-excursion (outline-next-heading) (point))) (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))) - (goto-char beg) - (org-agenda-skip) (goto-char (match-beginning 1)) (setq marker (org-agenda-new-marker (match-beginning 0)) category (org-get-category) diff --git a/lisp/org.el b/lisp/org.el index acbb261..975266c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12437,17 +12437,31 @@ only lines with a TODO keyword are included in the output." ;; selective inheritance, remove uninherited ones (setcdr (car tags-alist) (org-remove-uninherited-tags (cdar tags-alist)))) - (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)) - ;; we have an archive tag, should we use this anyway? - (or (not org-agenda-skip-archived-trees) - (and (eq action 'agenda) org-agenda-archives-mode)))) - (unless (eq action 'sparse-tree) (org-agenda-skip)) + (when (and + + ;; eval matcher only when the todo condition is OK + (and (or (not todo-only) (member todo org-not-done-keywords)) + (let ((case-fold-search t)) (eval matcher))) + + ;; Call the skipper, but return t if it does not skip, + ;; so that the `and' form continues evaluating + (progn + (unless (eq action 'sparse-tree) (org-agenda-skip)) + t) + + ;; Check if timestamps are deselecting this entry + (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))))) + + ;; Extra check for the archive tag + ;; FIXME: Does the skipper already do this???? + (or + (not (member org-archive-tag tags-list)) + ;; we have an archive tag, should we use this anyway? + (or (not org-agenda-skip-archived-trees) + (and (eq action 'agenda) org-agenda-archives-mode)))) ;; select this headline |