From 629cce948c562361ddd6136d7cc49c5c981bb610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Antol=C3=ADn=20Camarena?= Date: Tue, 27 Dec 2022 13:21:04 -0600 Subject: [PATCH] Add action to toggle all checkboxes in a plain Org list --- embark-org.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/embark-org.el b/embark-org.el index 0f11ab9..dadc00c 100644 --- a/embark-org.el +++ b/embark-org.el @@ -396,12 +396,22 @@ bound to i." ("r" org-list-repair) ("s" org-sort-list) ("b" org-cycle-list-bullet) - ("t" org-list-make-subtree)) + ("t" org-list-make-subtree) + ("c" org-toggle-checkbox)) (add-to-list 'embark-repeat-actions 'org-cycle-list-bullet) (add-to-list 'embark-keymap-alist '(org-plain-list . embark-org-plain-list-map)) +(cl-defun embark-org--toggle-checkboxes + (&rest rest &key run type &allow-other-keys) + (apply (if (eq type 'org-plain-list) #'embark--mark-target run) + :type type + rest)) + +(cl-pushnew #'embark-org--toggle-checkboxes + (alist-get 'org-toggle-checkbox embark-around-action-hooks)) + ;;; "Encode" region using Org export in place (embark-define-keymap embark-org-export-in-place-map