From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: FW: fit-frame.el Date: Tue, 11 Mar 2008 17:00:13 -0400 Message-ID: References: <004301c88269$637220e0$0600a8c0@us.oracle.com> <000f01c882d0$df847ef0$c2b22382@us.oracle.com> <002c01c882ef$a76bbeb0$c2b22382@us.oracle.com> <000001c883a8$05f16670$0600a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205269305 20800 80.91.229.12 (11 Mar 2008 21:01:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Mar 2008 21:01:45 +0000 (UTC) Cc: 'Emacs-Devel' To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 11 22:02:13 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JZBb1-0004Ai-Bw for ged-emacs-devel@m.gmane.org; Tue, 11 Mar 2008 22:01:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZBaT-0001Ap-4I for ged-emacs-devel@m.gmane.org; Tue, 11 Mar 2008 17:00:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZBaC-00018k-77 for emacs-devel@gnu.org; Tue, 11 Mar 2008 17:00:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZBaB-00018X-LK for emacs-devel@gnu.org; Tue, 11 Mar 2008 17:00:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZBaB-00018U-Gu for emacs-devel@gnu.org; Tue, 11 Mar 2008 17:00:23 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JZBaB-0001WD-1D for emacs-devel@gnu.org; Tue, 11 Mar 2008 17:00:23 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id AF7942CFA2D; Tue, 11 Mar 2008 17:00:22 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 057243FE0; Tue, 11 Mar 2008 17:00:14 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id E61056CAA2; Tue, 11 Mar 2008 17:00:13 -0400 (EDT) In-Reply-To: <000001c883a8$05f16670$0600a8c0@us.oracle.com> (Drew Adams's message of "Tue, 11 Mar 2008 10:45:03 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:92197 Archived-At: > 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