From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#39822: 27.0.90; Cannot set *Completions* buffer height using display-buffer-alist Date: Fri, 13 Mar 2020 00:54:35 +0200 Organization: LINKOV.NET Message-ID: <87pndhjiac.fsf@mail.linkov.net> 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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="76569"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Davor Rotim , 39822@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 12 23:59:13 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 1jCWnI-000JoB-I2 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Mar 2020 23:59:12 +0100 Original-Received: from localhost ([::1]:51518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCWnH-0004P8-Kc for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Mar 2020 18:59:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33470) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCWn9-0004Oo-W4 for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2020 18:59:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCWn8-0003Xi-RO for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2020 18:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCWn7-0003Wr-Vj for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2020 18:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jCWn7-0005XF-Pn for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2020 18:59: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: Thu, 12 Mar 2020 22:59: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.158405391421237 (code B ref 39822); Thu, 12 Mar 2020 22:59:01 +0000 Original-Received: (at 39822) by debbugs.gnu.org; 12 Mar 2020 22:58:34 +0000 Original-Received: from localhost ([127.0.0.1]:57927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCWmg-0005WR-1w for submit@debbugs.gnu.org; Thu, 12 Mar 2020 18:58:34 -0400 Original-Received: from antelope.elm.relay.mailchannels.net ([23.83.212.4]:26603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCWmd-0005WF-Gv for 39822@debbugs.gnu.org; Thu, 12 Mar 2020 18:58:32 -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 E7523360585; Thu, 12 Mar 2020 22:58:29 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a79.g.dreamhost.com (100-96-13-25.trex.outbound.svc.cluster.local [100.96.13.25]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7090A3605B6; Thu, 12 Mar 2020 22:58:29 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a79.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.18.5); Thu, 12 Mar 2020 22:58:29 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Abiding-Trouble: 2425bd6140fc80a2_1584053909697_2831016892 X-MC-Loop-Signature: 1584053909697:2282708958 X-MC-Ingress-Time: 1584053909697 Original-Received: from pdx1-sub0-mail-a79.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a79.g.dreamhost.com (Postfix) with ESMTP id 9C58B83EDC; Thu, 12 Mar 2020 15:58:28 -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=6j1UnEM82nldvpoyMjwJTVj00uk=; b= LcgS7JDGbVcyCV1pJBMePRPB79BUjjnhUN6QLI6T4MxMop3nmu+wX1xh9wD5GCek kST+Bx4jESEaX9wYgZubtk+4ZvmU2AbtyMVE8+pPfAu5YK3cOA5Qs6q53FN8kmpc SFFPEX9LiYH6XlGHcmZDVI2Vg1L2MnK28Zg/LWkWmhs= Original-Received: from mail.jurta.org (m91-129-107-65.cust.tele2.ee [91.129.107.65]) (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-a79.g.dreamhost.com (Postfix) with ESMTPSA id 92E3C83ECD; Thu, 12 Mar 2020 15:58:25 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a79 In-Reply-To: <1a051c61-8522-1932-8600-e220f19105df@gmx.at> (martin rudalics's message of "Mon, 9 Mar 2020 10:02:48 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedruddviedgtdefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrdeiheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrieehpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrth 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:177237 Archived-At: --=-=-= Content-Type: text/plain >> It seems better to handle the temp-buffer setup in the buffer display action >> functions (currently there are two such functions that handle temp-buffer: >> 'display-buffer--maybe-at-bottom' and 'display-buffer-in-direction'), >> if this will help to get rid of monstrous macro 'with-displayed-buffer-window'. > > Then go for it. Here is the first step, this patch seems to keep the original behavior, but I need your help to finish it. Could you confirm that calls of window-preserve-size at the end of with-displayed-buffer-window are not needed anymore after this patch is applied, because there are the same calls of window-preserve-size at the end of window--display-buffer that are called later after buffer contents is filled by after-display-function in the middle of window--display-buffer: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=after-display-function.patch diff --git a/lisp/window.el b/lisp/window.el index fc1e7d4a76..5be9d0ee83 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7052,6 +7052,11 @@ window--display-buffer (set-window-dedicated-p window display-buffer-mark-dedicated)))) (when (memq type '(window frame tab)) (set-window-prev-buffers window nil)) + + ;; Is this the right place to call former body of with-displayed-buffer-window? + (when (functionp (cdr (assq 'after-display-function alist))) + (funcall (cdr (assq 'after-display-function alist)))) + (let ((quit-restore (window-parameter window 'quit-restore)) (height (cdr (assq 'window-height alist))) (width (cdr (assq 'window-width alist))) diff --git a/lisp/dired.el b/lisp/dired.el index a4de51f609..a76d223bed 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3465,23 +3465,28 @@ dired-mark-pop-up (with-displayed-buffer-window buffer (cons 'display-buffer-below-selected - '((window-height . fit-window-to-buffer) - (preserve-size . (nil . t)))) + `((window-height . fit-window-to-buffer) + (preserve-size . (nil . t)) + (after-display-function + . + ;; Handle (t FILE) just like (FILE), here. That value is + ;; used (only in some cases), to mean just one file that was + ;; marked, rather than the current line file. + ,#'(lambda () + (with-current-buffer buffer + (let ((inhibit-read-only t) + (inhibit-modification-hooks t)) + (dired-format-columns-of-files + (if (eq (car files) t) (cdr files) files)) + (remove-text-properties (point-min) (point-max) + '(mouse-face nil help-echo nil)) + (setq tab-line-exclude nil))))))) #'(lambda (window _value) (with-selected-window window (unwind-protect (apply function args) (when (window-live-p window) - (quit-restore-window window 'kill))))) - ;; Handle (t FILE) just like (FILE), here. That value is - ;; used (only in some cases), to mean just one file that was - ;; marked, rather than the current line file. - (with-current-buffer buffer - (dired-format-columns-of-files - (if (eq (car files) t) (cdr files) files)) - (remove-text-properties (point-min) (point-max) - '(mouse-face nil help-echo nil)) - (setq tab-line-exclude nil)))))) + (quit-restore-window window 'kill))))))))) (defun dired-format-columns-of-files (files) (let ((beg (point))) --=-=-=--