Skip to content

Instantly share code, notes, and snippets.

@lawlist lawlist/example.el
Last active Sep 4, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.