aboutsummaryrefslogtreecommitdiff
path: root/modules/org-babel-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-01 22:13:50 -0400
committerCraig Jennings <c@cjennings.net>2026-07-01 22:13:50 -0400
commit6c8ee35aa8f1bddf264b880925270b33ff576a46 (patch)
tree2e2546710c44843a6ac824b65f2bc0c9ea5c7990 /modules/org-babel-config.el
parent110440b6b3632b9bf0a9e5cf0838c9891f61e17a (diff)
downloaddotemacs-6c8ee35aa8f1bddf264b880925270b33ff576a46.tar.gz
dotemacs-6c8ee35aa8f1bddf264b880925270b33ff576a46.zip
refactor(org-babel): move the babel-confirm toggle to the org menu
cj/org-babel-toggle-confirm landed on C-; k as a placeholder. It's an org-babel concern, so it now lives on the org menu as C-; O b, and C-; k is free again. The binding registers after org-config loads so a standalone load of this module still works.
Diffstat (limited to 'modules/org-babel-config.el')
-rw-r--r--modules/org-babel-config.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/org-babel-config.el b/modules/org-babel-config.el
index bc7ccb80..79661013 100644
--- a/modules/org-babel-config.el
+++ b/modules/org-babel-config.el
@@ -35,7 +35,7 @@
;; The block stays a src block (the cj: grep marker is unchanged); org markup
;; is highlighted and editable, though links are followed from the C-c ' buffer.
(add-to-list 'org-src-lang-modes '("cj:" . org))
- (setq org-confirm-babel-evaluate t) ;; confirm before running babel; toggle with C-; k
+ (setq org-confirm-babel-evaluate t) ;; confirm before running babel; toggle with C-; O b
(setq org-babel-default-header-args
(cons '(:tangle . "yes")
(assq-delete-all :tangle org-babel-default-header-args)))) ;; default header args for babel
@@ -54,7 +54,17 @@ session when working in trusted files, and back on when done."
(message "Babel evaluation confirmation %s"
(if org-confirm-babel-evaluate "ON" "OFF")))
-(keymap-global-set "C-; k" #'cj/org-babel-toggle-confirm)
+;; Bound on the org menu (C-; O) rather than the global C-; map — the toggle
+;; is an org-babel concern. cj/org-map is defined in org-config, which init
+;; loads before this module; the after-load guard keeps a standalone load of
+;; this module from erroring when org-config is absent.
+(defvar cj/org-map)
+(with-eval-after-load 'org-config
+ (keymap-set cj/org-map "b" #'cj/org-babel-toggle-confirm))
+
+(with-eval-after-load 'which-key
+ (which-key-add-key-based-replacements
+ "C-; O b" "toggle babel confirm"))
;; ---------------------------- Org Babel Languages ----------------------------