diff options
| author | Justin Burkett <justin@burkett.cc> | 2019-08-16 11:20:22 -0400 |
|---|---|---|
| committer | James N <james@jojojames.com> | 2019-08-16 19:29:37 -0700 |
| commit | 31ba85817730dc87ea41c8fe8c17a1f674457e27 (patch) | |
| tree | 1ffd00ee8a8ee70aa6312250d3cc3a468c5a8535 | |
| parent | d226a50061a5033846ae819472e3c86fb54cc5f1 (diff) | |
Catch errors in evil-collection-define-key
Like errors related to prefix keys already being defined
| -rw-r--r-- | evil-collection.el | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/evil-collection.el b/evil-collection.el index 4e6e197..1347160 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -305,8 +305,12 @@ function adds the ability to filter keys on the basis of (setq filtered-bindings (nreverse filtered-bindings)) (cond ((null filtered-bindings)) ((and (boundp map-sym) (keymapp (symbol-value map-sym))) - (apply #'evil-define-key* - state (symbol-value map-sym) filtered-bindings)) + (condition-case-unless-debug err + (apply #'evil-define-key* + state (symbol-value map-sym) filtered-bindings) + (error + (message "evil-collection: error setting key in %s %S" + map-sym err)))) ((boundp map-sym) (user-error "evil-collection: %s is not a keymap" map-sym)) (t @@ -315,8 +319,15 @@ function adds the ability to filter keys on the basis of (fset fun `(lambda (&rest args) (when (and (boundp ',map-sym) (keymapp ,map-sym)) (remove-hook 'after-load-functions #',fun) - (apply #'evil-define-key* - ',state ,map-sym ',filtered-bindings)))) + (condition-case-unless-debug err + (apply #'evil-define-key* + ',state ,map-sym ',filtered-bindings) + (error + (message + ,(format + "evil-collection: error setting key in %s %%S" + map-sym) + err)))))) (add-hook 'after-load-functions fun t)))))) (defun evil-collection-inhibit-insert-state (map-sym) |
