From ff9ae709ca93578d8a9e6a3a944c129e26450190 Mon Sep 17 00:00:00 2001 From: James Nguyen Date: Thu, 14 Apr 2022 10:15:50 -0400 Subject: [PATCH] Use evil-delay when translating minor mode keys --- evil-collection.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/evil-collection.el b/evil-collection.el index a13114c..c47ffb7 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -611,9 +611,18 @@ invocation." (not (null states))) (setq states (list states))) (dolist (mode-symbol modes) - (dolist (state states) - (evil-collection--translate-minor-mode-key - state mode-symbol translations destructive)))) + (let ((keymap-symbol (intern (format "%S-map" mode-symbol)))) + (dolist (state states) + (evil-delay `(and (boundp ',keymap-symbol) + (keymapp ,keymap-symbol)) + `(evil-collection--translate-minor-mode-key + ',state + ',mode-symbol + ',translations + ,destructive) + 'after-load-functions t nil + (symbol-name (cl-gensym (format "evil-collection-translate-key-in-%s" + keymap-symbol)))))))) (defun evil-collection--translate-minor-mode-key (state mode-symbol