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*
.)
Asked
Active
Viewed 161 times
2
-
1The 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 Feb 02 '23 at 15:03
-
@NickD You are right. Thanks for the clarification :) – dmw64 Feb 03 '23 at 05:25
1 Answers
3
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 inwindow.el
.
(minibuffer-window-active-p WINDOW)
Return t if
WINDOW
is the currently active minibuffer window.

Drew
- 77,472
- 10
- 114
- 243