tags:

views:

161

answers:

4

Hi!

When I start Emacs, its windows and its minibuffer start up floating on the main frame, leaving a lot of empty space (see: here and here). Any idea of what is going on and how to fix it?

I'm using emacs version 23.1.1 on Xmonad

Thanks!

+1  A: 

I get the same thing occasionally when doing a TAB expand in shell mode. I don't end up with an empty mini-buf, it usually has all the contents from the shell expand. The only solution I've found so far is to kill the current shell buffer

jottos
+1  A: 

You might try C-l (recenter-top-bottom). I've used this over the years as a pretty reliable "repaint" operation that will clear up various detritus that occurs on the frame. It is even more helpful when you do not have a window system.

pajato0
Thanks for the answer, but the command doesn't change a thing.
konr
Hmm. Part of the difficulty in giving you a good answer is that your scenario is hard to reproduce. I don't know if you can add any insight that would enable us to recreate your environment but it would be helpful. What I was able to do was to type "C-x (message ..." where the ... was a series of quoted newlines that grew the minibuffer area. While still in the minibuffer, I typed "C-x o" to get back to the main window. Sure enough "C-l" did nothing for me to. Then I typed "C-x o" to get back into the minibuffer and typed "C-g" which restored the screen. You might try this out.
pajato0
A: 

This partially works (taken from here):

 (defun fullscreen ()
    (interactive)
    (set-frame-parameter nil 'fullscreen
                         (if (frame-parameter nil 'fullscreen) nil 'fullboth)))

(add-hook 'emacs-startup-hook 'fullscreen)

The windows get corrected, although the mini-buffer is still larger than the usual.

konr
+1  A: 

It looks like an odd interaction between Emacs and your window manager. It's as if Emacs is configuring itself to have a certain number of lines and columns in its active window, but the frame the window manager has allocated it is larger.

Can you try running X without Xmonad (ie. just run startX) and then run Emacs? You won't get frame decorations, but you can still use xterm to start it and see what 'natural' size it gets allocated. With the same Emacs configuration, that would narrow it down to some issue with Xmonad.

It's not obvious from the screenshots, as one is definitely in GUI mode, but the other (green on black) looks like it is in text mode. If you force it to run in text mode (emacs -nw), does it take up the same size? Within the shell, do normal commands take up the entire size of the allocated window?

Are the shell variables COLUMNS or LINES set correctly? Do they match the window dimensions? Assuming you are running bash, is shopt checkwinsize turned on? Do regular commands such as ls wrap at the expected margins and scroll to use the entire window?

It is worth ensuring that text mode is being configured correctly before getting GUI mode to work. I have a hunch the way that Xmonad is managing its window sizing may be the culprit, if it is 'forcing' windows to tile in certain arrangements, and the correct X hints aren't being sent. But - that's all just supposition for now...

gavinb