aboutsummaryrefslogtreecommitdiff
path: root/modules/custom-ordering.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-10-25 19:56:40 -0500
committerCraig Jennings <c@cjennings.net>2025-10-25 19:56:40 -0500
commitbfa9478d34ab8fbee938b029ba9b46fedc47a075 (patch)
treea14c07c7a57e7c988e5ff44e0602a981cc54b5dc /modules/custom-ordering.el
parentfe4723d335d9a8ba30a6939b53e32e2bff0197af (diff)
downloaddotemacs-bfa9478d34ab8fbee938b029ba9b46fedc47a075.tar.gz
dotemacs-bfa9478d34ab8fbee938b029ba9b46fedc47a075.zip
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.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/custom-ordering.el b/modules/custom-ordering.el
index 8e8a4da67..5d308604b 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.