My guess, from your description ("the minibuffer is not active") and your replies to other answers, is that it is not the minibuffer that needs clearing - it is the echo area.
This is the same physical space, but the echo area is for output (e.g. message
), whereas the minibuffer is primarily for input.
To clear the echo area, use (message nil)
, as suggested. Or use the minibuffer, followed by C-g
- e.g., M-x C-g
. That usually takes care of the job (but see below, about killing the echo-area buffer, if you really need to clear it).
If it really is the minibuffer input that you want to clear, then:
C-g
(repeated, if necessary) quits the minibuffer.
- You can use any text-clearing keys to clear the input without exiting. E.g.,
C-x DEL
will clear quite a bit (it is backward-kill-sentence
). I bind M-k
(normally kill-sentence
) to a command that deletes all of the minibuffer input (this is the case in Icicles, for instance). Command delete-minibuffer-contents
wipes it all out.
(You can also kill the echo-area buffer, if it should ever get polluted with some text you want to get rid of. The buffer will be re-created automatically. With vanilla Emacs it is a bit problematic to do this interactively, but you can at least do it using M-: (kill-buffer " *Echo Area 0*")
(note the SPC
char prefix).)