emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: Agenda todo filter order
Date: Sun, 8 May 2011 08:03:40 +0200	[thread overview]
Message-ID: <E27A0600-A9BF-4495-830B-9422C60B9416@gmail.com> (raw)
In-Reply-To: <878vujiv6x.fsf@norang.ca>


On 6.5.2011, at 19:40, Bernt Hansen wrote:

> Hi Carsten,
> 
> Thanks for the patch!  This almost does what I want :)
> 
> This patch works for TODO agendas but not tags match agendas which is
> what I am trying to use.
> 
> C-c a y returns the result I want
> C-c a x should be identical and is not.


Hi Bernt,

here is a patch to *replace* the other patch I sent earlier.  This one
should also work for tags-todo searches....

Completely untested......

Changes at master
	Modified lisp/org-agenda.el
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)
	Modified lisp/org.el
diff --git a/lisp/org.el b/lisp/org.el
index acbb261..a9dcf46 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12437,17 +12437,30 @@ 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
+		 (or (not todo-only)
+		     (and (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
 

  reply	other threads:[~2011-05-08  6:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20  0:33 Agenda todo filter order Bernt Hansen
2011-04-20  0:39 ` Bernt Hansen
2011-05-06  6:24   ` Carsten Dominik
2011-05-06 17:40     ` Bernt Hansen
2011-05-08  6:03       ` Carsten Dominik [this message]
2011-05-08 14:49         ` Bernt Hansen
2011-05-08 15:55         ` Bernt Hansen
2011-05-08 16:01           ` Bernt Hansen
     [not found]             ` <11B052C5-6EC9-4B0A-A0FA-631908E50007@gmail.com>
     [not found]               ` <87liyhf459.fsf@norang.ca>
2011-05-10  6:59                 ` Carsten Dominik
2011-05-10 12:39                   ` Bernt Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E27A0600-A9BF-4495-830B-9422C60B9416@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).