lang/org: preserve TODO keyword on C-RET

Rather than reverting to first TODO keyword.
This commit is contained in:
Henrik Lissner 2019-11-11 14:49:34 -05:00
parent f70f788df3
commit 7879a93081
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -95,9 +95,12 @@
(org-back-to-heading)
(insert (make-string level ?*) " ")
(save-excursion (insert "\n"))))
(when-let (todo-keyword (org-element-property :todo-keyword context))
(org-todo (or (car (+org-get-todo-keywords-for todo-keyword))
'todo)))))
(when-let* ((todo-keyword (org-element-property :todo-keyword context))
(todo-type (org-element-property :todo-type context)))
(org-todo (cond ((eq todo-type 'done)
(car (+org-get-todo-keywords-for todo-keyword)))
(todo-keyword)
('todo))))))
((user-error "Not a valid list, heading or table")))