<div dir="ltr">Thank you Frank, works like a charm, `evil-escape` does not depend on `key-chord` anymore.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">-syl20bnr-</div></div>
<br><div class="gmail_quote">On Sat, Jan 17, 2015 at 3:24 PM, Frank Fischer <span dir="ltr"><<a href="mailto:frank-fischer@shadow-soft.de" target="_blank">frank-fischer@shadow-soft.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 17.01.2015 um 07:04 schrieb Sylvain Benner:<br>
<span class="">> Hi,<br>
><br>
> I'm trying to call interactively from the code the function<br>
> `evil-find-char` while in visual state like this:<br>
><br>
> (call-interactively 'evil-find-char)<br>
><br>
> A simplistic use case will be the following simple wrapper function mapped<br>
> on `f` key:<br>
><br>
> (defun my-wrapper () (interactive) (call-interactively 'evil-find-char))<br>
><br>
> The observed behavior is that when I press on `f` the point is put of the<br>
> next character with no selection, then when I press a second key then the<br>
> selection does not include the second character (like if I pressed `t` in<br>
> regular Vim).<br>
<br>
</span>The problem is that Evil considers `my-wrapper` as regular Emacs<br>
command. When called in visual state Evil adjusts point and mark so that<br>
the region corresponds to the visual selection right before the command<br>
is executed (and because Emacs region exclusive, point is moved to the<br>
next character).<br>
<br>
You could try to register `my-wrapper` as a regular Evil motion, i.e.<br>
<br>
(evil-define-motion my-wrapper (count)<br>
(call-interactively 'evil-find-char))<br>
<br>
should work.<br>
<br>
Frank<br>
<br>
<br>
_______________________________________________<br>
implementations-list mailing list<br>
<a href="mailto:implementations-list@lists.ourproject.org">implementations-list@lists.ourproject.org</a><br>
<a href="https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list" target="_blank">https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list</a><br>
</blockquote></div><br></div>