From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33870: 27.0.50; xref-goto-xref not configurable Date: Sun, 06 Jan 2019 01:23:32 +0200 Organization: LINKOV.NET Message-ID: <87r2dq8z9n.fsf@mail.linkov.net> References: <87a7ktqqx7.fsf@mail.linkov.net> <9215183d-0a44-88b5-5b3c-d0da31f749ad@yandex.ru> <878t02egph.fsf@mail.linkov.net> <878t011lch.fsf@mail.linkov.net> <83lg403o9c.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1546731072 13869 195.159.176.226 (5 Jan 2019 23:31:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 5 Jan 2019 23:31:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 33870@debbugs.gnu.org, joaotavora@gmail.com, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 06 00:31:07 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from listsout.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfvPF-0003T0-NL for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jan 2019 00:31:06 +0100 Original-Received: from localhost ([127.0.0.1]:49025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfvRM-0004YN-Bb for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Jan 2019 18:33:16 -0500 Original-Received: from eggsout.gnu.org ([209.51.188.92]:32817 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfvRC-0004Y7-Hp for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:33:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfvR8-0004C6-IJ for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:33:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55220) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gfvR8-0004BK-EO for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gfvR8-0005mp-2t for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Jan 2019 23:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33870 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33870-submit@debbugs.gnu.org id=B33870.154673115622206 (code B ref 33870); Sat, 05 Jan 2019 23:33:02 +0000 Original-Received: (at 33870) by debbugs.gnu.org; 5 Jan 2019 23:32:36 +0000 Original-Received: from localhost ([127.0.0.1]:48128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfvQi-0005m5-Fd for submit@debbugs.gnu.org; Sat, 05 Jan 2019 18:32:36 -0500 Original-Received: from eastern.maple.relay.mailchannels.net ([23.83.214.55]:19425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfvQh-0005ly-7P for 33870@debbugs.gnu.org; Sat, 05 Jan 2019 18:32:35 -0500 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 110435C43FC; Sat, 5 Jan 2019 23:32:34 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (unknown [100.96.19.74]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id A87665C3D5E; Sat, 5 Jan 2019 23:32:33 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sat, 05 Jan 2019 23:32:34 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Bored-Desert: 7194b4e51abd3656_1546731153869_336642120 X-MC-Loop-Signature: 1546731153869:1498097425 X-MC-Ingress-Time: 1546731153868 Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTP id 4FEB2811B1; Sat, 5 Jan 2019 15:32:33 -0800 (PST) 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=qExYnVQaKnM7OTx75eWpzBWU4Yc=; b= irym0zloUd/Bew2M+UogEFhlAdf64W6RiCBWpoSyvktEmhonkkqqkjrH/Y0WpvXw Y0leNWFkLMQhtbGGjgWDNuc0JQaJdHjnJyYW00KYASq69LedwVd9sLmwxyvKkB7v EdghNibdfVrtNTSQOCBxBFo1wdmrfImjYpuXwJCI3x0= Original-Received: from mail.jurta.org (m91-129-109-141.cust.tele2.ee [91.129.109.141]) (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-a35.g.dreamhost.com (Postfix) with ESMTPSA id 2942E7F5B7; Sat, 5 Jan 2019 15:32:22 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a35 In-Reply-To: <83lg403o9c.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Jan 2019 08:55:43 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrvdeggdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtledrudegudenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrddugedupdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd 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: 208.118.235.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:154175 Archived-At: --=-=-= Content-Type: text/plain >> when xref-find-definitions pops up the xref window, usually it >> contains just 2 lines taking half of the screen where most space is >> uselessly empty. > > We have fit-window-to-buffer for these situations. > >> The distinction between internal and public window functions is quite fuzzy. > > To my mind, internal functions shouldn't be used outside of the file > that defines them. This patch addresses all these concerns. display-buffer--maybe-at-bottom can be renamed to display-buffer-maybe-at-bottom without a deprecation alias because it was added in Emacs 27. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=display-bufffer.patch diff --git a/lisp/window.el b/lisp/window.el index 37d82c060c..015933839d 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7457,6 +7457,21 @@ display-buffer-in-child-frame (unless (cdr (assq 'inhibit-switch-frame alist)) (window--maybe-raise-frame frame))))) +(defun display-buffer-maybe-below-selected (buffer alist) + ;; This is a copy of `display-buffer-fallback-action' + ;; where `display-buffer-use-some-window' is replaced + ;; with `display-buffer-below-selected'. + (let ((alist (append alist `(,(if temp-buffer-resize-mode + '(window-height . resize-temp-buffer-window) + '(window-height . fit-window-to-buffer)) + ,(when temp-buffer-resize-mode + '(preserve-size . (nil . t))))))) + (or (display-buffer--maybe-same-window buffer alist) + (display-buffer-reuse-window buffer alist) + (display-buffer--maybe-pop-up-frame buffer alist) + (display-buffer-in-previous-window buffer alist) + (display-buffer-below-selected buffer alist)))) + (defun display-buffer-below-selected (buffer alist) "Try displaying BUFFER in a window below the selected window. If there is a window below the selected one and that window @@ -7503,7 +7518,10 @@ display-buffer-below-selected (window--display-buffer buffer window 'reuse alist display-buffer-mark-dedicated))))) -(defun display-buffer--maybe-at-bottom (buffer alist) +(defun display-buffer-maybe-at-bottom (buffer alist) + ;; This is a copy of `display-buffer-fallback-action' + ;; where `display-buffer-use-some-window' is replaced + ;; with `display-buffer-at-bottom'. (let ((alist (append alist `(,(if temp-buffer-resize-mode '(window-height . resize-temp-buffer-window) '(window-height . fit-window-to-buffer)) @@ -7512,6 +7530,7 @@ display-buffer--maybe-at-bottom (or (display-buffer--maybe-same-window buffer alist) (display-buffer-reuse-window buffer alist) (display-buffer--maybe-pop-up-frame buffer alist) + (display-buffer-in-previous-window buffer alist) (display-buffer-at-bottom buffer alist)))) (defun display-buffer-at-bottom (buffer alist) diff --git a/lisp/files.el b/lisp/files.el index 6ccb001e35..0741dbc19e 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3396,7 +3396,7 @@ hack-local-variables-confirm ;; Display the buffer and read a choice. (save-window-excursion - (pop-to-buffer buf '(display-buffer--maybe-at-bottom)) + (pop-to-buffer buf '(display-buffer-maybe-at-bottom)) (let* ((exit-chars '(?y ?n ?\s ?\C-g ?\C-v)) (prompt (format "Please type %s%s: " (if offer-save "y, n, or !" "y or n") @@ -7053,7 +7053,9 @@ save-buffers-kill-emacs (or (not active) (with-displayed-buffer-window (get-buffer-create "*Process List*") - '(display-buffer--maybe-at-bottom) + '(display-buffer-maybe-at-bottom + (window-height . fit-window-to-buffer) + (preserve-size nil . t)) #'(lambda (window _value) (with-selected-window window (unwind-protect diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 5760a2e49d..7dede4e616 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1828,18 +1828,12 @@ minibuffer-completion-help (display-buffer-mark-dedicated 'soft)) (with-displayed-buffer-window "*Completions*" - ;; This is a copy of `display-buffer-fallback-action' - ;; where `display-buffer-use-some-window' is replaced - ;; with `display-buffer-at-bottom'. - `((display-buffer--maybe-same-window - display-buffer-reuse-window - display-buffer--maybe-pop-up-frame - ;; Use `display-buffer-below-selected' for inline completions, - ;; but not in the minibuffer (e.g. in `eval-expression') - ;; for which `display-buffer-at-bottom' is used. - ,(if (eq (selected-window) (minibuffer-window)) - 'display-buffer-at-bottom - 'display-buffer-below-selected)) + ;; Use `display-buffer-maybe-below-selected' for inline completions, + ;; but not in the minibuffer (e.g. in `eval-expression') + ;; for which `display-buffer-maybe-at-bottom' is used. + `((,(if (eq (selected-window) (minibuffer-window)) + 'display-buffer-maybe-at-bottom + 'display-buffer-maybe-below-selected)) ,(if temp-buffer-resize-mode '(window-height . resize-temp-buffer-window) '(window-height . fit-window-to-buffer)) --=-=-=--