Subject: Re: bug#11810: 24.1.50; `vc-diff' shrinks pre-existing window

From: martin rudalics <[email-masked]>
Date: Thu, 05 Jul 2012 11:53:20 +0200

> I tried it with just my patch applied, and it didn't work, because in
 > this case the stored height value was of already resized window:
 > `display-buffer-record-window' is called from `window--display-buffer',
 > and `display-buffer-use-some-window' calls `window--even-window-heights'
 > before `window--display-buffer'.

I think we could do

     (when window
       (prog1
	  (window--display-buffer buffer window 'reuse)
       (window--even-window-heights window)))

in `display-buffer-use-some-window'.

 > Maybe that's fine, I'll just set the variable to nil.

OK

 > Until then, the issue is somewhat alleviated by the fact that you can
 > press 'z' or 'C-x k' instead of 'q', and both of these won't trigger
 > height restoration.

I'm more concerned with the fact that an application might reuse the
shrunk window via `display-buffer'.

 > If someone wants `shrink-window-if-...' to have no effect only in
 > `vc-diff', well, that's a different goal.

But that's probably what some people want.

 >> Let's close this thread as follows: Remove the `temp-buffer-resize-mode'
 >> check in `quit-window' and add an integerp check for the third element.
 >
 > Agreed.

Can you install it?  Else please post the patch and a ChangeLog entry.

 >> (1) have `vc-diff' use something similar to `with-output-to-temp-buffer'
 >>      so that `temp-buffer-resize-mode' is honored,
 >>
 >> (2) resize the window only if `temp-buffer-resize-mode' is enabled, or
 >
 > Both 1 and 2 would be fine, I think, although 1 would require some extra
 > work to make it work asynchronously. IIUC, `with-output-to-temp-buffer'
 > waits until the called process completes, and `vc-diff' supports both
 > synchronous and asynchronous execution.

We need a susbstitute for `with-output-to-temp-buffer' for
asynchronously filled buffers.

martin