diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-25 19:56:40 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-25 19:56:40 -0500 |
| commit | 746cefd4d674bfc6dd9fdfe4aeb79c7e760ec268 (patch) | |
| tree | 8bb53c9300298028390dec51f8cc46ada5689b2e /modules/custom-ordering.el | |
| parent | d69f41af1f6e0d1bea8a2942f5e99b6ef961c1ef (diff) | |
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.
Diffstat (limited to 'modules/custom-ordering.el')
| -rw-r--r-- | modules/custom-ordering.el | 17 |
1 files changed, 10 insertions, 7 deletions
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. |
