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-ordering.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'modules/custom-ordering.el') diff --git a/modules/custom-ordering.el b/modules/custom-ordering.el index 8e8a4da6..5d308604 100644 --- a/modules/custom-ordering.el +++ b/modules/custom-ordering.el @@ -84,13 +84,16 @@ Produce a comma-separated list as the result." ;; Ordering & sorting prefix and keymap -(define-prefix-command 'cj/ordering-map nil - "text ordering and sorting operations.") -(keymap-set cj/custom-keymap "o" #'cj/ordering-map) -(keymap-set cj/ordering-map "a" #'cj/arrayify) -(keymap-set cj/ordering-map "u" #'cj/unarrayify) -(keymap-set cj/ordering-map "A" #'cj/alphabetize-region) -(keymap-set cj/ordering-map "l" #'cj/comma-separated-text-to-lines) +(defvar-keymap cj/ordering-map + :doc "Keymap for text ordering and sorting operations" + "a" #'cj/arrayify + "u" #'cj/unarrayify + "A" #'cj/alphabetize-region + "l" #'cj/comma-separated-text-to-lines) + +(keymap-set cj/custom-keymap "o" cj/ordering-map) +(with-eval-after-load 'which-key + (which-key-add-key-based-replacements "C-; o" "ordering/sorting menu")) (provide 'custom-ordering) ;;; custom-ordering.el ends here. -- cgit v1.2.3