8

I just installed Emacs 25.1 for windows. I want to modify the TODO keyword list, and I use this code:

 (setq org-todo-keywords
  '((sequence "TODO"
      "MAYBE"
      "NEXT"
      "STARTED"
      "WAITING"
      "DELEGATED"
      "|"
      "DONE"
      "DEFERRED"
      "CANCELLED")))

However, the TODO items keep cycling between the standard keywords. Strangely enough, if I check the variable 'org-todo-keywords from within the customization buffer, I do see all the keywords I've defined.

Any hints on why the do not appear when cycling?

  • Have you reverted (/re-opened) the buffer since setting org-todo-keywords? – ebpa Feb 10 '17 at 16:39
  • I have put the code above directly in the buffer I'm visiting and evaluated the region M-: eval-region. – Mike Anblips Feb 10 '17 at 16:46
  • 2
    Try saving and re-opening the file. – ebpa Feb 10 '17 at 16:51
  • Yes - that worked! – Mike Anblips Feb 10 '17 at 16:53
7

Org-mode caches various things on load. In this case org-todo relies on todo keyword state cached in org-todo-kwd-alist which is generated by org-set-regexps-and-options which is run when setting the mode to org-mode for the buffer.

If some org-mode customization doesn't seem to be taking effect it's usually a good idea to refresh things by reloading the buffer. Either by saving, closing, and re-opening the file or reverting the file by C-x C-v [return] (find-alternate-file).

I would personally consider this a bug. When emacs gets watchpoints (in v26.1 hopefully) minor caching issues like this should be easily addressed.

11

As others have mentioned, org-mode caches things like the todo keywords when it starts. You can close and reopen the files, but org-mode provides a function org-mode-restart you can use. If some setting doesn't seem to be taking effect, try M-x org-mode-restart.

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.