From 746cefd4d674bfc6dd9fdfe4aeb79c7e760ec268 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 25 Oct 2025 19:56:40 -0500 Subject: refactor:keymaps: Replace define-prefix-command with defvar-keymap Refactor the keymap definitions across multiple modules by replacing `define-prefix-command` with `defvar-keymap`. This simplifies the keymap setup and integrates better with the `which-key` package for enhanced documentation and usability. Updated modules include custom-ordering, custom-text-enclose, custom-whitespace, mail-config, music-config, org-drill-config, test-runner, and vc-config. --- modules/custom-text-enclose.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'modules/custom-text-enclose.el') diff --git a/modules/custom-text-enclose.el b/modules/custom-text-enclose.el index fa41d39f..514419cd 100644 --- a/modules/custom-text-enclose.el +++ b/modules/custom-text-enclose.el @@ -69,12 +69,15 @@ (forward-line 1))))) ;; Surround, append, prepend prefix keymap -(define-prefix-command 'cj/enclose-map nil - "Keymap for enclosing text: surrounding, appending, and prepending.") -(keymap-set cj/custom-keymap "s" #'cj/enclose-map) -(keymap-set cj/enclose-map "s" #'cj/surround-word-or-region) -(keymap-set cj/enclose-map "a" #'cj/append-to-lines-in-region-or-buffer) -(keymap-set cj/enclose-map "p" #'cj/prepend-to-lines-in-region-or-buffer) +(defvar-keymap cj/enclose-map + :doc "Keymap for enclosing text: surrounding, appending, and prepending" + "s" #'cj/surround-word-or-region + "a" #'cj/append-to-lines-in-region-or-buffer + "p" #'cj/prepend-to-lines-in-region-or-buffer) + +(keymap-set cj/custom-keymap "s" cj/enclose-map) +(with-eval-after-load 'which-key + (which-key-add-key-based-replacements "C-; s" "text enclose menu")) (provide 'custom-text-enclose) ;;; custom-text-enclose.el ends here. -- cgit v1.2.3