From fcd38174500f9a18ee34ed8179a0e75c2892c8f5 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 8 Oct 2022 12:39:31 +0800 Subject: [PATCH] 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 Link: https://orgmode.org/list/87v91vle4u.fsf@gmail.com --- lisp/org.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index f8f86918c..e4b9f3cec 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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)))