From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#51062: Customizable window resizing Date: Wed, 13 Oct 2021 21:46:58 +0300 Organization: LINKOV.NET Message-ID: <871r4oahjx.fsf@mail.linkov.net> References: <87zgrm2h6v.fsf@mail.linkov.net> <63433373-a57b-a68a-8ccc-6d4a9192d9a4@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15559"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 51062@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 13 20:52:27 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1majMX-0003jd-Ur for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Oct 2021 20:52:25 +0200 Original-Received: from localhost ([::1]:41530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1majMW-0007Md-Vb for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Oct 2021 14:52:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1majJG-0004HF-Th for bug-gnu-emacs@gnu.org; Wed, 13 Oct 2021 14:49:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1majJG-0007CG-Kt for bug-gnu-emacs@gnu.org; Wed, 13 Oct 2021 14:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1majJG-0006cr-5z for bug-gnu-emacs@gnu.org; Wed, 13 Oct 2021 14:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Oct 2021 18:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51062 X-GNU-PR-Package: emacs Original-Received: via spool by 51062-submit@debbugs.gnu.org id=B51062.163415088325291 (code B ref 51062); Wed, 13 Oct 2021 18:49:02 +0000 Original-Received: (at 51062) by debbugs.gnu.org; 13 Oct 2021 18:48:03 +0000 Original-Received: from localhost ([127.0.0.1]:33421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1majII-0006Zr-NL for submit@debbugs.gnu.org; Wed, 13 Oct 2021 14:48:02 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:48395) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1majIG-0006Z2-W6 for 51062@debbugs.gnu.org; Wed, 13 Oct 2021 14:48:01 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 6C614240006; Wed, 13 Oct 2021 18:47:53 +0000 (UTC) In-Reply-To: <63433373-a57b-a68a-8ccc-6d4a9192d9a4@gmx.at> (martin rudalics's message of "Wed, 13 Oct 2021 10:36:27 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:217165 Archived-At: >> There are two ways how window resizing is currently hard-coded: >> >> 1. As discussed in >> https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01627.html >> when temp-buffer-resize-mode is enabled, it's impossible >> to disable automatic window resizing of the Help buffer. >> >> Thanks to Martin, the patch in >> https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01873.html >> allows customization when display-buffer-alist contains >> (window-height . nil) > > That patch should help wherever 'temp-buffer-resize-mode' applies, not > just in a Help buffer. > > This patch has been meanwhile applied on master. Strange, when I tested the patch that you sent to emacs-devel, it worked correctly. But after you applied the patch on master, it doesn't work. I'm trying to debug why (window-height . nil) has no effect on Help buffers. >> 2. As discussed in bug#45688, such commands as vc-log > > Which command is 'vc-log'? I meant log-related vc-commands that use shrink-window-if-larger-than-buffer, i.e. all commands that use vc-log-internal-common. >> , vc-diff >> automatically resize the window, and the problem is that currently >> shrink-window-if-larger-than-buffer is used in these commands by default, >> but this behavior is hard-coded and can't be disabled by customization. >> A solution is to create a new hook like 'after-display-buffer-function' >> that by default will contain 'shrink-window-if-larger-than-buffer'. > > Wherever we currently use an idiom like > > (pop-to-buffer (current-buffer)) > (goto-char (point-min)) > (shrink-window-if-larger-than-buffer) > > we should use > > (pop-to-buffer > (current-buffer) > '(nil (window-height . shrink-window-if-larger-than-buffer))) > (goto-char (point-min)) > > instead. But if 'display-buffer' is not involved, there isn't much we > can do. Maybe something like 'display-buffer-same-window' _after_ > putting the buffer into the selected window, but this might not be 100% > compatible. Certainly not for Emacs 28. This is a good idea to try. But not sure how this is possible to use in vc-run-delayed that is called when the buffer was already displayed long ago.