From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [PATCH] Fix org-agenda-skip-if bug Date: Fri, 16 Mar 2012 19:16:28 +0100 Message-ID: <87aa3gqtf6.fsf@altern.org> References: <20120212210639.GA19747@c3po.home> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8c5K-0000A0-F8 for emacs-orgmode@gnu.org; Fri, 16 Mar 2012 14:41:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8c5F-0002SA-IJ for emacs-orgmode@gnu.org; Fri, 16 Mar 2012 14:41:05 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:52498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8c5F-0002Rx-9Z for emacs-orgmode@gnu.org; Fri, 16 Mar 2012 14:41:01 -0400 Received: by werj55 with SMTP id j55so5449884wer.0 for ; Fri, 16 Mar 2012 11:40:59 -0700 (PDT) In-Reply-To: <20120212210639.GA19747@c3po.home> (Toby Cubitt's message of "Sun, 12 Feb 2012 22:06:39 +0100") 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: emacs-orgmode@gnu.org Hi Toby, Toby Cubitt writes: > There appears to be a bug in how org-agenda-skip-if parses the list of > CONDITIONS supplied to it. Applied, thanks. > The combination '(nottodo todo) is a valid condition, matching todo items > whose state isn't a todo-type keyword (according to the keyword types > defined in `org-todo-keywords'). But `org-agenda-skip-if' tests first for > conditions of the form '(todo x) using (memq 'todo conditions), which > mistakenly picks up '(nottodo todo) as well. > > Simply reversing the order of the memq tests for 'todo and 'nottodo fixes > this particular case, which is what the attached patch does. Thanks for the explanations. > Note that there's still a slightly different issue with combinations of > multiple todo tests, which this patch does not fix. The docstring > suggests that CONDITIONS is allowed to be a list of multiple > tests. E.g. '(nottodo CANCELLED todo done) should match any done state > except CANCELLED. But, faced with this combination, > `organ-agenda-skip-if' will only apply the first '(nottodo CANCELLED) > test, and ignores the second. > > However, it's not clear to me whether this is a problem with the code or > the docstring. Perhaps it was never intended to support combinations of > multiple todo tests. I don't know. If someone can digg this issue further and report what should be fixed, that'd help. Thanks! -- Bastien