Thanks very much for you kind advice, Frank.<br><br>Seems that ecb has good integration with native emacs keybindings, just like buffer-menu, ediff,dired. Well, I still feel that using ecb with evil is terrible, and I don&#39;t use ecb now; it&#39;s a pity, but I have no choice:-(<br>
<br>Many thanks,<br><br>Hongxu Chen<br><br><div class="gmail_quote">On Sat, Mar 16, 2013 at 4:24 AM, 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">On 2013-03-02, Hongxu Chen &lt;<a href="mailto:leftcopy.chx@gmail.com">leftcopy.chx@gmail.com</a>&gt; wrote:<br>
&gt; --===============1925688492==<br>
<div class="im">&gt; Hi all,<br>
&gt;<br>
&gt; � � I am new to Emacs(and evil-mode). Currently I have difficulties in<br>
</div>&gt; using evil-mode when *ecb mode* is activated. The problem is that the *Enter<br>
&gt; *key is no longer available in any windows of ecb, so I cannot switch from<br>
<div class="im">&gt; the navigation window to the source code window at the right side. I also<br>
&gt; tried `(evil-set-initial-state &#39;ecb-minor-mode &#39;emacs)`, this time I can<br>
</div>&gt; use the default key-bindings in ecb(and so is the *Enter *key). What annoys<br>
<div class="im">&gt; me is that when I switch to the source code, evil-mode key-bindings are<br>
&gt; deactivated. And even I now toggle ecb-minor-mode off, the key-bindings are<br>
&gt; still not available. So I have to `M-x evil-mode` �twice to use the right<br>
&gt; evil-mode.<br>
<br>
</div>I do not know ecb in detail, but ecb-minor-mode seems to be active in<br>
each buffer when ecb is active. Hence, using &#39;ecb-minor-mode to modify<br>
Evil states is a bad idea, because it will influence every buffer.<br>
<br>
Unfortunately ecb buffer windows do not have a specific major mode.<br>
However, there are several hooks. I suggest you try the following<br>
hooks (but note that you must not enable/disable evil mode while ecb is<br>
active because these hooks are only called when the ecb buffers are<br>
created, and you must install these hooks *before* ecb is activated):<br>
<br>
� (add-hook &#39;ecb-history-buffer-after-create-hook &#39;evil-emacs-state)<br>
� (add-hook &#39;ecb-directories-buffer-after-create-hook &#39;evil-emacs-state)<br>
� (add-hook &#39;ecb-methods-buffer-after-create-hook &#39;evil-emacs-state)<br>
� (add-hook &#39;ecb-sources-buffer-after-create-hook &#39;evil-emacs-state)<br>
<br>
Alternatively if only the *Enter* key annoys you, you can disable<br>
evil&#39;s special binding of RET:<br>
<br>
� (define-key evil-motion-state-map (kbd &quot;RET&quot;) nil)<br>
<br>
I have the feeling that this function needs a rewrite anyway. Yes, it<br>
simulates Vim&#39;s behaviour of the Enter key, but it often makes trouble<br>
if Enter is bound to something special in some modes. I think, it is<br>
not really useful in most motion state buffers, so maybe you should<br>
just bind it in normal state only:<br>
<br>
� (define-key evil-normal-state-map (kbd &quot;RET&quot;) &#39;evil-ret)<br>
<br>
If you remove the RET key from motion-state, then you should be able<br>
to use motion-state in ecb windows, which gives you a few bindings<br>
like h j k l:<br>
<br>
� (add-hook &#39;ecb-history-buffer-after-create-hook &#39;evil-motion-state)<br>
� (add-hook &#39;ecb-directories-buffer-after-create-hook &#39;evil-motion-state)<br>
� (add-hook &#39;ecb-methods-buffer-after-create-hook &#39;evil-motion-state)<br>
� (add-hook &#39;ecb-sources-buffer-after-create-hook &#39;evil-motion-state)<br>
<br>
Hope this helps,<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>