@subsection Finding the keymap and its entry to use After translation of the input events (@pxref{Translating Input}) Emacs looks in the active keymaps. As soon as a match is found (@pxref{Key Lookup}) and the keymap entry is a function the search is over. However if the keymap entry is a variable symbol or a string then Emacs replaces the input key sequences with the variable symbol value or the string and restarts searching in the active keymaps. Here is a pseudo-Lisp description of the order in which the active keymaps are searched: @lisp (or (if overriding-terminal-local-map (@var{find-in} overriding-terminal-local-map) (if overriding-local-map (@var{find-in} overriding-local-map) (or (@var{find-in} (get-text-property (point) 'keymap)) (@var{find-in-any} emulation-mode-map-alists) (@var{find-in-any} minor-mode-overriding-map-alist) (@var{find-in-any} minor-mode-map-alist) (@var{find-in} (get-text-property (point) 'local-map)) (@var{find-in} (current-local-map))))) (@var{find-in} (current-global-map))) @end lisp @noindent The @var{find-in} and @var{find-in-any} are pseudo functions that searches in one keymap respectively an alist of keymaps. @noindent @strong{Remark 1:} The finally found function may be remapped (@pxref{Remapping Commands}). @noindent @strong{Remark 2:} Characters that are bound to @code{self-insert-command} are translated according to @code{translation-table-for-input} before insertion. @noindent @strong{Remark 3:} @code{current-active-maps} returns a list of the currently active keymaps at (point).