If I goto correct a word with flyspell-correct-at-point, a word suggestion box will appear, as expected. Unfortunately I cannot close this suggestion box with escape I have to use C-g.

Any ideas on how to fix this behaviour ?

  • It took me about a year to get used to the notion that escape does not behave the same in Emacs as with most other applications. There is nothing to fix, because it is not broken. It is possible to program/customize Emacs so that escape behaves as C-g in this particular circumstance, but I'll leave that to another forum participant to write-up. – lawlist Mar 24 '18 at 5:43
  • 2
    For those forum participants who are wondering where the function flyspell-correct-at-point comes from, it is possible that the original poster has installed a library known as flyspell-correct (which does not ship with Emacs): github.com/d12frosted/flyspell-correct – lawlist Mar 24 '18 at 16:22
  • @lawlist as emacs user who came from vim and who uses evil it is kind of hard to use C-g instaed of escape, I've tried mapping ESC ESC to keyboard quit but it doesnt seem to work as expected – sp00kyb00g13 Mar 26 '18 at 4:09

First I'd like to discourage you from changing bindings of meta keys. I found that setting different key bindings messes up my M-x functionallity (for example). You will get funny behviours on all platforms. I am on Linux Manjaro, but I saw comments from Windows and Mac users getting similar issues on other posts in SO here and for others works perfectly, like here I assume it has to do with specific emacs version and system specifications.

The possiblilities:


(global-set-key (kbd "<escape>")      'keyboard-escape-quit)

This is binding escape to the keyboard-escape-quit which is one of the three functions that the C-g complies.


This is the second:

(global-set-key (kbd "<escape>")      'keyboard-quit)


And the third be : M-x top-level , that is also a form of a quit (quiting this level to go to the one above)


Another option is:

(define-key key-translation-map (kbd "ESC") (kbd "C-g"))

for me it translated some functionality but not quitting a completion menu.


In most cases C-g can be replaced with esc esc esc (three escapes bound to keyboard-escape-quit) or M-esc esc Get used to C-g it is emacs for quit.

  • Hmm, I am not a big fan of the C-g binding and I have somehow managed to avoid using it up till now. For some reason when the flyspell suggestion box appears it seems that many keybinds are ignored. Example, I am unable to do C-h m or anything else in this mode. I can use escape to exit similar suggestion buffers (autocomplete etc) so I'm not sure what is different with flyspell. – sp00kyb00g13 Mar 26 '18 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.