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

From: Juri Linkov <[email-masked]>
Date: Mon, 24 Sep 2012 11:22:12 +0300

> You have to enable `temp-buffer-resize-mode'.

I tried to enable `temp-buffer-resize-mode', and with a large list of files
it seems to ignore `window-combination-limit', i.e. the temporary window
steals space from the window below.  A sample test case is:
`M-x temp-buffer-resize-mode', in a Dired window `C-x 3 C-x 2 m m m ...'
(mark 100 files), `!' (`dired-do-shell-command') steals space from the
window below, and `C-g' doesn't restore the initial window configuration.

Is this because `window-combination-limit' is not taken into account?
I see that its default value is `temp-buffer-resize', the same unchanged
value used in the test above.

I also tried a new action `display-buffer-at-bottom', and it doesn't
seem quite right yet.  With the same configuration (`C-x 3 C-x 2'),
and two marked files it displays a large almost empty window with just
two lines.  `temp-buffer-resize-mode' helps to narrow it, but I still wonder
why this window is not frame'e full-width?  I mean the idea was to display
a list of files near the minibuffer prompt of the left side of the frame,
but this list is displayed on the right side of the frame.

> `dired-pop-to-buffer' is no longer called and `dired-shrink-to-fit' is
> no longer consulted.
> If you really insist on handling dired's pop-up buffers separately,
> I can do that by binding `temp-buffer-resize-mode' appropriately, but
> I'd rather have a common solution for handling all temporary windows
> in the same manner.

There is nothing wrong when a package uses a local variable
that changes the general behavior.  So `dired-mark-pop-up' could still
call `dired-pop-to-buffer' that will bind `temp-buffer-resize-mode'
according to the value of `dired-shrink-to-fit'.  This assumes that
`dired-pop-to-buffer' is the right name for this functionality.
Otherwise, it could be marked obsolete.