From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Using org-agenda-filter-preset with or'd tags Date: Tue, 11 Jan 2011 08:20:40 -0500 Message-ID: <877heb4lw7.fsf@fastmail.fm> References: <87tyhikwkg.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=60336 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pce9U-0002OB-NG for emacs-orgmode@gnu.org; Tue, 11 Jan 2011 08:20:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pce9T-0006R9-Cu for emacs-orgmode@gnu.org; Tue, 11 Jan 2011 08:20:44 -0500 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:39766) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pce9T-0006R3-90 for emacs-orgmode@gnu.org; Tue, 11 Jan 2011 08:20:43 -0500 In-Reply-To: <87tyhikwkg.wl%dmaus@ictsoc.de> (David Maus's message of "Sun, 09 Jan 2011 14:58:55 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: David Maus Cc: johnt , emacs-orgmode@gnu.org David Maus writes: > At Mon, 20 Dec 2010 14:12:39 +0000 (UTC), > johnt wrote: >> I tried various filters to verify my syntax. >> using (org-agenda-filter-preset '("+@Work")) works fine but is not what I want. >> using (org-agenda-filter-preset '("@Work" "|" "critical")) also doesn't work. > > There are some errors in your `org-agenda-filter-preset': > > 1. You should not quote this list, because the entire structure of > `org-agenda-custom-commands' is already quoted. Quoting a list works fine in my org-agenda-custom-commands settings. In fact, there are other variables that have quoted lists as their setting, such as org-agenda-entry-types. > 2. Format of `org-agenda-filter-preset' (C-h v > org-agenda-filter-preset RET): > > ,---- > | A preset of the tags filter used for secondary agenda filtering. > | This must be a list of strings, each string must be a single tag preceded > | by "+" or "-". > `---- > > So ("@work" "|" "critical") is wrong format. That's the problem. > > 3. The preset filter ANDs the tags together and as far as I am aware > of (our could think of) it is not possible to OR tags together. > However, I wonder why you would like to set the preset-filter: The > tags-todo query already selects only tasks that are either tagged > @work or critical? > It would make sense if org-agenda-todo-ignore-scheduled is 'all or 'past. To use "or" logic to filter the agenda, I would recommend setting org-agenda-skip-function. --8<---------------cut here---------------start------------->8--- (setq org-agenda-custom-commands '(("W" "Work Schedule" ((agenda "" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp ":\\(@Work\\|critical\\):"))) (org-agenda-ndays 1))) (tags-todo "@Work|critical"))))) --8<---------------cut here---------------end--------------->8--- Best, Matt