From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#35737: xref--original-command Date: Thu, 16 May 2019 00:04:00 +0300 Organization: LINKOV.NET Message-ID: <87tvdvpgzj.fsf@mail.linkov.net> References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="162776"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 35737@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 15 23:55:26 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR1rw-000gBO-JX for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 23:55:25 +0200 Original-Received: from localhost ([127.0.0.1]:43284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR1rv-0005Mc-JX for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 17:55:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR1rj-0005J9-HI for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 17:55:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR1re-0007sB-3j for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 17:55:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hR1rb-0007lo-HP for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 17:55:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hR1rb-0002zN-Er for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 17:55:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2019 21:55:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35737 X-GNU-PR-Package: emacs Original-Received: via spool by 35737-submit@debbugs.gnu.org id=B35737.155795729811460 (code B ref 35737); Wed, 15 May 2019 21:55:03 +0000 Original-Received: (at 35737) by debbugs.gnu.org; 15 May 2019 21:54:58 +0000 Original-Received: from localhost ([127.0.0.1]:53543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR1rV-0002yh-Qx for submit@debbugs.gnu.org; Wed, 15 May 2019 17:54:58 -0400 Original-Received: from golden.birch.relay.mailchannels.net ([23.83.209.73]:26292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR1rS-0002yO-Ew for 35737@debbugs.gnu.org; Wed, 15 May 2019 17:54:55 -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 25E222C2A2E; Wed, 15 May 2019 21:54:53 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a19.g.dreamhost.com (100-96-3-22.trex.outbound.svc.cluster.local [100.96.3.22]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3312C2C28AF; Wed, 15 May 2019 21:54:47 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a19.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.17.2); Wed, 15 May 2019 21:54:53 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Tank-Soft: 623a81cc1a573142_1557957292928_1979705233 X-MC-Loop-Signature: 1557957292928:376968006 X-MC-Ingress-Time: 1557957292927 Original-Received: from pdx1-sub0-mail-a19.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a19.g.dreamhost.com (Postfix) with ESMTP id E8B3B815F2; Wed, 15 May 2019 14:54:41 -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=2kUjtXQ6sxS7uZypIFevJGNO+dY=; b= Cl8miVGmCUDKgz5P57dZ/grVObju6tL6jvJAOhgUu3EYFalamvY6UU0/TPmu/F7D f3wyrPnoluLQXa/8/a8Tb0sf7nGq7PUSnIU6SPETQ6gEJ6qHOsb8or2BEQsyahoq Yvb/oNuYFgV88MeQYPXHn+Uoxp8pVOdAA9f77wj89kU= Original-Received: from mail.jurta.org (m91-129-96-230.cust.tele2.ee [91.129.96.230]) (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-a19.g.dreamhost.com (Postfix) with ESMTPSA id 0D42580AF2; Wed, 15 May 2019 14:54:39 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a19 In-Reply-To: <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> (Dmitry Gutov's message of "Wed, 15 May 2019 04:07:53 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrleelgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuffhomhgrihhnpehsthgrtghkohhvvghrfhhlohifrdgtohhmnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhunecuvehluhhsthgvrhfuihiivgeptd 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159362 Archived-At: >> Remembering the command that created the *xref* buffer >> will allow such customization to treat RET differently, >> i.e. it makes sense for RET to quit the transient xref buffer >> displayed momentarily while navigating code with xref-find-definitions, >> whereas leaving the xref buffer visible while navigating matches >> in the xref buffer created by e.g. project-find-regexp: >> >> (define-key xref--button-map [(control ?m)] >> (lambda () >> (interactive) >> (if (memq xref--original-command '(xref-find-definitions)) >> (call-interactively 'xref-quit-and-goto-xref) >> (call-interactively 'xref-goto-xref)))) > > I'm all for customizability, but as I said in a past discussion on the > subject, I don't think this by itself would be a good default behavior. I don't propose to change its default behavior. Just allowing its customization would be good. > Having two buffers that looks basically the same but react to RET > differently is not great for usability. Using display-buffer-in-direction, they don't look the same: after customization xref-find-definitions can display the xref buffer below, whereas other xref command can display in the side window. >> Better ideas? > > Ideally, the "transient" buffer should look differently from the > "persistent" one. > > To take VS Code as an example (I just to see how it behaves exactly), > a search for references opens search results in the sidebar. Emacs has side windows too. > Whereas for definitions they have both "Go To Definition" and "Peek > Definition". The latter shows the definitions kind of inline, in > a not-exactly-a-popup kind of way > (https://stackoverflow.com/questions/55599177/go-to-definition-in-vscode-preview-window-ruins-the-edito), > and there, if you type RET, that triggers navigation to the selected > definition. "Go To Definition", when there are several definitions, also > switches to "Peek" mode by default. > > Not sure how best to implement this different kind of display in Emacs, but > the idea makes a lot of sense to me. > > In Sublime, IIRC, for this they used the dropdown from their > top-of-the-window command line, the same one that becomes active once one > presses Ctrl-P. We have Completions for the same purpose.