Subject: RE: bug#7822: 24.0.50; `fit-window-to-buffer': take display artefacts into account

From: "Drew Adams" <[email-masked]>
Date: Wed, 12 Jan 2011 10:24:21 -0800

> > I don't see why _any_ windows should be taken into account. 
> > The window for the buffer should be resized to fit the
> > displayed buffer, period.  If that is not possible for some
> > reason, then we decide what to do.
> 
> Hm. Just because you have to actually do the resizing and that affects
> other windows and a decision has to be made how?

Yes, but that's the last part of what I wrote: "then we decide what to do".
And, a priori at least, that decision is the same anytime a window is resized.
IOW, a priori there is nothing special in that regard about fitting a window to
a buffer.

> > For that decision, I would imagine that we decide the same 
> > way we decide now when you try to resize a window to size
> > S and that is not possible.  Why is this
> > case any different from other resizing cases?
> 
> Do we really have good ways to easily solve this? 

I don't know, but that question is a general one and independent of _this_
bug/feature, which is fitting a window to its displayed buffer.

You are bringing in extraneous stuff.  Interesting stuff no doubt, but not
specific to fitting a window to its buffer.

> Maybe I am missing something? Perhaps you have some
> specific suggestion for how to do
> this? Which functions do you think supply the needed features?

No I don't.  No doubt window experts such as Martin have some ideas and have
already considered the question.  My point is that it is outside the scope of
this thread.  _Any_ time a window is resized the questions you raise are
pertinent - they have nothing in particular to do with _this_ resizing of a
window.

> > AFAICT, all that's involved here is to determine the 
> > desired window size. Beyond that, there should be nothing new.
> 
> One little detail of course: It should not delete other windows. (If
> you allow it do delete other windows there are much simpler
> implementations than the one I am suggesting. Much simpler.)

I repeat.  I don't see why this resizing is any different from any other window
resizing.