Skip to content

evil-collection-translate-key doesn't seem to work with evil-define-minor-mode-key #498

@gagbo

Description

@gagbo

Hello,

(This may be related to #433 but really not sure)

Ever since this evil-snipe commit it seems that

(evil-collection-translate-key '(normal motion) '(evil-snipe-local-mode-map evil-snipe-override-local-mode-map)
  "s" "k"
  "S" "K"
  "K" "S"
  "k" "s")

doesn't work as intended : after this call is executed, I expect s to move the cursor up (evil-previous-line, I use an alternate keyboard layout), but instead it calls evil-snipe-s still. It used to work before this commit

Worse, when I try to C-h k s, I see evil-snipe-s, but no associated binding is showing (I use helpful.el, and the "Key bindings" section is empty
image

(Instead, I expected evil-previous-line, which is mapped to evil-motion-state-map s)

Digging a little bit, I noticed 2 things :

So maybe evil-collection--translate-key needs to be modified to also be able to lookup in that particular map ? I don't really know if it's going to be the solution (nor how to do that properly).

I don't know if the get-minor-mode-keymap and get-auxiliary keymap functions of evil are actually fetching the same keymap or not; and I don't know how those keymaps affect the key resolution logic of Emacs, so sorry if this shot in the dark is totally wrong (and I'd be happy to learn a little bit more; seeing "No binding" in helpful.el after a C-h k is a troubling experience)

Thanks for creating that function in the first place though, it's really a time saver

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions