lang/org: use correct todo keyword on M-RET
Previously, new TODO headers created with M-RET or M-S-RET (bound to +org/insert-item) would use the first TODO keyword in org-todo-keywords in the new header. This wouldn't necessarily match the previous header. e.g. * [ ] Item 1 * TODO | This fix ensures new headers will preserve the correct header, even if the previous one is in a DONE state. * [ ] Item 1 * [ ] |
This commit is contained in:
parent
9bb5b4ef72
commit
baa6f64025
1 changed files with 3 additions and 2 deletions
|
@ -203,8 +203,9 @@ wrong places)."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
(if (= level 1) (insert "\n")))))
|
(if (= level 1) (insert "\n")))))
|
||||||
(when (org-element-property :todo-type context)
|
(when-let* ((todo-keyword (org-element-property :todo-keyword context)))
|
||||||
(org-todo 'todo))))
|
(org-todo (or (get-text-property 0 'org-todo-head todo-keyword)
|
||||||
|
'todo)))))
|
||||||
|
|
||||||
(t (user-error "Not a valid list, heading or table")))
|
(t (user-error "Not a valid list, heading or table")))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue