org-toggle-heading: Use buffer-local keyword settings when possible

* lisp/org.el (org-toggle-heading): Prefer `car' of
`org-done-keywords' and `org-not-done-keywords' when converting
checkboxes to TODO-keywords.

Reported-by: autofrettage <autofrettage@protonmail.ch>
Link: https://orgmode.org/list/87v91vle4u.fsf@gmail.com
This commit is contained in:
Ihor Radchenko 2022-10-08 12:39:31 +08:00
parent 1966a7a8a8
commit fcd3817450
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 9 additions and 1 deletions

View File

@ -17755,7 +17755,15 @@ number of stars to add."
(org-list-to-lisp t)
(pcase (org-current-level)
(`nil 1)
(l (1+ (org-reduced-level l)))))
(l (1+ (org-reduced-level l))))
;; Keywords to replace checkboxes.
(list
;; [X]
:cbon (concat (or (car org-done-keywords) "DONE") " ")
;; [ ]
:cboff (concat (or (car org-not-done-keywords) "TODO") " ")
;; [-]
:cbtrans (concat (or (car org-not-done-keywords) "TODO") " ")))
"\n")))
(setq toggled t))
(forward-line)))