From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#36859: Customizable fit-window-to-buffer Date: Wed, 31 Jul 2019 23:57:14 +0300 Organization: LINKOV.NET Message-ID: <87sgqmq67t.fsf@mail.linkov.net> References: <87sgqnp9z8.fsf@mail.linkov.net> <6a42d2af-b17a-d2da-1c3c-655f3f2a356f@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="117490"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 36859@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 31 23:26:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hsw6v-000UTU-SL for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Jul 2019 23:26:14 +0200 Original-Received: from localhost ([::1]:44682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsw6u-0000wA-GH for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Jul 2019 17:26:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47483) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsw6p-0000w2-9T for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 17:26:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsw6n-00039s-8c for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 17:26:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44385) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsw6j-00037d-VT for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 17:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hsw6j-0004lS-RF for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 17:26:01 -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, 31 Jul 2019 21:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36859 X-GNU-PR-Package: emacs Original-Received: via spool by 36859-submit@debbugs.gnu.org id=B36859.156460830718227 (code B ref 36859); Wed, 31 Jul 2019 21:26:01 +0000 Original-Received: (at 36859) by debbugs.gnu.org; 31 Jul 2019 21:25:07 +0000 Original-Received: from localhost ([127.0.0.1]:53198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsw5r-0004jv-0F for submit@debbugs.gnu.org; Wed, 31 Jul 2019 17:25:07 -0400 Original-Received: from bisque.elm.relay.mailchannels.net ([23.83.212.18]:36975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsw5o-0004jm-Ka for 36859@debbugs.gnu.org; Wed, 31 Jul 2019 17:25:05 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8638E5E1591; Wed, 31 Jul 2019 21:25:03 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a99.g.dreamhost.com (100-96-84-65.trex.outbound.svc.cluster.local [100.96.84.65]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 155085E2F0D; Wed, 31 Jul 2019 21:25:03 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a99.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.5); Wed, 31 Jul 2019 21:25:03 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Tangy-Illegal: 081f3d797cacc6a8_1564608303364_981803977 X-MC-Loop-Signature: 1564608303364:1658425675 X-MC-Ingress-Time: 1564608303364 Original-Received: from pdx1-sub0-mail-a99.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a99.g.dreamhost.com (Postfix) with ESMTP id E33128109C; Wed, 31 Jul 2019 14:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Sm6MRttYNSDLiKbxV6BwWGkm/ko=; b= Yms9KGgm4qYnj+Gv+xsuDGTz7a5vUYLd/QlzpdvpMxsw7NQz3aAPJYUAUFhE3hqf T8pkhzqZZnR/nn+Uqe3fwOIQAlgvUViwC2Au+gd6Th3+DkfrQIvEdOY9OlGOb/0v 51KGdzxkKHLQonn5iC15dyfLzroGKW8g72osdoPwbps= Original-Received: from mail.jurta.org (m91-129-103-76.cust.tele2.ee [91.129.103.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a99.g.dreamhost.com (Postfix) with ESMTPSA id EE99E810A2; Wed, 31 Jul 2019 14:24:55 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a99 In-Reply-To: <6a42d2af-b17a-d2da-1c3c-655f3f2a356f@gmx.at> (martin rudalics's message of "Wed, 31 Jul 2019 11:12:46 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrleehgdduheelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdefrdejieenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdefrdejiedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgepud X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:164193 Archived-At: >> It's a nice feature when fit-window-to-buffer resizes temporary windows >> that go away after exiting the minibuffer. >> >> OTOH, resizing permanent windows does more harm, because these windows >> can be reused later for other buffers, but their size remains too narrow. > > What is a permanent window? A window that remains indefinitely after finishing the current command, and where other buffers with different number of lines might appear. IIRC we only fit new windows or frames > that go away when quit and carefully try to not resize other windows > but the one used for splitting off the new window. Old windows are > fit iff they did show the same buffer before and were created for that > buffer. Such windows should, by concept, not be reused for showing > another buffer. I see that the existing windows are resized with 'shrink-window-if-larger-than-buffer'. So not only 'fit-window-to-buffer' is involved. Two examples of 'shrink-window-if-larger-than-buffer': - in vc-log-internal-common; - in vc-diff-finish. >> I'm not asking to change the default behavior, but it should be customizable. > > In what sense? I hope it would be possible to specify a special action alist entry in 'display-buffer-alist' , e.g. (window-height . no-fit-window) to override (window-height . fit-window-to-buffer) This requires that more commands should use this alist in their 'display-buffer' calls instead of directly calling 'shrink-window-if-larger-than-buffer'. Do you think this is feasible? If not, then maybe these commands should provide post-display hooks such as e.g. 'proced-post-display-hook' where 'fit-window-to-buffer' is added by default, but can be removed by customization.