evil-collection icon indicating copy to clipboard operation
evil-collection copied to clipboard

evil-define-minor-mode-key not working in certain cases

Open julian-hoch opened this issue 1 year ago • 0 comments

Hi, I am trying to set up some keybindings for the minor mode 'vtable-header-mode' (used by activities.el when using activites-list), and I am facing the issue that I cannot seem to get the 'k' key to work.

This is what I am trying:

    (evil-define-minor-mode-key 'normal 'vtable-header-mode
      (kbd "h") 'vtable-previous-column
      (kbd "l") 'vtable-next-column
      (kbd "j") 'evil-next-line
      (kbd "k") 'evil-previous-line)

Everything works except for the 'k' key - this is still bound as follows:

k runs the command #[257 "\300!\207" [#<subr F616e6f6e796d6f75732d6c616d626461anonymouslambda16>] 3 "

(fn OBJECT)" (byte-code "\300 C\207" [vtable-current-object] 1)]

I suspect activities.el does something non-standard, and this is why I cannot rebind it?

Oh and a related question - I managed to screw up my emacs state by first trying: evil-define-minor-mode-key 'normal 'vtable-header-mode-map This lead to my keybindings being bound globally I think, and I could not use the 'h' and 'l' keys anymore at all! I had to restart emacs to get back to a working state, since I could not figure out a way to undo that. I think the default behaviour should be to not bind a key if the mode map is invalid, what do you think? And, is there is a way to restore the previous (default) keybindings after a mistake like this?

julian-hoch avatar Sep 01 '24 10:09 julian-hoch