aboutsummaryrefslogtreecommitdiff
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/test-org-babel-config.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test-org-babel-config.el b/tests/test-org-babel-config.el
index b62a9422..15eb44c4 100644
--- a/tests/test-org-babel-config.el
+++ b/tests/test-org-babel-config.el
@@ -3,11 +3,12 @@
;;; Commentary:
;; Covers cj/org-babel-toggle-confirm, which flips `org-confirm-babel-evaluate'
;; between t (the safe default — confirm before running a block) and nil, and
-;; the C-; k binding that invokes it.
+;; the C-; O b binding (on `cj/org-map') that invokes it.
;;; Code:
(require 'ert)
+(require 'org-config) ;; provides cj/org-map, where the toggle is bound
(require 'org-babel-config)
;; org defines this as a defcustom, but org is not loaded in batch; declare it
@@ -27,9 +28,14 @@
(should (eq t org-confirm-babel-evaluate))))
(ert-deftest test-org-babel-toggle-confirm-bound-to-key ()
- "Smoke: C-; k invokes the toggle command."
- (should (eq (keymap-lookup (current-global-map) "C-; k")
+ "Smoke: C-; O b (org menu) invokes the toggle command."
+ (should (eq (keymap-lookup cj/org-map "b")
#'cj/org-babel-toggle-confirm)))
+(ert-deftest test-org-babel-toggle-confirm-old-binding-freed ()
+ "Boundary: the old C-; k global binding is gone."
+ (should-not (eq (keymap-lookup (current-global-map) "C-; k")
+ #'cj/org-babel-toggle-confirm)))
+
(provide 'test-org-babel-config)
;;; test-org-babel-config.el ends here