Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to move the emacs minibuffer to the top of the screen?

Tags:

emacs

I've started coding on a 30 inch monitor and am wondering if it's possible to move the minibuffer to the top of the screen in emacs? google searches aren't showing up anything.

Cheers Nimai Etheridge

like image 538
nimms Avatar asked Jun 16 '10 00:06

nimms


3 Answers

Have a look at the documentation for the default-minibuffer-frame and initial-frame-alist vars. It sounds like you may be able to have a separate frame for your minibuffer (which you could position at the top of the screen), and then generate minibufferless frames which utilise it.

Note that in initial-frame-alist it states that "If the value calls for a frame without a minibuffer, and you have not created a minibuffer frame on your own, a minibuffer frame is created according to minibuffer-frame-alist", which sounds like exactly what would be needed.

There are ways of saving and restoring frame configurations, so if this worked you could probably recreate the layout automatically when emacs starts.

Edit:
Very basic example/proof-of-concept below for using this frame arrangement. The minibuffer frame can't be deleted until the frames utilising it have been deleted. You'll run into trouble when you do things like maximising the editor frame, of course, so there would certainly be some work to do to try to make this system work in a more seamless fashion.

(setq default-minibuffer-frame
      (make-frame
       '((name . "minibuffer")
         (width . 80)
         (height . 1)
         (minibuffer . only)
         (top . 0)
         (left . 0)
         )))
(setq new-frame
      (make-frame
       '((name . "editor")
         (width . 80)
         (height . 30)
         (minibuffer . nil)
         (top . 50)
         (left . 0)
         )))

Naturally, you can also combine this with scottfrazer's method of moving the modeline to the top.

This could possibly be handled in the window-setup-hook?

You should also look at the built-in frame.el and dframe.el libraries. Functions like dframe-reposition-frame may provide a convenient way of keeping the minibuffer frame 'attached' to the top of the active editing frame.

The variable minibuffer-auto-raise can also be configured to raise the minibuffer frame whenever the minibuffer is activated, which may mitigate the need to have it visible the rest of the time.

like image 119
phils Avatar answered Feb 02 '23 01:02

phils


I'm pretty sure you can't move the minibuffer itself, but you can sort-of-ish make the mode line be on top:

(setq-default header-line-format mode-line-format) ; Copy mode-line
(setq-default mode-line-format nil) ; Remove mode-line

This will override things like Info that use the header line, but it's probably as close as you'll get without hacking C source.

like image 25
scottfrazer Avatar answered Feb 02 '23 00:02

scottfrazer


Use a standalone minibuffer frame. This shows how:

http://www.emacswiki.org/emacs/Dedicated_Minibuffer_Frame

http://www.emacswiki.org/emacs/oneonone.el

Either look at that code to get an idea or just use it directly. You need only customize the minibuffer frame position settings:

  • 1on1-minibuffer-frame-left -- Position of left edge of minibuffer frame, in pixels.

  • 1on1-minibuffer-frame-top/bottom -- Position of top (or bottom) of minibuffer frame, in pixels.

like image 40
Drew Avatar answered Feb 02 '23 00:02

Drew