From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#6385: A slightly less aggressive fit-window-to-buffer Date: Sun, 13 Jun 2010 09:51:34 +0200 Message-ID: <4C148E06.2040308@gmx.at> References: <4C12383E.5030405@gmx.at> <4C133EBB.5090702@gmx.at> <4C1396B9.6080705@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1276415918 31930 80.91.229.12 (13 Jun 2010 07:58:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 Jun 2010 07:58:38 +0000 (UTC) Cc: 6385@debbugs.gnu.org To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 13 09:58:37 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ONi5S-0006jh-BC for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Jun 2010 09:58:34 +0200 Original-Received: from localhost ([127.0.0.1]:38165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONi5R-0006Ux-Hz for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Jun 2010 03:58:33 -0400 Original-Received: from [140.186.70.92] (port=53413 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONi5J-0006Sm-P6 for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 03:58:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONi5I-0004Ng-KQ for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 03:58:25 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47589) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONi5I-0004Nb-Hr for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 03:58:24 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1ONhz8-0001XB-AT; Sun, 13 Jun 2010 03:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Jun 2010 07:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6385-submit@debbugs.gnu.org id=B6385.12764155045879 (code B ref 6385); Sun, 13 Jun 2010 07:52:02 +0000 Original-Received: (at 6385) by debbugs.gnu.org; 13 Jun 2010 07:51:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONhyq-0001Wm-8r for submit@debbugs.gnu.org; Sun, 13 Jun 2010 03:51:44 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1ONhym-0001Wg-MF for 6385@debbugs.gnu.org; Sun, 13 Jun 2010 03:51:42 -0400 Original-Received: (qmail invoked by alias); 13 Jun 2010 07:51:36 -0000 Original-Received: from 62-47-39-237.adsl.highway.telekom.at (EHLO [62.47.39.237]) [62.47.39.237] by mail.gmx.net (mp032) with SMTP; 13 Jun 2010 09:51:36 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/CL3sjh3PC43PpW9Q840GyQSAtY5d9e4K/bAHfW7 r0O23taP5ugFfO User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 13 Jun 2010 03:52:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37736 Archived-At: > Can't we just throw in a better code instead of fit-window-to-buffer? > (And rename fit-window-to-buffer to killing-window-fit-to-buffer if > someone really wants it.) > > It does not have to be perfect. Just good enough. We can surely make > it better later if we need to. I suppose there's no need for a `killing-window-fit-to-buffer'. Writing a non-killing one with Emacs 23 means can be done in a number of ways: (1) Use `adjust-window-trailing-edge'. IIRC that's what you already did when you wrote your window balancing algorithm so you know how to do that. (2) Save the window configuration and the number of windows around the `enlarge-window' call in `fit-window-to-buffer' and restore the configuration when a window got deleted. That's more or less what `adjust-window-trailing-edge' does internally. (3) Adjust enlarge_window so it doesn't delete windows. Since I don't understand enlarge_window any more I can't give you advice on (3). If you want to try (1) or (2) ask me if you encounter problems. martin