From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#39822: 27.0.90; Cannot set *Completions* buffer height using display-buffer-alist Date: Sun, 15 Mar 2020 18:49:35 +0100 Message-ID: <7581d32e-f8b9-0d66-b496-b2584ffb65be@gmx.at> References: <87k146q02n.fsf@firemail.cc> <87ftet76tv.fsf@firemail.cc> <21d2102d-367b-54da-33c5-1ae1ac579bd9@gmx.at> <87imjpw3wx.fsf@mail.linkov.net> <87o8tfzmrx.fsf@mail.linkov.net> <43297d89-9e87-0b23-0bca-98b13a27cfe6@gmx.at> <87ftep2h1x.fsf@mail.linkov.net> <87pndrpt8t.fsf@mail.linkov.net> <87o8tawf59.fsf@mail.linkov.net> <1a051c61-8522-1932-8600-e220f19105df@gmx.at> <87pndhjiac.fsf@mail.linkov.net> <8736aaedgb.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="26239"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Davor Rotim , 39822@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 15 18:58:09 2020 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 1jDXWY-0006fN-41 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Mar 2020 18:58:06 +0100 Original-Received: from localhost ([::1]:56528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDXWW-0006ex-OT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Mar 2020 13:58:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48208) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDXOl-0003l1-6A for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2020 13:50:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDXOk-0002tN-1W for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2020 13:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDXOj-0002sA-Sw for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2020 13:50:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jDXOj-00036N-RD for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2020 13:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Mar 2020 17:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39822 X-GNU-PR-Package: emacs Original-Received: via spool by 39822-submit@debbugs.gnu.org id=B39822.158429458811892 (code B ref 39822); Sun, 15 Mar 2020 17:50:01 +0000 Original-Received: (at 39822) by debbugs.gnu.org; 15 Mar 2020 17:49:48 +0000 Original-Received: from localhost ([127.0.0.1]:35480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDXOW-00035k-JB for submit@debbugs.gnu.org; Sun, 15 Mar 2020 13:49:48 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:59477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDXOU-00035R-Oi for 39822@debbugs.gnu.org; Sun, 15 Mar 2020 13:49:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1584294577; bh=M8ooXVqQHq12fPwhoiDP8QmyCdnbMz8vnhx5ZZXf9ik=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=QeDoeLw1LWckuywRNTV6rw4ufau+6FgVu3akdXu/FxcNBATVr+pI/OdUFnI7AjJpC kf8n+xQ6NSim61/GZZX+n9fxhwzOfeCGVmS0tf3QWQwGAISDE4B5xGeoL6T/mZJ2GC Ruy+R99L5SSwUOY7sZKYVrFQaFyin6RtCrYo5dGw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.103] ([212.95.7.232]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MEFvp-1j3ssG1gV3-00ACwd; Sun, 15 Mar 2020 18:49:37 +0100 In-Reply-To: <8736aaedgb.fsf@mail.linkov.net> Content-Language: en-US X-Provags-ID: V03:K1:rdQQAqMW18pxNAAATvUYrvy0WF/CKW5BQvWdpLu0e1ygLSGhHSq nk3b5+H6gnRcG7kfqysrPvuSbplLXA19oPtus7pYS677tmf6K9tK2aH+3Tw9XrfDOuuTzlT VRkVKqoTWUPwcYewpiYIRKOU0KapNA+01ZveMCwlgSBjkzQGKHyfc27SXpXYC1fpm7ofEU1 xnbL+BUA+ukLGU98FrYIQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:vFJ7ulWVXIQ=:fPQmC3LpYDuhqWxb8T/2Ms PIMyixKzGdGpjYsU/D47vUvLqMYjL4kXMGDvlYPLe+t7WpqzF92yPXeKf5tO0x1GHXW6NMxR4 /zZYR//Yi3eqL62SlQx44/0P6KJvGxDYaJ5Z7qoBal6hIde6JGY+lQHHVnz1LdD6JJsYH5hCb jbOS2aEr+cl2TSO2P5AG7pvb95kboerGDz22tLTRL05A0kqximeRHsXJ0mPw9wIUPimSMm/Q2 qh0Z7oq0myX/Y01MDMBW8kmiVTvmzX+LI8N6bqSLHevpjC/sSUHihrR2+2AuouY0bRN/85h4g Y7u7yGnCiyGFD/tSkADxfFc3CKznk3q4l1lAmSGgYEqseGNwrG/mohrJ32O7OsPkTeyLRkDvw R7JrgI0X4IYs7QKxlBWJ1tr4c4Lt3e144OA/DhQofXiZeftJNi+9o2J0s3xOfpmxmf93K9qc5 8x+4xT0eNj2wWItx7JfoCPKCawq2baCbYzxG3FuvQIR8qehPswf+EQ0L+XhUa0NkjU5UjV6yl kWSQZSjyLJmPXO782PUn70idttd5WVk06umox4paQFqHBckgae9shhyI3pCU+hrefT8mD/db6 MH69UHsmeM3FT3A2EGejElyPrtmOVTu4by1ZLSBXtpwSo3AY0I6svQGrCvW+UHVaSS1mkaMw3 ndTwKFkLH/DbPW3u15uw0w+yjtNsxQsTUpQ2/Tj7TWXHY0+mQhYtFcBNX5FPt9QOQEoVqKpy7 8p4E/HQfdesxf84sa22/R4Zxhu1DFxXhho2ki+CcOSctco7O/eoWMQQhcoY9crOZhI78de/f 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177384 Archived-At: > These calls should remain in 'window--display-buffer' to adjust the > window height afterwards. Yes. >> But what if a function like 'dired-format-columns-of-files' wanted to >> >> (1) know the width of the window used for displaying the buffer, > > 'dired-format-columns-of-files' is called when the window > is already displayed, so it can find the width of the window, > and it uses 'completion--insert-strings' for that, see below. Does it know the window for sure? Always think of the case where the buffer is already displayed in some other window. >> (2) according to that (presumably fixed) width adjust columns, establish >> a maximum width of buffer lines or do something else width related, > > Same as above. > >> (3) leave it to 'window--display-buffer' to adjust the window height >> afterwards? > > It already allows 'window--display-buffer' to adjust the window height > afterwards in the previous patch. > >> And be able to do (1)-(3) in the orthogonal direction, that is, base (2) >> on a presumably fixed window height? > > You mean to not allow adjusting the window height afterwards? > Then the call of 'display-buffer' should be without alist entries > 'window-height' and 'preserve-size'. We have to be always prepared for the case that a split happens in the orthogonal direction. > The current implementation doesn't supply the window, and > 'dired-format-columns-of-files' and 'minibuffer-completion-help' > use 'completion--insert-strings': > > (window (get-buffer-window (current-buffer) 0)) That's precisely what I'm afraid of (and it happens in a dozen other cases in our code base as well, IIRC). Better make sure now that we always act on the window returned by 'display-buffer'. > (wwidth (if window (1- (window-width window)) 79)) > > Do you propose to rewrite 'completion--insert-strings' for accept a new > argument 'window'? Or to rely on the fact that the displayed window should > be already selected by its caller? Will this break backward-compatibility > for packages that use it? Maybe it's overkill but I'd give 'completion--insert-strings' an additional window argument. martin