From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Resizing windows after display-buffer Date: Mon, 25 Apr 2011 10:35:18 +0200 Message-ID: <4DB53246.7040600@gmx.at> References: <87oc3v8b8z.fsf@stupidchicken.com> 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 1303720535 29364 80.91.229.12 (25 Apr 2011 08:35:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Apr 2011 08:35:35 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 25 10:35:30 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QEHGU-0005Qn-0l for ged-emacs-devel@m.gmane.org; Mon, 25 Apr 2011 10:35:30 +0200 Original-Received: from localhost ([::1]:33578 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEHGS-0007E1-U9 for ged-emacs-devel@m.gmane.org; Mon, 25 Apr 2011 04:35:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEHGQ-0007Dw-4H for emacs-devel@gnu.org; Mon, 25 Apr 2011 04:35:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEHGP-0008N8-4b for emacs-devel@gnu.org; Mon, 25 Apr 2011 04:35:26 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:50120) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QEHGO-0008HL-NR for emacs-devel@gnu.org; Mon, 25 Apr 2011 04:35:25 -0400 Original-Received: (qmail invoked by alias); 25 Apr 2011 08:35:21 -0000 Original-Received: from 62-47-51-162.adsl.highway.telekom.at (EHLO [62.47.51.162]) [62.47.51.162] by mail.gmx.net (mp007) with SMTP; 25 Apr 2011 10:35:21 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+zfu4OfFGztpFWmiUGN1ZyepONvmCzmWSmKEhr5r n/VeHeTMj4iAXk User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.165.64.23 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138706 Archived-At: > In my everyday use, I display the buffer I'm working on (code, a text > file, whatever) in a full window; the only time that the window is > split is for temporary or secondary uses; for example, help windows, > occur output, ielm, an inferior mode (python, lisp, etc.), re-builder, > bs-show, etc; and I make sure that the "secondary" buffer goes always > to the bottom window and that window is resized to fit the buffer or > have a height limit (typically about a third of the frame height). I suppose the `fit-window-to-buffer' feature should probably depend on the buffer name much like the options `same-window-buffer-names' or `special-display-buffer-names' so a user can choose the set of buffers where the windows should fit. (I know that the variable can be made buffer-local but the customization mechanism doesn't support that.) > If > I switch to the bottom window and do something that would cause the > top window to display another buffer (multi-occur, for example, or > selecting a new buffer from bs-show), I *don't* want the top window to > be resized. This means the `fit-window-to-buffer' scheme should probably only apply to new windows. In the case you describe we have also to observe things like `even-window-heights' whose interaction with `fit-window-to-buffer' seems yet unresolved at the moment. Likely `fit-window-to-buffer' should prevail, but should we, for example, even sizes when both buffers are to large to fit the window? > So, in my case, a setting that would make every display-buffer to try > to fit is much worse than a minor mode that I can call from whatever > mode hook I like. We already have a defcustom like `dired-shrink-to-fit'. Also note that `temp-buffer-resize-mode' only applies to the `display-buffer' call itself. Thereafter, it does not have any effect - changing the size of characters or the text of the buffer doesn't trigger resizing of the window. Hence calling this a mode seems a bit exaggerated. So the question is why you think that activating a minor mode from a mode hook is more convenient than setting an option from that hook. martin