Programmatically call evil-find-char

Sylvain Benner sylvain.benner at gmail.com
Tue Jan 20 04:11:14 CET 2015


Thank you Frank, works like a charm, `evil-escape` does not depend on
`key-chord` anymore.

-syl20bnr-

On Sat, Jan 17, 2015 at 3:24 PM, Frank Fischer <frank-fischer at shadow-soft.de
> wrote:

> Am 17.01.2015 um 07:04 schrieb Sylvain Benner:
> > Hi,
> >
> > I'm trying to call interactively from the code the function
> > `evil-find-char` while in visual state like this:
> >
> >     (call-interactively 'evil-find-char)
> >
> > A simplistic use case will be the following simple wrapper function
> mapped
> > on `f` key:
> >
> >    (defun my-wrapper () (interactive) (call-interactively
> 'evil-find-char))
> >
> > The observed behavior is that when I press on `f` the point is put of the
> > next character with no selection, then when I press a second key then the
> > selection does not include the second character (like if I pressed `t` in
> > regular Vim).
>
> The problem is that Evil considers `my-wrapper` as regular Emacs
> command. When called in visual state Evil adjusts point and mark so that
> the region corresponds to the visual selection right before the command
> is executed (and because Emacs region exclusive, point is moved to the
> next character).
>
> You could try to register `my-wrapper` as a regular Evil motion, i.e.
>
>   (evil-define-motion my-wrapper (count)
>     (call-interactively 'evil-find-char))
>
> should work.
>
> Frank
>
>
> _______________________________________________
> implementations-list mailing list
> implementations-list at lists.ourproject.org
> https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ourproject.org/pipermail/implementations-list/attachments/20150119/c7451de7/attachment.htm 


More information about the implementations-list mailing list