emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Custom agenda view by TODO state and tag
@ 2011-04-26  3:42 Laurynas Biveinis
  2011-04-26 11:46 ` Bernt Hansen
  2011-04-26 12:04 ` Matt Lundin
  0 siblings, 2 replies; 5+ messages in thread
From: Laurynas Biveinis @ 2011-04-26  3:42 UTC (permalink / raw)
  To: emacs-orgmode

Hi everybody -

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.

Any pointers?
Thanks,
-- 
Laurynas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Custom agenda view by TODO state and tag
  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
  1 sibling, 2 replies; 5+ messages in thread
From: Bernt Hansen @ 2011-04-26 11:46 UTC (permalink / raw)
  To: Laurynas Biveinis; +Cc: emacs-orgmode

Laurynas Biveinis <laurynas.biveinis@gmail.com> writes:

> Hi everybody -
>
> 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.
>
> Any pointers?

Hi Laurynas,

Just use a tags-todo filter and list both.

("n" "Next and Started tasks" tags-todo "-WAITING-CANCELLED/!NEXT|STARTED"
               ((org-agenda-overriding-header "Next Tasks")))

This looks for all todo tasks that do not have a WAITING or CANCELLED
tag and have a todo keyword matching NEXT or STARTED.

You probably want something like this

C-c a M tag1|tag2/!TODO

("x" "Todo tasks for tag1 or tag2" tags-todo "tag1|tag2/!TODO")
               ((org-agenda-overriding-header "Todo tasks for tag1 or tag2")))

HTH,
Bernt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Custom agenda view by TODO state and tag
  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:04 ` Matt Lundin
  1 sibling, 0 replies; 5+ messages in thread
From: Matt Lundin @ 2011-04-26 12:04 UTC (permalink / raw)
  To: Laurynas Biveinis; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Custom agenda view by TODO state and tag
  2011-04-26 11:46 ` Bernt Hansen
@ 2011-04-26 12:14   ` Laurynas Biveinis
  2011-04-26 12:14   ` Matt Lundin
  1 sibling, 0 replies; 5+ messages in thread
From: Laurynas Biveinis @ 2011-04-26 12:14 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Matt Lundin, emacs-orgmode

Bernt, Matt -

2011/4/26 Bernt Hansen <bernt@norang.ca>:
> Just use a tags-todo filter and list both.
>
> ("n" "Next and Started tasks" tags-todo "-WAITING-CANCELLED/!NEXT|STARTED"
>               ((org-agenda-overriding-header "Next Tasks")))

Thanks! Apparently all I had to do is to add "/!TODO" to my custom
search view filters. (This is to implement GTD next action lists, I
use TODO for next actions and WAITING for the to-do items which I
cannot do right now)

Now I have found it in the manual too, missed it on the first two readings.

-- 
Laurynas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Custom agenda view by TODO state and tag
  2011-04-26 11:46 ` Bernt Hansen
  2011-04-26 12:14   ` Laurynas Biveinis
@ 2011-04-26 12:14   ` Matt Lundin
  1 sibling, 0 replies; 5+ messages in thread
From: Matt Lundin @ 2011-04-26 12:14 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Laurynas Biveinis, emacs-orgmode

Bernt Hansen <bernt@norang.ca> writes:

> You probably want something like this
>
> C-c a M tag1|tag2/!TODO
>
> ("x" "Todo tasks for tag1 or tag2" tags-todo "tag1|tag2/!TODO")
>                ((org-agenda-overriding-header "Todo tasks for tag1 or tag2")))

Thanks, Bernt! Forgot about this one.

There is more than one way to do things in org-mode. :)

Best,
Matt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-26 12:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).