Skip to content

Instantly share code, notes, and snippets.

@lawlist
Last active September 4, 2019 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lawlist/6b1a17fd9e1ebff274ea54c3310f4a1d to your computer and use it in GitHub Desktop.
Save lawlist/6b1a17fd9e1ebff274ea54c3310f4a1d to your computer and use it in GitHub Desktop.
Variation of org-todo with minibuffer prompt of choices.
(defun my-basic-org-todo ()
"Doc-string ...."
(interactive)
(let* ((choice (read-char-exclusive "[t] TODO | [n] NEXT | [w] WAITING"))
(chosen-string (cond
((eq choice ?t)
"TODO")
((eq choice ?n)
"NEXT")
((eq choice ?w)
"WAITING")
(t
(user-error "Try again ...")))))
(org-todo chosen-string)))
(defun my-fancy-org-todo ()
"Doc-string ...."
(interactive)
(let* ((todo-string (propertize "TODO" 'face (org-get-todo-face "TODO")))
(next-string (propertize "NEXT" 'face (org-get-todo-face "NEXT")))
(waiting-string (propertize "WAITING" 'face (org-get-todo-face "WAITING")))
(choice (read-char-exclusive (concat "[t] "
todo-string
" | [n] "
next-string
" | [w] "
waiting-string)))
(chosen-string (cond
((eq choice ?t)
"TODO")
((eq choice ?n)
"NEXT")
((eq choice ?w)
"WAITING")
(t
(user-error "Try again ...")))))
(org-todo chosen-string)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment