Issue #93 invalid

Esc-: would call Eval

Anonymous created an issue

Esc-: should normally send you to ex mode, but when quickly press this combination, it will go into Emacs Eval.

I know this could be not an issue for casual user, but hardcore vi users get used to quick combos and I (for example) quite often get into Eval. Any chance this could be somehow improved?


Comments (5)

  1. Frank Fischer repo owner
    • changed status to open

    This is another issue with M-x sequences. In terminals those key sequences are sent as two characters, in this example ESC followed by an "x". Pressing "M-x" generates those two charaters with almost no delay, but there is in general no way to distinguish the ESC generated by "M-x" from a usual ESC generated by pressing the Escape-key. The only possible way (I'm aware of) is to wait for a short time for another character. This is what evil does, after ESC it waits a short time period for another character.

    This delay can be specified by the customizable variable evil-esc-delay. Setting this to a reasonable small value should make this delay unrecognizable.

    But this is only half of the story. In X both situations are distinguishable because the plain ESC key generates a different event 'escape (a symbol, not a character). Thus in X the problem you describe should not arise. Furthermore, the default value of this variable is indeed very small, namely 0.01 (seconds), so you must be really quick.

    Buuut ... this is still not the end. If you use Emacs in a terminal and use some kind of terminal multiplexer like "screen" or "tmux", then there is nothing evil can do. Those multiplexers suffer from the same ambiguity as Emacs in the terminal, not being able to distinguish plain ESC and M-<key>. Thus those multiplexers generate some delay on their own (which may be quite large). If you are in that situation you have to reconfigure you terminal multiplexer to reduce the delay.

    Anyway, in order to help you we need to know which evil and Emacs version you use and if you run your Emacs in X or in terminal and if you use a terminal multiplexer.

  2. Anonymous

    I'm using emacs 23.3.1 in terminal. Maybe this is similar to issue I had before, related to differences between terminal implementations (I'm using mrxvt).

    Is it possible to somehow disable Esc-: emacs see it as Eval, but use M-: as normally? (I know Esc and M are almost the same in emacs).

  3. Frank Fischer repo owner

    No, not in terminal. As I tried to explain, M- and ESC are indistinguishable because they generate exactly the same key-code (event). In X it's a different story, here both keys are distinguishable because they generate different codes. Do you use a terminal multiplexer like tmux or screen? Is the same delay noticeable in Vim? What's the value of `evil-esc-delay' in your Emacs?

  4. Anonymous

    Ahhh sorry, don't know how I skipped part where you mentioned Esc M relation (too much of caffeine) :S

    Yes, I'm using screen (still figuring out how I manage to forget to mention this) and, a after re-reading your explanation, things have more sense now. I found similar problems others had with screen on

    So, after some playing, setting maptimeout 100 in /home/<user>/.screenrc would solve the problem (at least for now).

  5. Log in to comment