evil-lookup-func settings in evil-mode
Hi, I am writing some c code with Emacs evil-mode and I find that now and then I need to lookup the man pages. It is easy enough when in Evil normal state, by pressing `K', which invokes `evil-lookup'. However the funcall is specified by `evil-lookup-func', so eventually the function called is Emacs function `woman' rather than `man'. The problem is that woman sucks for some formats of manpages, for instance, the table in the manpage of `man', and she also displays margin between words poorly. So I hope to set `evil-lookup-func' to `man'. But I CANNOT since the definition in man.el(.gz) tells me that `man' takes ONE argument. So I re-bind `K' for myself: (evil-global-set-key 'normal (kbd "K") 'man) Everything goes well until I find that in some modes, `Man-mode' for example, this keymap doesn't work; `K' in such case still mapped to `evil-lookup'. So what can I do to avoid calling WoMan by mistake? -- Regards, Hongxu Chen
Hongxu Chen <[email protected]> writes:
I am writing some c code with Emacs evil-mode and I find that now and then I need to lookup the man pages. It is easy enough when in Evil normal state, by pressing `K', which invokes `evil-lookup'. However the funcall is specified by `evil-lookup-func', so eventually the function called is Emacs function `woman' rather than `man'. The problem is that woman sucks for some formats of manpages, for instance, the table in the manpage of `man', and she also displays margin between words poorly. So I hope to set `evil-lookup-func' to `man'. But I CANNOT since the definition in man.el(.gz) tells me that `man' takes ONE argument. So I re-bind `K' for myself:
(evil-global-set-key 'normal (kbd "K") 'man)
The binding is in motion state map, not normal state map (the latter inherits the former), so try 'motion instead of 'normal. However, I'm not sure if `evil-lookup-func` is vastly useful. Probably it's better to remove this variable completely and let the user rebind "K" if (s)he prefers a different command. This should not be much more difficult. Best regards, Frank
On Mon, Jun 24 2013 (04:58), Hongxu Chen <[email protected]> wrote:
So what can I do to avoid calling WoMan by mistake?
For the nonce, redifine `evil-lookup': (setq evil-lookup-func #'man) (evil-define-motion evil-lookup () (call-interactively evil-lookup-func)) But I think this is how it should work by default (calling `evil-lookup-func' interactively). Michael
participants (3)
-
Frank Fischer -
Hongxu Chen -
Michael Markert