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#33992: 27.0.50; xref-find-definitions wastes too much space Date: Sun, 06 Jan 2019 01:43:35 +0200 Organization: LINKOV.NET Message-ID: <87muoe7jrs.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1546732148 28280 195.159.176.226 (5 Jan 2019 23:49:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 5 Jan 2019 23:49:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: =?UTF-8?Q?jo=C3=A3o_?= =?UTF-8?Q?t=C3=A1vora?= , dmitry gutov To: 33992@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 06 00:49:04 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 1gfvgc-0007Fo-8o for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jan 2019 00:49:02 +0100 Original-Received: from localhost ([127.0.0.1]:54460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfvij-0007eL-6H for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Jan 2019 18:51:13 -0500 Original-Received: from eggsout.gnu.org ([209.51.188.92]:36345 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfvic-0007eF-W6 for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:51:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfviZ-0006JM-EF for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:51:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39724) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gfviZ-0006IW-9i for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:51:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gfviY-0006Gs-1X; Sat, 05 Jan 2019 18:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: joaotavora@gmail.com, dgutov@yandex.ru, bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Jan 2019 23:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33992 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: =?UTF-8?Q?jo=C3=A3o_?= =?UTF-8?Q?t=C3=A1vora?= , dmitry gutov Original-Received: via spool by submit@debbugs.gnu.org id=B.154673223724066 (code B ref -1); Sat, 05 Jan 2019 23:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jan 2019 23:50:37 +0000 Original-Received: from localhost ([127.0.0.1]:48135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfvi8-0006G6-It for submit@debbugs.gnu.org; Sat, 05 Jan 2019 18:50:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfvi4-0006Fv-EV for submit@debbugs.gnu.org; Sat, 05 Jan 2019 18:50:33 -0500 Original-Received: from listsout.gnu.org ([208.118.235.17]:33860) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfvi4-0005kr-1K for submit@debbugs.gnu.org; Sat, 05 Jan 2019 18:50:32 -0500 Original-Received: from eggsout.gnu.org ([209.51.188.92]:36076 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfvi3-0007T9-2I for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:50:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfvhz-0005gN-DJ for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:50:30 -0500 Original-Received: from golden.birch.relay.mailchannels.net ([23.83.209.73]:25983) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfvhx-0005eJ-R7 for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:50:26 -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 2C3653E403A for ; Sat, 5 Jan 2019 23:50:24 +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 CB7193E419D for ; Sat, 5 Jan 2019 23:50:23 +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:50:24 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Illegal-Power: 309712aa3d530a61_1546732223985_2994925292 X-MC-Loop-Signature: 1546732223985:337100994 X-MC-Ingress-Time: 1546732223985 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 72685811B1 for ; Sat, 5 Jan 2019 15:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=k8Hd9nVsvMMVleU7zqMWCNX1GfE=; b=RSRYsIvZoIUBCmvij mcBuHC2wIt1nPKfkfgYciZZvsGJaYKOKd6uOpfFb8uFKHjhI+kNx/g+lM8VsgdlW jHKNDAzKjlyvIWVER26DYVznTO7YRWQaSKyPNkR0HQNbCcH7lJ9PKwyOlQB8QH/e pNzmctGfQvx5WmiGu+tIYUod/E= 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 5B4AA7F4DE for ; Sat, 5 Jan 2019 15:50:20 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a35 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrvdeggdduhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofffkfgggtgesmhdtreertderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrddugedunecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrudeguddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:154177 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tags: patch Severity: wishlist X-Debbugs-CC: Jo=C3=A3o T=C3=A1vora , Dmitry Gutov = As noted in bug#33870 the buffer produced by xref-find-definitions (bound to =E2=80=98M-.=E2=80=99) has a transient nature like the *Complet= ions* buffer. Therefore it makes sense not to waste its space needlessly: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=display-action-alist.patch diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 87ce2299c5..169f49a348 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -782,7 +773,7 @@ xref--show-xref-buffer (erase-buffer) (xref--insert-xrefs xref-alist) (xref--xref-buffer-mode) - (pop-to-buffer (current-buffer)) + (pop-to-buffer (current-buffer) (assoc-default 'display-action-alist alist)) (goto-char (point-min)) (setq xref--original-window (assoc-default 'window alist) xref--original-window-intent (assoc-default 'display-action alist)) @@ -808,12 +799,15 @@ xref--show-xrefs (cond ((and (not (cdr xrefs)) (not always-show-list)) (xref-push-marker-stack) - (xref--pop-to-location (car xrefs) display-action)) + (xref--pop-to-location (car xrefs) (unless (listp display-action) display-action))) (t (xref-push-marker-stack) (funcall xref-show-xrefs-function xrefs `((window . ,(selected-window)) - (display-action . ,display-action)))))) + (display-action + . ,(unless (listp display-action) display-action)) + (display-action-alist + . ,(when (listp display-action) display-action))))))) (defun xref--prompt-p (command) (or (eq xref-prompt-for-identifier t) @@ -864,7 +858,7 @@ xref-find-definitions Otherwise, display the list of the possible definitions in a buffer where the user can select from the list." (interactive (list (xref--read-identifier "Find definitions of: "))) - (xref--find-definitions identifier nil)) + (xref--find-definitions identifier '((display-buffer-maybe-below-selected)))) ;;;###autoload (defun xref-find-definitions-other-window (identifier) --=-=-=--