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: Fri, 06 Jul 2012 03:19:37 +0400 Message-ID: <4FF62109.6000608@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> <4FF2EA0D.9030006@yandex.ru> <4FF3207B.1050609@gmx.at> <4FF3404E.6000207@yandex.ru> <4FF40A6C.2050601@gmx.at> <4FF46B89.5040301@yandex.ru> <4FF56410.7000705@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010102080402090501070203" X-Trace: dough.gmane.org 1341530415 8628 80.91.229.3 (5 Jul 2012 23:20:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jul 2012 23:20:15 +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 Fri Jul 06 01:20:15 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 1SmvLJ-0008Q5-RJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Jul 2012 01:20:14 +0200 Original-Received: from localhost ([::1]:54425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmvLI-0005g3-Qn for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jul 2012 19:20:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmvLF-0005ff-VA for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2012 19:20:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmvLD-00051n-Rh for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2012 19:20:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmvLD-00051O-Hj for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2012 19:20:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SmvPx-0000X3-Ru for bug-gnu-emacs@gnu.org; Thu, 05 Jul 2012 19:25:02 -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: Thu, 05 Jul 2012 23:25: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.13415306762015 (code B ref 11810); Thu, 05 Jul 2012 23:25:01 +0000 Original-Received: (at 11810) by debbugs.gnu.org; 5 Jul 2012 23:24:36 +0000 Original-Received: from localhost ([127.0.0.1]:51145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmvPX-0000WS-M8 for submit@debbugs.gnu.org; Thu, 05 Jul 2012 19:24:36 -0400 Original-Received: from forward3.mail.yandex.net ([77.88.46.8]:59751) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmvPU-0000WH-LD for 11810@debbugs.gnu.org; Thu, 05 Jul 2012 19:24:34 -0400 Original-Received: from smtp2.mail.yandex.net (smtp2.mail.yandex.net [77.88.46.102]) by forward3.mail.yandex.net (Yandex) with ESMTP id 82A79B41646; Fri, 6 Jul 2012 03:19:33 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1341530376; bh=Hl9FNuQe8OyHGa9g2GSls7N9HP9LP17vgagANfELqCs=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=a9x5en1ZMPTo/84SCteQnYEwyKJhm3/ggN6e03/6zCvqbj54KG1sWCaBpHWTdHom+ wTwvPNQ28pWEvjd+d9a7/d+DA5FWRJ2zd0VV6Yf4kdAnFd6KZUKtIE8Cv1JWc5T+E5 Xx5RikNRC7U4q9FTBgkqbZelxjXwmGwhJaBuXzdA= Original-Received: from smtp2.mail.yandex.net (localhost [127.0.0.1]) by smtp2.mail.yandex.net (Yandex) with ESMTP id 60E9EE2057B; Fri, 6 Jul 2012 03:19:33 +0400 (MSK) Original-Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp2.mail.yandex.net (nwsmtp/Yandex) with ESMTP id JWYeKIoq-JWYSLOHM; Fri, 6 Jul 2012 03:19:33 +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=1341530373; bh=Hl9FNuQe8OyHGa9g2GSls7N9HP9LP17vgagANfELqCs=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type; b=Slv6bndOou2nUIt2lCX19y1Z4qCGTugmBrFFcZOmX9R3XPHuldaM1Rcnw6Z4wiSLi N4wSPYEFFcvYTgy2CO2IPIgu0+ipKfHeNq49hWGXFig0/mioPvrnRT7wu0gXTKvIye nhrsPNN3zKhuGaD54zD/U+mg30I639Fy6nu70dqQ= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: <4FF56410.7000705@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:61631 Archived-At: This is a multi-part message in MIME format. --------------010102080402090501070203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05.07.2012 13:53, martin rudalics wrote: > > I tried it with just my patch applied, and it didn't work, because in > > this case the stored height value was of already resized window: > > `display-buffer-record-window' is called from `window--display-buffer', > > and `display-buffer-use-some-window' calls `window--even-window-heights' > > before `window--display-buffer'. > > I think we could do > > (when window > (prog1 > (window--display-buffer buffer window 'reuse) > (window--even-window-heights window))) > > in `display-buffer-use-some-window'. That should work, but IMO `even-window-heights' behavior is just too surprising (with its conditions on window positions), so, if you don't mind, I'll open another bug with proposal to change its default value, presenting the above as alternative. > > Until then, the issue is somewhat alleviated by the fact that you can > > press 'z' or 'C-x k' instead of 'q', and both of these won't trigger > > height restoration. > > I'm more concerned with the fact that an application might reuse the > shrunk window via `display-buffer'. In this case, unless the new buffer is the same as the one already displayed in the shrunk window, `display-buffer-record-window' will overwrite the 'quit-restore parameter, so I don't see what the problem scenario would be. Hadn't managed to reproduce one either. > > If someone wants `shrink-window-if-...' to have no effect only in > > `vc-diff', well, that's a different goal. > > But that's probably what some people want. I don't think we've seen a request exactly like that yet, but that would require a vc-prefixed variable. Asynchronous `with-output-to-temp-buffer' proposal is better in that regard. > >> Let's close this thread as follows: Remove the > `temp-buffer-resize-mode' > >> check in `quit-window' and add an integerp check for the third element. > > > > Agreed. > > Can you install it? Else please post the patch and a ChangeLog entry. Nope. Is unified diff okay? window.el (quit-window): Always restore window height when it's saved in quit-restore parameter. -- Dmitry --------------010102080402090501070203 Content-Type: text/plain; charset=windows-1251; name="quit-window.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="quit-window.diff" diff --git a/lisp/window.el b/lisp/window.el index b362f40..f9adf84 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3069,9 +3069,8 @@ one. If non-nil, reset `quit-restore' parameter to nil." (buffer-live-p (car quad)) (eq (nth 3 quit-restore) buffer)) ;; Show another buffer stored in quit-restore parameter. - (setq resize (with-current-buffer buffer - (and temp-buffer-resize-mode - (/= (nth 3 quad) (window-total-size window))))) + (setq resize (and (integerp (nth 3 quad)) + (/= (nth 3 quad) (window-total-size window)))) (set-window-dedicated-p window nil) (when resize ;; Try to resize WINDOW to its old height but don't signal an --------------010102080402090501070203--