3

I often keep a "short" secondary window below my main window with an arrangement like so:

+---------+
|         |
|         |
|   top   |
|         |
|         |
|         |
+---------+
|         |
| bottom  |
|         |
+---------+

The bottom window typically contains, *compilation*, *grep*, *Shell*, *Help*, etc. I typically keep a 80%-20% top-bottom split, but I find myself having to maintain this manually. Whenever I open certain new mode types like Help they often grow the bottom window to a 50-50 split with top. Is there any way for me to preserve this arrangement even when invoking these alternative modes like Help or compilation?

1
  • 1
    You might want to look at golden-ratio mode from MELPA. It automatically expands the focused window to maintain the golden ratio. You can see it in action here
    – Vamsi
    Sep 27, 2014 at 3:01

2 Answers 2

1

The popwin package might be what you want. It's available on Melpa.

It doesn't persistently keep the *Help*, *Completion*, etc windows persistently open, but you can set the size and position where they can open. The best part is that those windows close automatically, recovering the precious screen area.

10
  • Personally, I like keeping them open until I'm "done" with them, and usually I just C-x 0 or C-x k the ones I no longer care about. However, this still doesn't address the issue of the modification of the window size when I go back to what I was doing before.
    – b4hand
    Sep 26, 2014 at 23:06
  • You can keep those temporary windows open until you press C-g. These temporary windows behave as "popup" windows in the sense that the original window sizes don't get modified. They would the same sizes before and after popups. I find this especially useful after package updates, opening key binding and function helps, etc Sep 26, 2014 at 23:14
  • Ok, I see. After looking more at popwin, it appears that I would get 3 divisions when a popup window occurs, and then I would go back to the 2 divisions with C-g. That's a little different than my normal usage which is just to maintain at most 2 divisions. The popup windows should still pop up in place of the bottom window. I think I will try out popwin to see if I like it, but having 3 windows will definitely be jarring to me at first.
    – b4hand
    Sep 26, 2014 at 23:19
  • How would you use popwin here? Sep 27, 2014 at 1:12
  • 1
    If you prefer to have at most 2 divisions, don't split the window in default mode of operation. When a Help, Completion, grep, etc window needs to open, you will get 2 windows. On pressing C-g in that window, that window will disappear and you will be back to the single window configuration. May be I misunderstood the question...? Sep 27, 2014 at 2:46
0

It's possible the answer from this question may be applicable:

https://emacs.stackexchange.com/a/338/317

I haven't yet tried it, and am unfamiliar with display-buffer-alist, but maybe this will lead someone to come up with an example solution that would be applicable.

2
  • 1
    Please don't post answers that are just links to somewhere else, even if that somewhere else is on the same site. What part of that answer is relevant? What if that answer was edited or deleted? Sep 27, 2014 at 1:12
  • display-buffer-alist is the only relevant piece of information from the answer. I'll update the answer when I can verify that it actually is applicable, but it sounds like it will accomplish the desired behavior.
    – b4hand
    Sep 27, 2014 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.