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

From: martin rudalics <[email-masked]>
Date: Thu, 27 Sep 2012 19:32:31 +0200

> Of course I know less than you.  I don't know what problems you
 > intended to fix with new options that you implemented.  Particularly
 > I didn't know that you intended to use `temp-buffer-resize-mode' in
 > buffers displayed without `display-buffer'.

This has no relation to the problem at hand.  It would have been an easy
fix for functions that currently don't use `with-output-to-temp-buffer'.

 > What I wanted to do
 > is just to help you to fix 2 regressions in Dired to be able to
 > close bug#1806.  One regression is related to the need to use
 > `fit-window-to-buffer'

I don't understand you.  When `temp-buffer-resize-mode' is enabled, I
try to do `fit-window-to-buffer'.

 > and `set-window-start' like in the previously
 > used `dired-pop-to-buffer'.

You never talked about `set-window-start' in the present context before.
`with-temp-buffer-window' goes to `point-min' in the buffer it displays
- is that not sufficient?

 > The second regression is that the value `t'
 > of `window-combination-limit' is ignored,

I don't understand again.  If `window-combination-limit' is t it remains
t and is obeyed.  If it's 'temp-buffer or 'temp-buffer-resize it changes
its value to t.

 > so `fit-window-to-buffer'
 > steals space from the window below.

`fit-window-to-buffer' steals space from the lower window if and only if
the upper window is not large enough.  Otherwise it steals only from the
upper window.  What do you expect me to do if the upper window is not
large enough?  I do not have a solution for this because at the time I
display the buffer I don't know how large the window is supposed to be.
I can (1) do the calculations of `fit-window-to-buffer' before trying to
split the window and (2) not split if the window won't fit and reuse the
lower window instead.  But such a change is too invasive for the moment
and wouldn't help anyway if the lower window is too small.  You simply
ask too much here :-(

 > I have no idea how to fix that.

I'm currently struggling with a solution based on your ideas but am not
yet sure whether I'll be able to come up with a fix in the next days.

martin