orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

Support multiple todo keyword sequence definitions

Open happy-dude opened this issue 2 years ago • 4 comments

Does this feature exist in Emacs orgmode core?

Yes

Orgmode link

https://orgmode.org/guide/Multi_002dstate-Workflow.html

Feature value

From the manual:

Sometimes you may want to use different sets of TODO keywords in parallel. For example, you may want to have the basic ‘TODO=/=DONE’, but also a workflow for bug fixing. Your setup would then look like this:

(setq org-todo-keywords
      '((sequence "TODO(t)" "|" "DONE(d)")
        (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")))

In my specific case, I have different sequences defined for

  • GTD
  • Blockers
  • Agile
  • Shopping

Additional context

Example of how I defined my sequences in emacs:

(setq org-todo-keywords
      '(
        (sequence "TODO" "PROCESS" "ORGANIZE" "REVIEW" "DO" "|" "DONE")                 ; GTD
        (sequence "IDEA" "DESIGN" "DEVELOP" "QA" "BACKLOG" "|" "COMPLETE")              ; Agile
        (sequence "|" "NOTDOING" "DELEGATED" "WAITING" "SOMEDAY")                       ; Blockers
        (sequence "WISHLIST" "CART" "SHIPPING" "ATTN" "|" "DONE" "RETURNED")            ; Shopping
        ))

Example of how I expected to define it in nvim-orgmode:

  org_todo_keywords = {
        {'TODO', 'PROCESS', 'ORGANIZE', 'REVIEW', 'DO', '|', 'DONE'},               -- GTD
        {'IDEA', 'DESIGN', 'DEVELOP', 'QA', 'BACKLOG', '|', 'COMPLETE'},            -- Agile
        {'|', 'NOTDOING', 'DELEGATED', 'WAITING', 'SOMEDAY'},                       -- Blockers
        {'WISHLIST', 'CART', 'SHIPPING', 'ATTN', '|', 'DONE', 'RETURNED'}           -- Shopping
      },

happy-dude avatar Apr 09 '22 00:04 happy-dude

If I were to attempt to implement this and submit a PR, what would the recommended workflow be or where would I reference in the code? Should I make conscious effort to re-implement the same algorithm/style as the mainline org-mode repo?

happy-dude avatar Apr 13 '22 14:04 happy-dude

#135 may be related to this

jgollenz avatar Apr 15 '22 09:04 jgollenz

@Happy-Dude I don't think you will manage to follow the same algorithm, because I didn't follow it at all when creating this. I think we should just update the parser to figure out all todo and all done states with this data, and the todo state switcher to properly suggest options. I don't know what emacs does when there is a same todo keyword in 2 sequences, so that should be tested before implementing.

kristijanhusak avatar Apr 15 '22 10:04 kristijanhusak

To add another piece to the functionality. Orgmode in emacs allows for TODO sequences created at the top of a file as well. (not sure if that applies to each todo with properties), but definitely supports custom sequences per file (even multiple per file)

Mentioned in more detail here https://github.com/nvim-orgmode/orgmode/issues/185

aareman avatar Jul 12 '22 18:07 aareman