From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Agenda todo filter order Date: Tue, 10 May 2011 08:59:16 +0200 Message-ID: <580118AD-54F9-48B5-BCC4-AD458F309650@gmail.com> References: <87zknlhici.fsf@norang.ca> <87tydthi1x.fsf@norang.ca> <08D28BBE-80FF-4754-97BB-9674D2EB7CB5@gmail.com> <878vujiv6x.fsf@norang.ca> <87tyd5fapn.fsf@norang.ca> <87pqntfafo.fsf@norang.ca> <11B052C5-6EC9-4B0A-A0FA-631908E50007@gmail.com> <87liyhf459.fsf@norang.ca> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJguj-0004xo-Kl for emacs-orgmode@gnu.org; Tue, 10 May 2011 02:59:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJgui-0004xy-9P for emacs-orgmode@gnu.org; Tue, 10 May 2011 02:59:25 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:42655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJgui-0004xq-1X for emacs-orgmode@gnu.org; Tue, 10 May 2011 02:59:24 -0400 Received: by bwz17 with SMTP id 17so5917966bwz.0 for ; Mon, 09 May 2011 23:59:21 -0700 (PDT) In-Reply-To: <87liyhf459.fsf@norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode mailing list I have pushed this patch. - Carsten On 8.5.2011, at 20:17, Bernt Hansen wrote: > Hi Carsten, >=20 > I think this one works :) \o/ >=20 > Thanks! >=20 > -Bernt >=20 >=20 > Carsten Dominik writes: >=20 >> Hi Bernt, >>=20 >> here is another try, I fixed a logical bug in the previous patch... >> Again, this patch replaces the previous one. >>=20 >> 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..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) >> + =20 >> + ;; 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)))) >>=20 >> ;; select this headline >>=20