emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: org-agenda-todo-ignore-* in tags search of TODO entries


From: Carsten Dominik
Subject: [Orgmode] Re: org-agenda-todo-ignore-* in tags search of TODO entries
Date: Thu, 22 May 2008 22:21:15 +0200

Hi Thomas, thanks for your patch.


what do others think, should these variables also apply to the general tags/todo/properties search?

- Carsten

On May 20, 2008, at 8:16 AM, Thomas Morgan wrote:

This patch makes org-agenda-todo-ignore-with-date,
org-agenda-todo-ignore-scheduled, and org-agenda-todo-ignore-deadlines
apply to tags searches of TODO entries.  Is this the right thing?

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 42382aa..8a9bfbd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-20  Thomas Morgan  <address@hidden>
+
+       * org.el (org-scan-tags): Obey org-agenda-todo-ignore-with-date,
+       org-agenda-todo-ignore-scheduled, and
+       org-agenda-todo-ignore-deadlines.
+
2008-05-10  Carsten Dominik  <address@hidden>

        * org-table.el (orgtbl-to-tsv, orgtbl-to-csv): New functions.
diff --git a/lisp/org.el b/lisp/org.el
index 37dd881..56262d5 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8878,36 +8878,54 @@ 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))
-                    (eval matcher)
-                    (or (not org-agenda-skip-archived-trees)
-                        (not (member org-archive-tag tags-list))))
-           (and (eq action 'agenda) (org-agenda-skip))
-           ;; list this headline
-
-           (if (eq action 'sparse-tree)
-               (progn
-                 (and org-highlight-sparse-tree-matches
-                      (org-get-heading) (match-end 0)
-                      (org-highlight-new-match
-                       (match-beginning 0) (match-beginning 1)))
-                 (org-show-context 'tags-tree))
-             (setq txt (org-format-agenda-item
-                        ""
-                        (concat
-                         (if org-tags-match-list-sublevels
-                             (make-string (1- level) ?.) "")
-                         (org-get-heading))
-                        category tags-list)
-                   priority (org-get-priority txt))
-             (goto-char lspos)
-             (setq marker (org-agenda-new-marker))
-             (org-add-props txt props
-               'org-marker marker 'org-hd-marker marker 'org-category category
-               'priority priority 'type "tagsmatch")
-             (push txt rtn))
-           ;; if we are to skip sublevels, jump to end of subtree
-           (or org-tags-match-list-sublevels (org-end-of-subtree t))))))
+         (let ((end (save-excursion (outline-next-heading) (point))))
+           (when (and (or (not todo-only)
+                          (and (member todo org-not-done-keywords)
+                               (or (not org-agenda-todo-ignore-with-date)
+                                   (not (save-excursion
+                                          (re-search-forward
+                                           org-ts-regexp end t))))
+                               (or (not org-agenda-todo-ignore-scheduled)
+                                   (not (save-excursion
+                                          (re-search-forward
+                                           org-scheduled-time-regexp end t))))
+                               (or (not org-agenda-todo-ignore-deadlines)
+                                   (not (save-excursion
+                                          (re-search-forward
+                                           org-deadline-time-regexp
+                                           end t)))
+                                   (not (org-deadline-close
+                                         (match-string 1))))))
+                      (eval matcher)
+                      (or (not org-agenda-skip-archived-trees)
+                          (not (member org-archive-tag tags-list))))
+             (and (eq action 'agenda) (org-agenda-skip))
+             ;; list this headline
+
+             (if (eq action 'sparse-tree)
+                 (progn
+                   (and org-highlight-sparse-tree-matches
+                        (org-get-heading) (match-end 0)
+                        (org-highlight-new-match
+                         (match-beginning 0) (match-beginning 1)))
+                   (org-show-context 'tags-tree))
+               (setq txt (org-format-agenda-item
+                          ""
+                          (concat
+                           (if org-tags-match-list-sublevels
+                               (make-string (1- level) ?.) "")
+                           (org-get-heading))
+                          category tags-list)
+                     priority (org-get-priority txt))
+               (goto-char lspos)
+               (setq marker (org-agenda-new-marker))
+               (org-add-props txt props
+                 'org-marker marker 'org-hd-marker marker
+                 'org-category category
+                 'priority priority 'type "tagsmatch")
+               (push txt rtn))
+             ;; if we are to skip sublevels, jump to end of subtree
+             (or org-tags-match-list-sublevels (org-end-of-subtree t)))))))
    (when (and (eq action 'sparse-tree)
               (not org-sparse-tree-open-archived-trees))
      (org-hide-archived-subtrees (point-min) (point-max)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]