<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">&lt;<a href="mailto:frank-fischer@shadow-soft.de" target="_blank">frank-fischer@shadow-soft.de</a>&gt;</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="">&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m trying to call interactively from the code the function<br>
&gt; `evil-find-char` while in visual state like this:<br>
&gt;<br>
&gt;     (call-interactively &#39;evil-find-char)<br>
&gt;<br>
&gt; A simplistic use case will be the following simple wrapper function mapped<br>
&gt; on `f` key:<br>
&gt;<br>
&gt;    (defun my-wrapper () (interactive) (call-interactively &#39;evil-find-char))<br>
&gt;<br>
&gt; The observed behavior is that when I press on `f` the point is put of the<br>
&gt; next character with no selection, then when I press a second key then the<br>
&gt; selection does not include the second character (like if I pressed `t` in<br>
&gt; 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 &#39;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>