Closed jlee-made closed 6 years ago
Sorry for the late reply. Does this fix your problem?:
(add-to-list 'evil-snipe-disabled-modes 'Info-mode)
I beat you in slow response :-)
It didn't help, unfortunately. Are you able to reproduce? As I say, I could reproduce just by enabling evil and evil-snipe after starting with -q. Do you not see the problem if you try that?
I can easily reproduce it, and I understand why it happens (the evil-snipe-disabled-modes check in turn-on-evil-snipe-*mode
occurs before the major-mode is set), but I don't understand why the check happens so soon. I'm looking into it though.
Correction, turn-on-evil-snipe-*mode
don't seem to be called at all, skipping the evil-snipe-disabled-modes check entirely. Seems like I've misunderstood how define-globalized-minor-mode
works. Back to the drawing board!
Reopening: still not sure if it fixed the issue. Still looking into it.
The docstring for define-globalized-minor-mode
could really use improvement regarding the fact that the function (usually) automatically associates MODE
with MODE-map
(regardless of whether that map already exists)--even the docstring for define-minor-mode
(which the former function references) doesn't actually convey that.
Anyway, there are very likely better ways of fixing it than this (hence no PR), but, at the least, here's a proof-of-concept (that ought to not break anyone's existing configuration):
(defvar evil-snipe-mode-global-map
(let ((map (make-sparse-keymap)))
map))
(defvar evil-snipe-override-mode-global-map
(let ((map (make-sparse-keymap)))
map))
;;;###autoload
(define-globalized-minor-mode evil-snipe-mode
evil-snipe-local-mode turn-on-evil-snipe-mode
:keymap evil-snipe-mode-global-map)
;;;###autoload
(define-globalized-minor-mode evil-snipe-override-mode
evil-snipe-override-local-mode turn-on-evil-snipe-override-mode
:keymap evil-snipe-override-mode-global-map)
(provide 'evil-snipe)
;;; evil-snipe.el ends here
As of https://github.com/hlissner/evil-snipe/commit/3b333c2d85d8306505d0fac4ce99c038aae6533f this issue should be resolved (so long as you add Info-mode
to evil-snipe-disabled-modes
or attach turn-off-evil-snipe-mode
to Info-mode-hook
).
Feel free to reopen this if that isn't the case.
When I enable
evil-snipe
and thenC-h i
, I find that info's usuals
binding to search now starts evil-snipe instead. I want to keep the old binding in that mode.I'm not able to work around that using
Info-mode-hook
to callturn-off-evil-snipe-override-mode
and/orturn-off-evil-snipe-mode
either. However, using those functions interactively after entering info, I can use thes
binding again.Can you provide some way to keep that old binding?
I was able to reproduce this using emacs 25.1 and no configuration other than basically pointing emacs at where my elpa packages is on disk, then enabling
evil
andevil-snipe
.