8
votes

Is it possible to filter agenda in emacs based on Owner property?

Currently I use tags to set owner of TODO items. This way I can filter agenda by tags like this:

(setq org-agenda-custom-commands
  `(("o" "tasks for oleg"
     ((org-agenda-list)
      (org-agenda-filter-apply ,(list "+oleg")))
     ((org-agenda-remove-tags t)))
    ("k" "tasks for karl"
     ((org-agenda-list)
      (org-agenda-filter-apply ,(list "+karl")))
     ((org-agenda-remove-tags t)))
    ))

It's not convenient to use tags to mark the owner but I see no other way to filter TODO items by Owner.

1
Are you storing the owner in a PROPERTIES block? - seth
yes,:PROPERTIES: :Owner: oleg :END: - Oleg Pavliv
I think this code is obsolete and doesn't work anymore. I get complaints about a wrong number of arguments (also I don't know what the comma means, but that's just me). Could you update it, maybe ? (Please :) - Nikana Reklawyks
@Nikana Reklawyks Yes, you are right, the code is obsolete. Unfortunately I don't use it since long time and I can't make it work. I tried a couple of corrections but it's still not running. Sorry. - Oleg Pavliv

1 Answers

5
votes

This worked for me in my .emacs:

(setq org-agenda-custom-commands
   (quote (("s" "tasks for Seth" tags "+OWNER=\"seth\"" nil))))

My properties are upper-case though so you'd need to use +Owner= methinks.

You could also invoke your own custom search by doing:

C-c a m +Owner="foobar"

(assuming you have C-c a bound to org-agenda.

I'm running org-mode 6.27a. For what it's worth, I wasn't quite sure how to do this at first but the worg page about custom commands was very helpful.