-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binding a key in lisp-mode-map with evil-define-key can bind it in emacs-lisp-mode-map #709
Comments
Is there any opposition to this? If not, this is a very simple change, and I'd be happy to make a pull request if it would be accepted. It's really annoying to, for example, bind a key in |
No objection here. I recall a more recent ticket about the same issue where I asked for clarification, if I find it again I'd close it in favor of this one. |
If the parent keymap already has an auxiliary keymap, ignore it. For example, if the user attempted to bind a key in emacs-lisp-mode-map before this commit, evil-define-key* could define the key in the corresponding auxiliary keymap in lisp-shared-mode-map instead of creating a new auxiliary keymap in emacs-lisp-mode-map. This resulted in keys bound in emacs-lisp-mode-map with evil-define-key potentially being bound in other keymaps that inherit from lisp-shared-mode-map (e.g. lisp-mode-map). Addresses emacs-evil#709.
If the parent keymap already has an auxiliary keymap, ignore it. For example, if the user attempted to bind a key in emacs-lisp-mode-map before this commit, evil-define-key* could define the key in the corresponding auxiliary keymap in lisp-shared-mode-map instead of creating a new auxiliary keymap in emacs-lisp-mode-map. This resulted in keys bound in emacs-lisp-mode-map with evil-define-key potentially being bound in other keymaps that inherit from lisp-shared-mode-map (e.g. lisp-mode-map). Addresses emacs-evil#709.
This can be closed now. |
OK. |
Originally reported by: Anonymous
Because the
evil-get-auxiliary-map
used inevil-define-key*
doesn't setignore-parent
to a non-nil value, usingevil-define-key
withlisp-mode-map
can actually end up binding the keys inlisp-mode-shared-map
. This results in key bindings specified forlisp-mode-map
ending up inemacs-lisp-mode-map
.This behavior doesn't seem very intuitive to me. Are there a lot of cases where having
ignore-parent
as nil here makes more sense? If not, I think it would be better to set it tot
inevil-define-key*
. Otherwise, it could potentially be nice to add a disclaimer in the docstring that the parent keymap could end up being used.The text was updated successfully, but these errors were encountered: