Input-method during isearch
Gordon Gustafson
gordon3.14 at gmail.com
Sun Mar 1 21:29:15 CET 2015
Ideally you should search with evil's /, which already uses the
current input method, rather than try to hack something together
yourself (you can always rebind it to C-s if you feel like that's what
you want). If you still want to build this yourself, look into the
macro evil-without-input-method-hooks, which is used in evil-search.el
to implement this behavior for evil's search. Long story short, evil
has hooks that prevent you from using an input method in normal state,
and evil-without-input-method-hooks is probably the best way to get
around them.
On 3/1/15, Nikolai Weibull <now at disu.se> wrote:
> Hi!
>
> I'm trying to get input-method to work during isearch. It works if,
> for example, isearch-forward-regexp is started in insert mode, as evil
> doesn't disable input-method then. However, when started in normal
> mode, it won't work, as evil disables input-method in that state.
> I've tried
>
> (defun now-evil--isearch-forward-regexp-around (fn &rest args)
> (let ((s evil-state))
> (if (or (not evil-local-mode) (evil-state-property s :input-method))
> (apply fn args)
> (evil-change-state 'insert)
> (unwind-protect
> (apply fn args)
> (evil-change-state s)))))
> (advice-add 'isearch-forward-regexp :around
> 'now-evil--isearch-forward-regexp-around)
>
> to get around this limitation, but it doesn't work. It seems that
> evil is entering normal state somewhere between here and when isearch
> is started.
>
> What am I doing wrong?
>
> Thanks!
>
> _______________________________________________
> implementations-list mailing list
> implementations-list at lists.ourproject.org
> https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
>
More information about the implementations-list
mailing list