Run emms setup hook later

This commit is contained in:
James Nguyen 2022-04-15 15:36:53 -04:00
parent 8d42153481
commit 6f99be20a3
2 changed files with 22 additions and 4 deletions

View File

@ -107,7 +107,8 @@ This will bind additional find-* type commands, e.g. usages, assignments, etc.."
:group 'evil-collection)
(defvar evil-collection--modes-with-delayed-setup
`(eshell)
`(emms
eshell)
"List of modes whose keybinds aren't completely set up after the mode is
loaded. This can be a problem for cases where we're doing key translations
using `evil-collection-setup-hook' which would result in an empty keymap.

View File

@ -39,6 +39,7 @@
(defconst evil-collection-emms-maps '(emms-browser-mode-map
emms-playlist-mode-map
emms-browser-search-mode-map
emms-metaplaylist-mode-map
emms-stream-mode-map))
@ -144,7 +145,12 @@ The return value is the yanked text."
"C" 'emms-browser-clear-playlist
"D" 'emms-browser-delete-files
"d" 'emms-browser-view-in-dired
"gd" 'emms-browser-view-in-dired)) ; "d" does the same, keep "gd" for consistency.
;; "d" does the same, keep "gd" for consistency.
"gd" 'emms-browser-view-in-dired)
(unless evil-collection-always-run-setup-hook-after-load
(run-hook-with-args 'evil-collection-setup-hook
'emms '(emms-browser-mode-map))))
;;;###autoload
(defun evil-collection-emms-playlist-setup ()
@ -205,7 +211,11 @@ The return value is the yanked text."
(evil-collection-define-key 'visual 'emms-playlist-mode-map
;; "d" 'emms-playlist-mode-kill
"D" 'emms-playlist-mode-kill))
"D" 'emms-playlist-mode-kill)
(unless evil-collection-always-run-setup-hook-after-load
(run-hook-with-args 'evil-collection-setup-hook
'emms '(emms-playlist-mode-map))))
;;;###autoload
(defun evil-collection-emms-setup ()
@ -243,7 +253,14 @@ The return value is the yanked text."
"i" 'emms-stream-info-bookmark
"s" 'emms-stream-save-bookmarks-file
"x" 'emms-stream-toggle-default-action
"q" 'emms-stream-quit))
"q" 'emms-stream-quit)
(unless evil-collection-always-run-setup-hook-after-load
(run-hook-with-args
'evil-collection-setup-hook 'emms
'(emms-browser-search-mode-map
emms-metaplaylist-mode-map
emms-stream-mode-map))))
(provide 'evil-collection-emms)
;;; evil-collection-emms.el ends here