From b2d44d70374db0ab801d18f8c04d1b021396ea46 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 3 May 2026 21:34:05 -0500 Subject: refactor: drop dead intermediate C-s binding in selection-framework `selection-framework.el` had two `keymap-global-set "C-s"` calls at module load. The first bound `C-s` to `consult-line`, then a later block rebound the same key to `cj/consult-line-or-repeat`. The second binding always won, so the first was dead configuration and made the file harder to reason about. I removed the intermediate `consult-line` binding. The final `cj/consult-line-or-repeat` binding stays. Behavior is unchanged. I added `tests/test-selection-framework-keybindings.el` with one smoke test: load the module with `use-package`, `consult-line`, and `vertico-repeat` stubbed, then assert `C-s` resolves to `cj/consult-line-or-repeat`. That locks in the cleanup so a future re-add of the dead binding would fail the test. --- tests/test-selection-framework-keybindings.el | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/test-selection-framework-keybindings.el (limited to 'tests/test-selection-framework-keybindings.el') diff --git a/tests/test-selection-framework-keybindings.el b/tests/test-selection-framework-keybindings.el new file mode 100644 index 00000000..8fb8b3df --- /dev/null +++ b/tests/test-selection-framework-keybindings.el @@ -0,0 +1,30 @@ +;;; test-selection-framework-keybindings.el --- Tests for selection framework keys -*- lexical-binding: t; -*- + +;;; Commentary: +;; Smoke coverage for the final search binding owned by selection-framework.el. + +;;; Code: + +(require 'ert) + +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) + +(defmacro use-package (&rest _args) + "Ignore package configuration while loading selection-framework in tests." + nil) + +(defun consult-line (&rest _args) + "Test stub for `consult-line'.") + +(defun vertico-repeat (&rest _args) + "Test stub for `vertico-repeat'.") + +(require 'selection-framework) + +(ert-deftest test-selection-framework-c-s-runs-consult-line-or-repeat () + "C-s should resolve to the final consult-line-or-repeat command." + (should (eq (key-binding (kbd "C-s")) + #'cj/consult-line-or-repeat))) + +(provide 'test-selection-framework-keybindings) +;;; test-selection-framework-keybindings.el ends here -- cgit v1.2.3