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.devel Subject: Re: display-buffer and temp-buffer-resize-mode Date: Wed, 16 Feb 2022 20:38:43 +0200 Organization: LINKOV.NET Message-ID: <86leyay7v0.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34349"; 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: emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 16 19:49:57 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nKPNE-0008jU-9T for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Feb 2022 19:49:56 +0100 Original-Received: from localhost ([::1]:38102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKPNC-0006RA-OD for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Feb 2022 13:49:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKPIP-0003zU-CA for emacs-devel@gnu.org; Wed, 16 Feb 2022 13:44:57 -0500 Original-Received: from [2001:4b98:dc4:8::231] (port=60455 helo=relay11.mail.gandi.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKPIM-0003i1-Ps for emacs-devel@gnu.org; Wed, 16 Feb 2022 13:44:56 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 76282100004; Wed, 16 Feb 2022 18:44:51 +0000 (UTC) In-Reply-To: (martin rudalics's message of "Wed, 16 Feb 2022 18:52:44 +0100") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:4b98:dc4:8::231 (failed) Received-SPF: pass client-ip=2001:4b98:dc4:8::231; envelope-from=juri@linkov.net; helo=relay11.mail.gandi.net X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286400 Archived-At: > There are numerous ways to fix that, all requiring some sort of surgery: > > - We could simply document the current behavior. This means that for > using 'display-buffer-in-direction' as helper function for say > 'display-buffer-at-bottom' we would have to append an extra > (window-height . nil) alist entry in order to suppress the resizing > ('display-buffer-at-bottom' currently does not suffer from that > syndrome). Shouldn't both 'display-buffer-in-direction (direction . bottom)' and 'display-buffer-at-bottom' be consistent with each other in regard to resizing, and either both resize or not? Even this comment says they should have the same implementation: ;; This should be rewritten as ;; (display-buffer-in-direction buffer (cons '(direction . bottom) alist)) (defun display-buffer-at-bottom (buffer alist) > - We could inhibit the resizing. This would require a slight amendment > in the call in 're-builder' - all other calls in our code base provide > an extra 'window-height' alist entry. Nevertheless, it would be an > incompatible change of, admittedly undocumented, behavior. (Note that > for 'display-buffer--maybe-at-bottom' we would then have to fix > 'hack-local-variables-confirm'.) Also I found 'ediff-setup-windows-plain-compare' where 'display-buffer-in-direction' is without explicit 'window-height'. But the decision whether to resize or not could depend on statistics: if the majority of uses prefer resizing, then resize by default. > - We could try to refine the snippet above in some way. For example, > ask for 'resize-temp-buffer-window' only if the buffer to be displayed > is "temporary". That's a bit tricky because 'temp-buffer-resize-mode' > is a global mode and that variable does not allow to tell whether the > buffer to display is temporary at all. In either case, the > 'fit-window-to-buffer' entry would have to be dropped and we still > have an incompatible change. Another variant is to treat synonyms differently where e.g. '(direction . bottom)' will resize, but '(direction . below) won't.