keyboard-escape-quit

keyboard-escape-quit is an interactive compiled Lisp function in `simple.el'.

It is bound to M-ESC ESC.

(keyboard-escape-quit)

Exit the current "mode" (in a generalized sense of the word).
This command can exit an interactive command such as `query-replace',
can clear out a prefix argument or a region,
can get out of the minibuffer or other recursive edit,
cancel the use of the current buffer (for special-purpose buffers),
or go back to just one window (by deleting all but the selected window).