emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* complex filters in agenda view
@ 2010-06-26 13:44 Matt Price
  2010-06-26 16:04 ` Bernt Hansen
  2010-06-26 16:06 ` Nick Dokos
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Price @ 2010-06-26 13:44 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 319 bytes --]

yet another question as i continue to set things up.

how would I create a custom agenda view that accomplishes this:
(todo items marked "ACTION" OR "WAITING" AND tagged "email")?
I don't think I see how to do this in the manual (
http://orgmode.org/org.html#Custom-agenda-views).

am i missing it?  Thanks again,
matt

[-- Attachment #1.2: Type: text/html, Size: 445 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: complex filters in agenda view
  2010-06-26 13:44 complex filters in agenda view Matt Price
@ 2010-06-26 16:04 ` Bernt Hansen
  2010-06-26 16:06 ` Nick Dokos
  1 sibling, 0 replies; 3+ messages in thread
From: Bernt Hansen @ 2010-06-26 16:04 UTC (permalink / raw)
  To: Matt Price; +Cc: emacs-orgmode

Matt Price <moptop99@gmail.com> writes:

> yet another question as i continue to set things up.
>
> how would I create a custom agenda view that accomplishes this:
> (todo items marked "ACTION" OR "WAITING" AND tagged "email")? 

Hi Matt,

Use a tags match (or a tags todo match if both of those todo items are
not done states)

C-c a m email/ACTION|WAITING RET

or

C-c a m email/!ACTION|WAITING RET

Tags todo matches with /! or C-c a M returns results faster if you don't
need to match any DONE states.

-Bernt

> I don't think I see how to do this in the manual (http://orgmode.org/org.html#Custom-agenda-views).
>
> am i missing it?  Thanks again,
> matt

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

* Re: complex filters in agenda view
  2010-06-26 13:44 complex filters in agenda view Matt Price
  2010-06-26 16:04 ` Bernt Hansen
@ 2010-06-26 16:06 ` Nick Dokos
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2010-06-26 16:06 UTC (permalink / raw)
  To: Matt Price; +Cc: nicholas.dokos, emacs-orgmode

Matt Price <moptop99@gmail.com> wrote:

> yet another question as i continue to set things up.
> 
> how would I create a custom agenda view that accomplishes this:
> (todo items marked "ACTION" OR "WAITING" AND tagged "email")? 
> I don't think I see how to do this in the manual (http://orgmode.org/org.html#Custom-agenda-views).
> 
> am i missing it?  Thanks again,

Need you ask? :-) I have always thought that just as we are about to
think of something that org-mode cannot do, either we are wrong and it
is already there, or Carsten (and now et. al.) is checking in the
required change.


A bit more seriously, there was a post by Bernt Hansen recently on
exactly this question:

  http://thread.gmane.org/gmane.emacs.orgmode/26319/focus=26329

and the relevant documentation is section 10.3.3, "Matching tags and
properties", in the Org manual (particularly the last paragraph or two
in the section.)

Based on these, and on the documentation of org-agenda-custom-commands,
I came up with the following:

(setq org-agenda-custom-commands
      '(("x" "matt-price-special" tags-todo "email/!+ACTION|+WAITING")))

BTW, the ! skips DONE items and speeds up the search.

Of course, you would have to splice in the new setting to your settings
of org-agenda-custom-commands, but I assume that is clear.

That answers the question (I think), but I wanted to talk a bit more
about testing things like this: there is an old idea in emacs lisp
programming of a minimal .emacs file, where you strip everything off and
leave only what's relevant for testing. Then you fire up a bare emacs
that avoids all other complications and concentrates on *these*
complications:

     emacs -Q -l ~/minimal.emacs

Here is the minimal .emacs that I use for org (shamelessly stolen from
Bernt Hansen - you'll have to modify the paths for your setup), as modified
for your question:

,----
| ;;; constant part
| (add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/lisp"))
| (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
| (require 'org-install)
| (global-set-key "\C-cl" 'org-store-link)
| (global-set-key "\C-ca" 'org-agenda)
| 
| ;;; variable part
| (setq org-agenda-custom-commands
|       '(("x" "matt-price-special" tags-todo "email/!+ACTION|+WAITING")))
| 
| (setq org-agenda-files '("~/src/org/filters/matt-price.org"))
`----

and here's the file that I used for testing the custom agenda command:

,----
| #+TODO: TODO ACTION WAITING | DONE
| 
| 
| * TODO foo                                    :email:
|
| * ACTION bar
| 
| * WAITING baz
| 
| * ACTION foobar                               :email:
| 
| * DONE foobaz
| 
| * WAITING barbaz                              :email:
`----

I could then apply the custom command with C-c a x and I got the following:

,----
| Headlines with TAGS match: email/!+ACTION|+WAITING
| Press `C-u r' to search again with new search string
|   matt-price: ACTION foobar                                              :email:
|   matt-price: WAITING barbaz                                             :email:
`----

What I hope to do with these ramblings is to gently encourage you (and
everybody else) to provide these two things whenever you submit a
question:

       o Here is what I have in my org file.

       o Here is what I would like to see.

       o Here is what I tried.

It was fairly easy to come up with them this time, but that is not
always the case, so since you have already spent some time setting it
up, show us what you have done: you are likely to get an answer much
more quickly and it is more likely to be a correct answer that way.

Cheers,
Nick

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

end of thread, other threads:[~2010-06-26 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-26 13:44 complex filters in agenda view Matt Price
2010-06-26 16:04 ` Bernt Hansen
2010-06-26 16:06 ` Nick Dokos

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