Browse Source

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
Ihor Radchenko 2 years ago
parent
commit
fcd3817450
1 changed files with 9 additions and 1 deletions
  1. 9 1
      lisp/org.el

+ 9 - 1
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)))