summaryrefslogtreecommitdiff
path: root/modules/custom-whitespace.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
commit746cefd4d674bfc6dd9fdfe4aeb79c7e760ec268 (patch)
tree8bb53c9300298028390dec51f8cc46ada5689b2e /modules/custom-whitespace.el
parentd69f41af1f6e0d1bea8a2942f5e99b6ef961c1ef (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-whitespace.el')
-rw-r--r--modules/custom-whitespace.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/custom-whitespace.el b/modules/custom-whitespace.el
index 2f6b7435..a69d6138 100644
--- a/modules/custom-whitespace.el
+++ b/modules/custom-whitespace.el
@@ -102,13 +102,16 @@ Operate on the active region designated by START and END."
;; Whitespace operations prefix and keymap
-(define-prefix-command 'cj/whitespace-map nil
- "Keymap for whitespace operations.")
-(keymap-set cj/custom-keymap "w" #'cj/whitespace-map)
-(keymap-set cj/whitespace-map "r" #'cj/remove-leading-trailing-whitespace)
-(keymap-set cj/whitespace-map "c" #'cj/collapse-whitespace-line-or-region)
-(keymap-set cj/whitespace-map "l" #'cj/delete-blank-lines-region-or-buffer)
-(keymap-set cj/whitespace-map "-" #'cj/hyphenate-whitespace-in-region)
+(defvar-keymap cj/whitespace-map
+ :doc "Keymap for whitespace operations"
+ "r" #'cj/remove-leading-trailing-whitespace
+ "c" #'cj/collapse-whitespace-line-or-region
+ "l" #'cj/delete-blank-lines-region-or-buffer
+ "-" #'cj/hyphenate-whitespace-in-region)
+
+(keymap-set cj/custom-keymap "w" cj/whitespace-map)
+(with-eval-after-load 'which-key
+ (which-key-add-key-based-replacements "C-; w" "whitespace menu"))
(provide 'custom-whitespace)
;;; custom-whitespace.el ends here.