1

I have several agenda commands set up, one of which gives me a block agenda, others give me specific searches.

Since many of my TODOs are hanging around inside of projects, where I only archive the project when the whole thing is done, my system always has a bunch of DONE items hanging around. So many of my searches result in screens that are 60-80% DONE items, with some TODOs scattered among them.

What I want to do, is to filter it out so I only see non-DONE items in these searches.

I've done web searches and read the manual and tutorials and used C-h, all in vain.

What I did manage to figure out is that the answer is probably in the settings field in org-agenda-custom-commands... but I seem to be unable to find documentation about that, that is good enough to help me figure it out.

Please will someone point me in the right direction here.

How do I make org-agenda-custom-commands show me only non-DONE items?

My current setup for that variable is as follows:

(setq org-agenda-custom-commands
  (quote
   (("d" "Daily Planning Agenda + Next Actions"
 ((agenda ""
      ((org-agenda-span
        (quote day))))
  (tags "URGENT" nil "mygtd.org")
  (todo "WAITING" nil)
  (todo "STARTED" nil)
  (todo "TODO" nil))
 nil)
("h" tags "@home")
("w" tags "@work" nil)
("o" tags "@onlinebanking" nil)
("e" tags "@errands" nil)
("f" . "Agendas with individuals and groups")
("fh" "H..." tags "AGENDA=\"H... W...\"" nil)
("fH" "H..." tags "AGENDA=\"H... B...\"" nil)
("fl" "L..." tags "AGENDA=\"L... M...\"" nil)
("fp" "P..." tags "AGENDA=\"P... S...\"" nil)
("fm" "M..." tags "AGENDA=\"M... M...\"" nil)
("fr" "R..." tags "AGENDA=\"R... B...\"" nil)
("fM" "M..." tags "AGENDA=\"M... P...\"" nil))))
  • Can you post your org-agenda-custom-commands value? – Tyler Dec 10 '19 at 14:41
  • Rather than org-agenda-custom-commands you might be better off if you read the info for org-stuck-projects. – m43cap Dec 10 '19 at 17:38
  • @Tyler done - see the original question – Johan Dec 10 '19 at 18:27
  • @m43cap no that doesn't help. The searches that bother me most, are the ones that turn up TODOs to discuss with a particular person. I talk to many of them every week, and quite often their agenda becomes littered with things that was done a long time ago – Johan Dec 10 '19 at 18:28
4

You asked:

How do I make org-agenda-custom-commands show me only non-DONE items?

You can add -TODO=\"DONE\" to the match string of your tag search. This is described in the seciton 11.3.3. Matching tags and properties of the Org manual. There is even an example there which contains the string -TODO​="DONE". So you can search for it there.

The following example demonstrates that match string. It is marked by the comment ;; match.

(add-to-list 'org-agenda-custom-commands
     '("x" ;; key
       "Testing tags for negating DONE" ;; desc
       tags ;; type
       "-TODO=\"DONE\"" ;; match
       nil ;; settings
       nil ;; no files
       ))
  • Thank you @Tobias! I have to confess, I wish there was a way to say that once, for the whole variable - now I have to add this string to each new entry I make in there. Well, I'm not complaining too loudly - this works! – Johan Dec 11 '19 at 3:47
  • That's nice @Tobias. – m43cap Dec 11 '19 at 8:05
1

Instead of using a tags type agenda, which shows all entries regardless of TODO state, use a tags-todo type which only shows non-closed TODO items. If you need a tags view so you can also see entries without a keyword, add -TODO="DONE" to your query.

For an agenda type view, the relevant variables are: org-agenda-skip-scheduled-if-done, org-agenda-skip-deadline-if-done, org-agenda-skip-timestamp-if-done. Setting these to t will had the corresponding entries from your agenda.

  • Thanks! Useful info in here. I use a PROPERTIES entry called AGENDA to store the name of the relevant person though, so (I think) I have to use a tags search to get the primary thing done ("show me only the things I need to talk to Alice about") – Johan Dec 11 '19 at 3:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.