views:

99

answers:

2

I am not even sure this is a previous command or a non-finished command or whatever, but I do know I really don't like it.

My problem is that some commands (or messages, or whatever) get stuck in the mini-buffer so that when I type a new command it appears there really quickly, and then the mini-buffer is back to the stubborn command. Some commands seem to be chosen, and after using lots of commands something else gets stuck there, but there is always something being shown that I don't want to see. I tried typing C-g lots of times to see if it would quit, but that does not work.

This is a picture of what I have now:

alt text

It does not matter what I do, that bit

Label: hl-line

will not leave. It does leave momentarily when a new command is typed, but it goes back. I don't like it, it is confusing, and I would much rather see there the last used command.

I did check the customisation options for the mini-buffer (the bottom part of it can be seen in my picture), but I found nothing that seemed to be what I was looking for.

Any ideas?

+5  A: 

The mini-buffer has lost focus. Try C-x o (Control+x o) to regain focus. To cancel the command press C-g when you have focus in the mini-buffer.

Vijay Mathew
Oh, so it was like an unfinished command? I did the C-x o and had to finish all that stream of commands (to insert an environment in latex, put label, position, etc) so that the thing would disappear.Thanks for that!
Vivi
+4  A: 

Chances are you're getting into the situation because you started a command and used your mouse to select something in a different window. If that's the case, you can have Emacs automatically abort the command when you do such an action.

This is the code you'd add to your .emacs:

(defun stop-using-minibuffer ()
  "kill the minibuffer"
  (when (and (>= (recursion-depth) 1) (active-minibuffer-window))
    (abort-recursive-edit)))

(add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer)

Note: I grabbed this from my blog post on the topic.

And there is also a super user question that addresses this issue, and my answer there provides a command to jump back to the minibuffer.

Trey Jackson
Quite possible I did that... I am trying though not to use the mouse, so hopefully I this command will be redundant soon. Does this happen when I use ** C-x b ** as well? By the way, I prefer the code you put on the answer to a superuser question and linked in a comment to your blog post :) (the one which gives a key binding to go to the active minibuffer window)
Vivi
@Vivi Ahhh... right the SU answer. I am not so happy how SO and SU split the Emacs questions. I'll link that one as well in this answer.
Trey Jackson
This can happen if you start a command and get an error condition. The trick to get focus into the mini-buffer and then Ctrl-G to abort will fix it.
Michael Mathews