From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Custom agenda view by TODO state and tag Date: Tue, 26 Apr 2011 08:04:45 -0400 Message-ID: <874o5lw74y.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEh0a-0007xs-4Y for emacs-orgmode@gnu.org; Tue, 26 Apr 2011 08:04:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEh0Z-0008MA-2Y for emacs-orgmode@gnu.org; Tue, 26 Apr 2011 08:04:48 -0400 Received: from out4.smtp.messagingengine.com ([66.111.4.28]:37234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEh0Y-0008M5-RX for emacs-orgmode@gnu.org; Tue, 26 Apr 2011 08:04:47 -0400 In-Reply-To: (Laurynas Biveinis's message of "Tue, 26 Apr 2011 06:42:47 +0300") 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: Laurynas Biveinis Cc: emacs-orgmode@gnu.org Laurynas Biveinis writes: > I want to create a custom agenda view that filters by both TODO state > and tags, i.e. a combination of todo and tags-todo search types. I > have tried creating custom search action > ((org-agenda-todo "TODO") (org-agenda-filter "tag1|tag2")) but failed. The easiest way is to do a simple search. 1. If you want just one tag, you can use: C-c a M TODO="TODO"+tag1 2. To find TODO *and* (tag1 *or* tag2): C-c a M TODO="TODO"+ALLTAGS={tag1\|tag2} 3. If you call this often, you can automate the search with a custom agenda command: (org-add-agenda-custom-command '("x" "TODO + tag1|tag2" tags-todo "TODO=\"TODO\"+ALLTAGS={tag1\\|tag2}")) Or you could use a block agenda: (org-add-agenda-custom-command '("x" "TODO + tag1|tag2" ((tags-todo "TODO=\"TODO\"+tag1") (tags-todo "TODO=\"TODO\"+tag2")))) See the following for more information: (info "(org) Matching tags and properties") http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html http://orgmode.org/worg/org-tutorials/advanced-searching.html Best, Matt