Subject: Re: bug#1806: dired-pop-to-buffer in wrong place

From: martin rudalics <[email-masked]>
Date: Wed, 07 Jan 2009 21:00:19 +0100

> As I can see currently `fit-window-to-buffer' always takes space
 > from the bottom window, but we need it from the top window.

Not really.  `fit-window-to-buffer' uses `enlarge-window' which is our
idea of Robin Hood - stealing from the large, giving to the small.

An impractical solution is to make all other windows fixed-height and do
the fit.  This will almost certainly fail since deleting the window may
give its space to _any_ of its siblings.

A more practical solution would be to implement something like the
following: When a new window is created, remember the OLD _and_ the NEW
window configuration in the window's parameters.  When the window is
eventually deleted and the actual configuration "sufficiently" resembles
the NEW configuration, restore the OLD configuration.

martin