Re: Cancel minibuffer when clicking another window

Michael Albinus <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Joost Kremers <[email protected]> writes:

> Hi list,

Hi Joost,

> When Emacs reads input in the minibuffer (i.e., with `read-from-minibuffer`
> or `completing-read`, etc.) and you click some other window with the mouse,
> that window is selected, but the minibuffer input isn't cancelled.

I regard this as a feature. Sometimes, I need more information before
typing in the minibuffer. This is a convenient way to retrieve that information.

> Is there a way to automatically cancel the minibuffer input when clicking
> another window?

We might add this if it isn't possible yet. But pls, no automatical
cancel. It must be configured by a user, whether this shall happen.

> I've been trying with `mouse-leave-buffer-hook` and by adding advice before
> `mouse-set-point`, with various functions (`keyboard-quit`,
> `minibuffer-keyboard-quit`, `abort-minibuffers`, `abort-recursive-edit`),
> but either nothing happens, or I get an error "not in a minibuffer"...

Usually, I click in the minibuffer, and type C-g. This is almost
sufficient for my workflow.

> TIA

Best regards, Michael.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.