I am fairly new to emacs, and I'm having a problem with the minibuffer remaining active when I don't think it should be. I have the following mapping for 'other-window:
(global-set-key (kbd "M-s M-s") 'other-window)
I know that this will cycle through the minibuffer if it is active, and I like that behavior. The problem is that my minibuffer keeps getting stuck in the following state:
Next element matching (regexp):
It gets in there sometimes when I am not even trying to do a regex search or even a search at all. When I hit C-g to kill it, I get the Quit message, but the minibuffer stays active and goes right back to
Next element matching (regexp):
Also, when it is in this state, I cannot use M-s M-s to get to the next window in my frame. C-x o still seems to work though.
I also seem to be able to run other minibuffer commnands (such as file search) just fine, even when I'm stuck like this.
Is there a way that I can do one of the following:
- Kill the minibuffer when in that mode.
- Set my custom 'other-window
M-s M-sfunction to get out of the minibuffer and on to the next window?
Either solution would be fine, though the 1st might be better since getting the minibuffer stuck may have other unexpected consequences.
Just do this:
The problem is that
M-sis locally bound in the minibuffer (inminibuffer-local-must-match-mapand other minibuffer keymaps) tonext-matching-history-element, which gives you that prompt and lets you search the history.What you need to do is unbind
M-sin each of the minibuffer keymaps: i.e., bind it tonil. Some of those maps inherit from others;minibuffer-local-mapshould take care of it, but you might want to do the same thing forminibuffer-local-ns-map.M-x apropos-variable minibuffer maptells you about all of the maps.[You can use
C-h M-kto see the bindings of any keymap, e.g.,minibuffer-local-must-match-map-- it is available in libraryhelp-fns+.el.]