In order to adjust the behavior of my custom keyboard shortcuts I'd like to determine whether or not the current input focus is within the minibuffer. (The buffer seems to be called something like *Minibuf-1*.)

  • 1
    The echo area is not the same thing as the minibuffer (which is what you really mean here): see The Echo Area in the Emacs Lisp Reference manual.
    – NickD
    Commented Feb 2, 2023 at 15:03
  • @NickD You are right. Thanks for the clarification :)
    – dmw64
    Commented Feb 3, 2023 at 5:25

1 Answer 1


You're looking to know whether the minibuffer window is selected, and so has the input focus. Use predicate minibuffer-window-active-p. C-h f says:

minibuffer-window-active-p is a compiled Lisp function in window.el.

(minibuffer-window-active-p WINDOW)

Return t if WINDOW is the currently active minibuffer window.

  • That is it! Great, thank you very much :-) !
    – dmw64
    Commented Feb 3, 2023 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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