I decided to add custom agenda keywords (I'm still setting up the environment, don't have any agenda files yet) and I used this example code from some tutorial:
(setq org-todo-keywords (quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)") (sequence "WAITING(w)" "HOLD(h)" "|" "CANCELLED(c)" "PHONE" "MEETING"))))
I added this code at the end of my init file.
The expected behavior is after adding this code to my init file I can
M-x org-agenda, then
t and see all my custom keywords available for selection:
Global list of TODO items of type: ALL Press ‘N r’ (e.g. ‘0 r’) to search again: (0)[ALL] (1)TODO (2)NEXT (3)DONE (4)WAITING (5)HOLD (6)CANCELLED (7)PHONE (8)MEETING
But I don't, at least not without some ugly hack I don't understand (see below).
When I start Emacs and run
M-x org-agenda and select the 't' option I don't have those added keywords available for selection, I get an empty sequence of keywords:
Global list of TODO items of type: ALL Press ‘N r’ (e.g. ‘0 r’) to search again: (0)[ALL]
However, if I instead did
M-x org-agenda with the
a option (for no apparent reason) and then did
M-x org-agenda with the
t option, I would properly see all the keywords. So in other words, I have to select
agenda for current week or day" first and only if I do that I get to see my keywords if I do
list of all TODO entries". Obviously this is very inconvenient to do.
Edit: (temporary workaround)
Now I've arrived at a simpler workaround by accident - even though I've seen an empty sequence of keywords, what I did was try to filter by
0 r), which doesn't make a lot of sense since it's the default filtering mode, but it brought up my keywords on the screen for some reason. This isn't too convenient but works. So the keywords are there, just don't show up immediately. To verify this I restarted Emacs and before running
M-x org-agenda I checked the contents of
C-h v, it shows the correct contents but they are only displayed when I do this dummy
0 r filtering, which I believe is a bug. So I consider the problem temporarily resolved (though with a slightly inconvenient workaround) but I will keep the question open for some time in case it's not a bug and I'm doing something wrong and someone can point it out.
Two other problems I had with org-todo-keywords
Now for completeness I include two similar weird behaviors with
org-todo-keywords both of which magically resolved themselves so I'm not looking for help about them, I just write them here in case it is of any value.
It used to be the case that even though my (setq org-todo-keywords ... ) code was in my init file (at the end), it wouldn't work unless I manually selected it and run
If I updated my sequence of
org-todo-keywords, I wouldn't get the updated keywords list to work no matter what - it would still show the old list, as if it was cached. Nothing would help - running '
eval-region' on the new code, restarting Emacs, etc.