Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to separate minibuffer and echo area in Emacs?

I'm curious, whether it is possible to separate echo area and minibuffer, so two different places (lines, panes, frames) are used for output of messages and input of commands.

As it is said in Hide Emacs echo area during inactivity , it is impossible to get rid of echo area completely, but some proposals are:

  • move minibuffer to a dedicated window;
  • filter messages in echo area - for example, print only keystrokes in echo area and use *Messages* buffer for other messages.

What options do i have? Is it possible in theory to separate echo area and minibuffer? Would it theoretically require rewriting C source code and recompiling Emacs? Please post any thoughts and ideas.

like image 583
Mirzhan Irkegulov Avatar asked Apr 08 '12 14:04

Mirzhan Irkegulov


People also ask

What is the echo area in Emacs?

The echo area is the line at the bottom of the Emacs screen, below the mode line of the bottom window. The program uses it to echo keystrokes, report errors, and display various prompts and messages. There is always just one echo area in an Emacs screen.

What is Emacs minibuffer?

The minibuffer is where Emacs commands read complicated arguments, such as file names, buffer names, Emacs command names, or Lisp expressions. We call it the “minibuffer” because it's a special-purpose buffer with a small amount of screen space.


1 Answers

Based on the manual and a look at the C code, I believe the answer is "no".

M-: (info "(elisp) Echo Area Customization") RET says:

The variable `max-mini-window-height', which specifies the maximum height for resizing minibuffer windows, also applies to the echo area (which is really a special use of the minibuffer window; *note Minibuffer Misc::).

The Minibuffer Misc link doesn't discuss that specific point further, but if the echo area explicitly uses the minibuffer window then you'll not be able to separate them.

Edit:

For confirmation, if you look at the source for the C function message3_nolog() in xdisp.c, it obtains the frame for the selected frame's minibuffer, selects that, and then passes through to echo_area_display() which uses the currently-selected frame's minibuffer window as the echo area window.

(Emacs 24.0.95)

So the "mini window" used for the minibuffer and echo area is indeed one and the same, just as the manual states.

The only possibility I can think of is to try to find a way of automatically copying echo area messages to some other window, but as this is all happening in C code, in functions not exposed to elisp, I suspect that's not possible either.

Edit 2:

Would it theoretically require rewriting C source code and recompiling Emacs?

If you need genuine separation, then yes, I believe that is the case.

If the copying approach was sufficient, you might be able to manage that purely in elisp by advising all of the functions which can result in messages being written to the echo area. You could start reading here to see what that might entail:

M-: (info "(elisp) The Echo Area") RET

(but if you are really desperate to implement this, I would suggest your time would be better spent working in C and providing a patch which would allow such a separation to be made, because I'm a little doubtful all that advice would be robust in the long term.)

like image 121
phils Avatar answered Nov 15 '22 09:11

phils