Tahir Hassan
Tahir Hassan

Reputation: 5817

Org Mode and the `org-todo` function

I am trying to write a few keybindings.

M-x describe-function org-todo gives:

...

When called through ELisp, arg is also interpreted in the following way:
`none'             -> empty state
""(empty string)  -> switch to empty state
`done'             -> switch to DONE
`nextset'          -> switch to the next set of keywords
`previousset'      -> switch to the previous set of keywords
"WAITING"         -> switch to the specified keyword, but only if it
                     really is a member of `org-todo-keywords'.

However, I am trying to use the 'previousset symbol as:

(org-todo 'previousset)

which does not work. I know I am calling it validly because

(org-todo "TODO")

changes it to a TODO.

Where is previousset symbol defined? I can't find a definition anywhere.

ANSWER: I worked out that (org-todo 'left) does what I want. Note that the left symbol is not defined, so it sort of acts as a string instead of a variable, as CantrianBear describes.

Upvotes: 0

Views: 547

Answers (1)

CantrianBear
CantrianBear

Reputation: 1063

One of the comments to following question pretty much answers your question. previousset as well as nextset lead you to the next set of defined keywords. For that to work, org-todo-keywords needs to contain multiple keywords:

(setq org-todo-keywords '((sequence "TODO" "DONE") 
                          (sequence "TODO2" "DONE2")))

If you just want to cycle through your defined keywords in one sequence, simply type C-c C-t (org-todo).

Upvotes: 1

Related Questions