emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: fit-frame.el


From: Stefan Monnier
Subject: Re: FW: fit-frame.el
Date: Tue, 11 Mar 2008 17:00:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> I don't see anything that's unfinished. It works fine with one-window
> frames. It works fine with more than one window also, if you want to resize
> the frame so that a particular buffer (window) is displayed without
> wrapping. That is the feature, and it does that fine.

Open a new frame, split it with C-x 2, in the top-window place
a 2-line buffer, in the bottom-window place a 20-line buffer.  Then M-x
fit-frame.  Your 2-line buffer will be in a window too-tall for its
2 lines, and the botton window will not be tall enough.

For line-wrapping, repeat the above example but with C-x 3 and with
columns and instead of lines.

> You seem to be wanting something that it doesn't pretend to do. And
> something that you can't even describe (!): balance window sizes in some
> undefined ideal fashion. That's a different feature altogether.

Your code computes a number of lines and columns it wants to attribute
to each window, so it should at least try to change the window
size accordingly.

>> > Only shrinks it to what size?
>> fit-frame can grow or shrink, depending on the situation.  
>> I'm proposing to provide a restriction of it that only shrinks
>> (i.e. use the current size as an upper bound on the desired final
>> size).

> I understood. The question is: shrinks to what size?

> It's easy enough to have a variant that does the same thing as now, but
> prohibits any expansion, if that's all you mean.

Yup, that's all I mean.  Not sure what else it could mean.

> I don't see why that's particularly useful, but it's easy enough
> to implement.

Because it's pretty safe, so can be called at many more places.
Just like the difference between fit-window-to-buffer and
shrink-window-if-larger-than-buffer.

Also, as mentioned it probably doesn'y need *any* custom variable (tho
this is largely just a side-effect of being safe).

> And you can add a variant that only grows, instead of only shrinks. And a
> variant that only shrinks or only grows vertically, or horizontally...

I've never found a need for such a variant.  OTOH an `undo' might be
handy if the user tries fit-frame and finds that the new size doesn't
"fit".


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]