My org-mode TODO keywords are set as follows:
(setq org-todo-keywords '((sequence "NITPICKING(!)" "NITS_SENT(!)" "NITS_DONE(!)" "PROOFS_SENT(!)" "PROOFS_RECEIVED(!)" "ACS_RECEIVED(!)" "ACS_ASSIGNED(!)" "ACS_DONE(!)" "|" "READY(!)")))
I have a headline that starts in the
NITPICKING state. Here is what happens:
- I press
C-c C-tto call
org-todo. State changes from
NITS_SENT, as it should, but syntax highlighting gets lost for that headline.
- I press
C-c C-tagain, it puts me back in the
NITPICKINGstate, with correct highlighting.
- I press
C-c C-tagain, it puts me in the
NITS_SENTstate, now with correct highlighting.
- Further calls to
So it's just the first transition that's getting screwed up. Here is what the timestamps look like:
- State "NITS_SENT" from "NITPICKING" [2016-05-23 Mon 13:27] - State "NITPICKING" from "" [2016-05-23 Mon 13:26] - State "NITS_SENT" from "NITPICKING" [2016-05-23 Mon 13:25]
It works properly if I use buffer-local keywords instead of defining
org-todo-keywords in my init file. But this is the global setup that I need, and I'd prefer to do it the way I've done it.
Is there something wrong with my code? Why would only get messed up for a single state?
Edit (in response to @nispio):
This behavior occurs even when I start emacs with
emacs -q and then manually evaluate the
setq command above.
After some further experimentation, it also seems that the same behavior occurs regardless of the starting state. So, for instance, if I open a
.org file with a headline in the
ACS_RECEIVED state and execute
org-todo, it puts me in the next (
ACS_ASSIGNED) state, but without syntax highlighting; the next execution of
org-todo puts me in the initial (
NITPICKING) state, with proper syntax highlighting, and it works correctly from there.
Further edit: the problem is that the headlines were empty apart from the TODO state. I wanted the headline to be empty to make my agenda view cleaner, since the name of the org file together with the TODO state is all the info I need at a glance. But it seems that having an empty headline means that the TODO state is interpreted as the title, which is why the first call to
org-todo sets me in the initial state.
So, I would like to refine my question to the following: is there any way to have headlines that are empty apart from the TODO state?