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/music-config.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/music-config.el')
| -rw-r--r-- | modules/music-config.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/modules/music-config.el b/modules/music-config.el index 394c9fa3..90feb7eb 100644 --- a/modules/music-config.el +++ b/modules/music-config.el @@ -352,10 +352,25 @@ Dirs added recursively." ;;; EMMS setup and keybindings +;; Music/EMMS keymap +(defvar-keymap cj/music-map + :doc "Keymap for music commands" + "m" #'cj/music-playlist-toggle + "M" #'cj/music-playlist-show + "a" #'cj/music-fuzzy-select-and-add + "r" #'cj/music-create-radio-station + "SPC" #'emms-pause + "s" #'emms-stop + "p" #'emms-playlist-mode-go + "x" #'emms-shuffle) + +(keymap-set cj/custom-keymap "m" cj/music-map) +(with-eval-after-load 'which-key + (which-key-add-key-based-replacements "C-; m" "music menu")) + (use-package emms :defer t :init - (defvar cj/music-map (make-sparse-keymap) "Keymap for music commands.") ;; Set buffer name BEFORE emms loads to prevent default buffer creation (setq emms-playlist-buffer-name "*EMMS-Playlist*") :commands (emms-mode-line-mode) @@ -407,9 +422,6 @@ Dirs added recursively." (advice-remove 'emms-playlist-clear #'cj/music--after-playlist-clear) (advice-add 'emms-playlist-clear :after #'cj/music--after-playlist-clear) - :bind-keymap - ("C-; m" . cj/music-map) - :bind (:map emms-playlist-mode-map ;; Playback @@ -432,16 +444,7 @@ Dirs added recursively." ("r" . cj/music-create-radio-station) ;; Volume (MPD) ("-" . emms-volume-lower) - ("=" . emms-volume-raise)) - (:map cj/music-map - ("m" . cj/music-playlist-toggle) - ("M" . cj/music-playlist-show) - ("a" . cj/music-fuzzy-select-and-add) - ("r" . cj/music-create-radio-station) - ("SPC" . emms-pause) - ("s" . emms-stop) - ("p" . emms-playlist-mode-go) - ("x" . emms-shuffle))) + ("=" . emms-volume-raise))) ;; Quick toggle key - use autoload to avoid loading emms at startup (autoload 'cj/music-playlist-toggle "music-config" "Toggle EMMS playlist window." t) |
