I am trying to add an agenda custom command that shows me a sparse tree of items contain either NEXT or TODO using occur-tree.

When I run M-x org-occur RET NEXT\|TODO manually, it works fine. However, when I try to add it as an agenda command as following

(setq org-agenda-custom-commands '(("n" occur-tree "NEXT\|TODO")))

it doesn't match anything. I tried several combinations such as "NEXT|TODO", "NEXT\\|TODO", "\(NEXT\|TODO\)" etc. and none of them worked.

  • The occur sparse tree works for the current file. Do you have the file in question open when you run this custom agenda? – gusbrs Mar 6 '19 at 13:32
  • Please describe "works fine" and "make it work". Just what is the behavior you see that you don't like, and what behavior are you looking for? – Drew Mar 6 '19 at 15:57
  • @gusbrs Yes, happening on the current file. – s0-0s Mar 6 '19 at 17:56
  • @Drew, I edited my question to clarify. – s0-0s Mar 6 '19 at 17:57

Your Answer

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

Browse other questions tagged or ask your own question.