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#7218: 24.0.50; Weird window resizing with ibuffer-auto-mode Date: Fri, 15 Oct 2010 08:34:42 +0200 Message-ID: <4CB7F602.2010209@gmx.at> References: <874ocobq57.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1287124952 8725 80.91.229.12 (15 Oct 2010 06:42:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Oct 2010 06:42:32 +0000 (UTC) Cc: 7218@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 15 08:42:31 2010 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 1P6dzq-0007q3-Nv for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Oct 2010 08:42:31 +0200 Original-Received: from localhost ([127.0.0.1]:53891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6dzq-0007Vl-4L for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Oct 2010 02:42:30 -0400 Original-Received: from [140.186.70.92] (port=48654 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6dzh-0007TY-8Z for bug-gnu-emacs@gnu.org; Fri, 15 Oct 2010 02:42:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P6dzf-0007u4-Sy for bug-gnu-emacs@gnu.org; Fri, 15 Oct 2010 02:42:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P6dzf-0007tz-R7 for bug-gnu-emacs@gnu.org; Fri, 15 Oct 2010 02:42:19 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1P6dpi-0001P7-Gn; Fri, 15 Oct 2010 02:32: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: Fri, 15 Oct 2010 06:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7218 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7218-submit@debbugs.gnu.org id=B7218.12871242735351 (code B ref 7218); Fri, 15 Oct 2010 06:32:02 +0000 Original-Received: (at 7218) by debbugs.gnu.org; 15 Oct 2010 06:31:13 +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 1P6dou-0001OF-Uc for submit@debbugs.gnu.org; Fri, 15 Oct 2010 02:31:13 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22] helo=mail.gmx.net) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1P6dos-0001O4-Vl for 7218@debbugs.gnu.org; Fri, 15 Oct 2010 02:31:12 -0400 Original-Received: (qmail invoked by alias); 15 Oct 2010 06:34:44 -0000 Original-Received: from 62-47-61-162.adsl.highway.telekom.at (EHLO [62.47.61.162]) [62.47.61.162] by mail.gmx.net (mp040) with SMTP; 15 Oct 2010 08:34:44 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+0WR8mswi0HTOTWeOooaGqWvErp1OPHsR84sIJ7t TuTLhLZaPJscoN User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <874ocobq57.fsf@thinkpad.tsdh.de> X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 15 Oct 2010 02:32: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:40902 Archived-At: > After invoking ibuffer with ibuffer-auto-mode enabled, all windows I > switch to using `C-x o' are shrunken to fit their contents. Switching > windows again restores the original size. That's pretty annoying. > > Here's a recipe: > > 1) emacs -Q > 2) In *scratch*, evaluate these settings: > > --8<---------------cut here---------------start------------->8--- > (defun th-ibuffer-mode-init () > (ibuffer-auto-mode 1)) > > (add-hook 'ibuffer-mode-hook > 'th-ibuffer-mode-init) > > (global-set-key (kbd "C-x C-b") > (lambda () > (interactive) > (ibuffer t nil nil nil 'onewindow))) > --8<---------------cut here---------------end--------------->8--- > > 3) Press C-x C-b > 4) The *IBuffer* buffer window shows *scratch* and *Messages* and is > resized to fit its contents. > 5) Press C-x o multiple times, and see how windows start shrinking and > growing. > > As long as the *IBuffer* buffer is alive, I get that strange window > resizing also when it's not visible and switching between windows > showing for example *scratch* and *Messages*. As soon as I kill the > *IBuffer* buffer, it works again. It happens because `ibuffer-shrink-to-fit' shrinks the selected window regardless of the buffer it displays. I suppose doing something like (defun ibuffer-shrink-to-fit (&optional owin) ;; Make sure that redisplay is performed, otherwise there can be a ;; bad interaction with code in the window-scroll-functions hook (redisplay t) (when (with-current-buffer (window-buffer) ibuffer-auto-mode) (fit-window-to-buffer nil (when owin (/ (frame-height) (length (window-list (selected-frame)))))))) would cure it. But I'd rather not comment on calling a function like `ibuffer-shrink-to-fit' in `post-command-hook' ;-) martin