From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#11810: 24.1.50; `vc-diff' shrinks pre-existing window Date: Tue, 03 Jul 2012 16:48:13 +0400 Message-ID: <4FF2EA0D.9030006@yandex.ru> References: <4FECAF0F.1080307@yandex.ru> <4FED556A.4060702@gmx.at> <4FEE2EA5.5060905@yandex.ru> <4FEEC259.7040308@gmx.at> <4FEF8935.9010508@yandex.ru> <4FF012FE.1010502@gmx.at> <4FF05DC0.4080609@yandex.ru> <4FF146F4.1080103@gmx.at> <4FF1A30F.4090806@yandex.ru> <4FF1CD2C.5000704@gmx.at> <4FF206F5.4030101@yandex.ru> <4FF29BE7.2030006@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341319785 21701 80.91.229.3 (3 Jul 2012 12:49:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 Jul 2012 12:49:45 +0000 (UTC) Cc: 11810@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 03 14:49:44 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sm2Y0-0007B0-N1 for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jul 2012 14:49:40 +0200 Original-Received: from localhost ([::1]:38722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm2Xz-0006ap-QD for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jul 2012 08:49:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm2Xr-0006aV-AU for bug-gnu-emacs@gnu.org; Tue, 03 Jul 2012 08:49:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sm2Xh-0005HV-8s for bug-gnu-emacs@gnu.org; Tue, 03 Jul 2012 08:49:30 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm2Xg-0005HQ-Uo for bug-gnu-emacs@gnu.org; Tue, 03 Jul 2012 08:49:21 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sm2cD-0006gq-L9 for bug-gnu-emacs@gnu.org; Tue, 03 Jul 2012 08:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Jul 2012 12:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11810 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11810-submit@debbugs.gnu.org id=B11810.134131998125639 (code B ref 11810); Tue, 03 Jul 2012 12:54:01 +0000 Original-Received: (at 11810) by debbugs.gnu.org; 3 Jul 2012 12:53:01 +0000 Original-Received: from localhost ([127.0.0.1]:44833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sm2bF-0006fN-5a for submit@debbugs.gnu.org; Tue, 03 Jul 2012 08:53:01 -0400 Original-Received: from forward13.mail.yandex.net ([95.108.130.120]:47020) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sm2bB-0006fF-M3 for 11810@debbugs.gnu.org; Tue, 03 Jul 2012 08:53:00 -0400 Original-Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [95.108.131.192]) by forward13.mail.yandex.net (Yandex) with ESMTP id EFD9D142655; Tue, 3 Jul 2012 16:48:12 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1341319693; bh=nMXwv4dpYVA90npAQWhqqTuMZrEsIJGeXXAtwj+pCaw=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=YjEHbw6W4VsSxqjpdCRztsjsBTP7XMGd3n5NO6vJ+CotpZ7LjPWJXhJu7A7wX3KK5 xpQxdwFmmcniNWi09RMvmGZ/zLqVVfA4PGR4WHJvQFISubWP2XFAdkRlJU6l4HUBjn UbgNKlHVBd3sfqYMBs8ehuEIsKebFbialp/pLvF0= Original-Received: from smtp14.mail.yandex.net (localhost [127.0.0.1]) by smtp14.mail.yandex.net (Yandex) with ESMTP id CEB561B60267; Tue, 3 Jul 2012 16:48:12 +0400 (MSK) Original-Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp14.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mC7GAc8B-mC7SLpt6; Tue, 3 Jul 2012 16:48:12 +0400 X-Yandex-Rcpt-Suid: rudalics@gmx.at X-Yandex-Rcpt-Suid: 11810@debbugs.gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1341319692; bh=nMXwv4dpYVA90npAQWhqqTuMZrEsIJGeXXAtwj+pCaw=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=F6crqkhWBPJxYxL8oaJa3z0iursZ/pas71rryheWfaTwxGOUSKzjPOtt8viedaw2y Jwnq39kSixagh0MaJ85hiIjqmVenTW6no71UorEJ7FShTleo0tH5QGBz3x5aJo9lO4 efCZ8g7r+UWP6affdwf3W2dU4jYp6wV0hoDvFrIo= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: <4FF29BE7.2030006@gmx.at> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61522 Archived-At: On 03.07.2012 11:14, martin rudalics wrote: > >> >> (2) When `temp-buffer-resize-mode' is nil and the window size has > >> >> changed, the change was probably due to some manual > intervention > >> >> probably needed to see more of a buffer originally present > >> and it > >> >> seems better to leave that change alone. > >> > >> ... in this case we can be sure that the user changed the size so we > >> probably should leave it alone. > > > > That depends on the definition of "the user". In our case, *I* didn't > > explicitly resize the window, `vc-diff' did. > > Because of `even-window-heights'? That's something I obviously forgot Because of `shrink-window-if-larger-than-buffer'. `even-window-heights' could have contributed in another case, if my windows were not of equal height already. > to handle when quitting a window. Maybe the best solution is to set the > 3rd element of the quit-restore parameter iff either > > (1) `temp-buffer-resize-mode' is non-nil, or Maybe just when `fit-window-to-buffer' is called? That would account for `shrink-window-if-larger-than-buffer', too. > (2) `window--even-window-heights' actually did resize the window > > and don't do the `temp-buffer-resize-mode' check in `quit-window'. > > > How about clearing (or changing) the 'quit-window parameter in each > > command when we're sure that the user won't want to have the size > > restored afterwards? > > There would be a set of "user-facing" functions that would do that. > > `adjust-window-trailing-edge' would be an obvious candidate. But which > window's parameter would you clear? Both? What's the second one? Please keep in mind that I don't know the window.el codebase, I'm just reading the code along the discussion. > > How will the temp-buffer-resize-mode null check help in this case? > > It's a global minor mode, so it's either t in all buffers, or nil in all > > of them. > > That's why I would have set `temp-buffer-resize-mode' buffer-locally to > t. But it's ugly. If `temp-buffer-resize-mode' were on, that wouldn't have made a difference, would it? You'd have to locally set `temp-buffer-resize-mode' to nil in all cases when you don't want the window size to be restored afterwards, which is the same amount of work as clearing 'quit-window parameter. > >> I don't know. I think a vc-diff buffer should be considerded a > >> temporary buffer, subject to `temp-buffer-resize-mode'. Ideally, > >> windows of non-temporary buffers are never shrunk automatically. > > > > Would a window that displayed a normal buffer previously but which now > > is displaying a temporary buffer be considered a "window of > > non-temporary buffer"? > > Only after it displays the normal buffer again. Why did you ask? Because that's what at issue here. I think the main two cases of automatic shrinking are: 1) "temp buffer" in a window that was created for it, 2) "temp buffer" in a reused window, and 2) is the reason I filed this bug.