emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Laurynas Biveinis <laurynas.biveinis@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Custom agenda view by TODO state and tag
Date: Tue, 26 Apr 2011 08:04:45 -0400	[thread overview]
Message-ID: <874o5lw74y.fsf@fastmail.fm> (raw)
In-Reply-To: <BANLkTin4U1=TH+v0rxygFtj319BykrhOjw@mail.gmail.com> (Laurynas Biveinis's message of "Tue, 26 Apr 2011 06:42:47 +0300")

Laurynas Biveinis <laurynas.biveinis@gmail.com> 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

      parent reply	other threads:[~2011-04-26 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26  3:42 Custom agenda view by TODO state and tag Laurynas Biveinis
2011-04-26 11:46 ` Bernt Hansen
2011-04-26 12:14   ` Laurynas Biveinis
2011-04-26 12:14   ` Matt Lundin
2011-04-26 12:04 ` Matt Lundin [this message]

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=874o5lw74y.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=laurynas.biveinis@gmail.com \
    /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).