From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 'Emacs-Devel' <emacs-devel@gnu.org>
Subject: Re: FW: fit-frame.el
Date: Tue, 11 Mar 2008 17:00:13 -0400 [thread overview]
Message-ID: <jwvabl5htke.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <000001c883a8$05f16670$0600a8c0@us.oracle.com> (Drew Adams's message of "Tue, 11 Mar 2008 10:45:03 -0800")
> 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
prev parent reply other threads:[~2008-03-11 21:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-10 4:44 FW: fit-frame.el Drew Adams
2008-03-10 15:34 ` Stefan Monnier
2008-03-10 17:04 ` Drew Adams
2008-03-10 18:24 ` Stefan Monnier
2008-03-10 20:45 ` Drew Adams
2008-03-11 18:17 ` Stefan Monnier
2008-03-11 18:45 ` Drew Adams
2008-03-11 21:00 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvabl5htke.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).