From unknown Sun Jun 22 17:11:32 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#35737 <35737@debbugs.gnu.org> To: bug#35737 <35737@debbugs.gnu.org> Subject: Status: xref--original-command Reply-To: bug#35737 <35737@debbugs.gnu.org> Date: Mon, 23 Jun 2025 00:11:32 +0000 retitle 35737 xref--original-command reassign 35737 emacs submitter 35737 Juri Linkov severity 35737 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 14 16:57:52 2019 Received: (at submit) by debbugs.gnu.org; 14 May 2019 20:57:52 +0000 Received: from localhost ([127.0.0.1]:50015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQeUi-0005Fn-B0 for submit@debbugs.gnu.org; Tue, 14 May 2019 16:57:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQeUg-0005Fa-FE for submit@debbugs.gnu.org; Tue, 14 May 2019 16:57:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:48341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQeUb-0004Ds-94 for submit@debbugs.gnu.org; Tue, 14 May 2019 16:57:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQeUa-0007X1-7s for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:57:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQeRi-0001uo-70 for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:54:47 -0400 Received: from bird.maple.relay.mailchannels.net ([23.83.214.17]:47929) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQeRh-0001rN-Qu for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:54:46 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EB4CE8C1AFD for ; Tue, 14 May 2019 20:54:43 +0000 (UTC) Received: from pdx1-sub0-mail-a88.g.dreamhost.com (100-96-5-25.trex.outbound.svc.cluster.local [100.96.5.25]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 551F18C15ED for ; Tue, 14 May 2019 20:54:43 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a88.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); Tue, 14 May 2019 20:54:43 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Robust-Hook: 3099d58977b96908_1557867283785_4173052338 X-MC-Loop-Signature: 1557867283784:3246773636 X-MC-Ingress-Time: 1557867283784 Received: from pdx1-sub0-mail-a88.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a88.g.dreamhost.com (Postfix) with ESMTP id 13B04806DC for ; Tue, 14 May 2019 13:54:39 -0700 (PDT) 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=3OryTe5ZuVnbm2SiFZHlyGUjHKY=; b=JHCsRyd0JdDPV1mR7 IikG/bTtgm8h8+cTPpCXgUeBhCE3ZTIpobuZKMtauVTHL2E44d4pwzAUN7TIuodD OD/Aqiuid1M301r0QStYltgvTq0vaKC3s2/D1Zs71wJRgy2QZdE/ITaWpreEOAZ8 CH8SYM3CfFIpifzfDkpgZtkLbY= 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-a88.g.dreamhost.com (Postfix) with ESMTPSA id E763B806D2 for ; Tue, 14 May 2019 13:54:37 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a88 From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: xref--original-command Organization: LINKOV.NET Date: Tue, 14 May 2019 23:53:42 +0300 Message-ID: <87ftpgu59l.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrleeigdduheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.17 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 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)))) Better ideas? diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index bf999aeb0d..5c38cac164 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -477,6 +477,9 @@ xref--original-window-intent (defvar-local xref--original-window nil "The original window this xref buffer was created from.") +(defvar-local xref--original-command nil + "The original command that created this xref buffer.") + (defun xref--show-pos-in-buf (pos buf) "Goto and display position POS of buffer BUF in a window. Honor `xref--original-window-intent', run `xref-after-jump-hook' @@ -777,7 +788,8 @@ xref--analyze (pop-to-buffer (current-buffer)) (goto-char (point-min)) (setq xref--original-window (assoc-default 'window alist) - xref--original-window-intent (assoc-default 'display-action alist)) + xref--original-window-intent (assoc-default 'display-action alist) + xref--original-command this-command) (current-buffer))))) From debbugs-submit-bounces@debbugs.gnu.org Tue May 14 21:08:06 2019 Received: (at 35737) by debbugs.gnu.org; 15 May 2019 01:08:06 +0000 Received: from localhost ([127.0.0.1]:50460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQiOs-0005Xs-8o for submit@debbugs.gnu.org; Tue, 14 May 2019 21:08:06 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQiOp-0005XK-RG for 35737@debbugs.gnu.org; Tue, 14 May 2019 21:08:05 -0400 Received: by mail-lj1-f196.google.com with SMTP id h21so891306ljk.13 for <35737@debbugs.gnu.org>; Tue, 14 May 2019 18:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VnpFUbsAiO9LS+jnFs3pXOSnlDVgNK0ExQa6Pj37pU4=; b=Z8sY233GRvJOjxA1pL6KpXO1W6W87Om6I9W2hsUIC2uGjj1GVB5jAo6jstcfuEkWaC SfasOtq4o2pIL3vwyL2VaIHHf+Nby7WJ84leoL8rON5awndqVAh4HJWpK8lbpWnfMsq5 X9QmA3DWYYFW4gB9yDdpPdV0ZKfnczg3tnk5zQOCwoZmjCRIExw+T/7/8YwGhY2dHBJ1 iTbujbcUvOlO5XxbXUMJylA08jyQj9ZJZdCAmRJY+kLlw9XpoicoPbAIOZvXDQ1Vc7Lf vq47zQK7bMlQnaj5Ik/aqrt216XArHeGgCOqr+oxtzEBZXpRBW2rB1hMUc8sd7P8MJ4m NORg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VnpFUbsAiO9LS+jnFs3pXOSnlDVgNK0ExQa6Pj37pU4=; b=jrHjHixsWQ20NbqePQ2eCjf/meTNxz4gqh7mCtMEQIGJuMEKPI4pfe0+hBm5FytXuy /zSSZootZ6jTeQCXpn/tZQmVTdjBFdK5LHtZfMzlcGyWtaLYACewPc0o+TFPRA/TiB+v 8Fn7OZAH+vSoR40lJvSMkni95HAPT7mx6SaII6oyVFnnbecDeWSbtTIxfZXpWu150/5o Vs6YlAOLHwpUaf7VgeQNStqtIHXx6TIscpTSHw2xw8lx/93+kCNqqMxIWpNa+cDJVGPn KJxq0tVMuCR49sIuxFXbEUPDaIAdejBLxLgb1WEs2VX1NerwxOcUR2wCZsmEmfbAs3Ct 7cCA== X-Gm-Message-State: APjAAAV/SQmM4yGpzU9Ig4FnBBZzIFuGJ41UL68gq53YRR0Do9IO5PsP K/X1xu6gIJQ9TGorZsjP10AeZmYJ X-Google-Smtp-Source: APXvYqxkaW9Af2tW2Yy6I8TplhiO07b2uDQ2yqWDwsa7bzaD6UAcimWiyaRE2NfZ4laKDTw3LA4cqA== X-Received: by 2002:a2e:9e96:: with SMTP id f22mr12197125ljk.141.1557882477489; Tue, 14 May 2019 18:07:57 -0700 (PDT) Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id f189sm80837lfe.66.2019.05.14.18.07.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 18:07:56 -0700 (PDT) Subject: Re: bug#35737: xref--original-command To: Juri Linkov , 35737@debbugs.gnu.org References: <87ftpgu59l.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> Date: Wed, 15 May 2019 04:07:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <87ftpgu59l.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35737 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 14.05.2019 23:53, Juri Linkov wrote: > 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. Having two buffers that looks basically the same but react to RET differently is not great for usability. > 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. 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. > diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el > index bf999aeb0d..5c38cac164 100644 > --- a/lisp/progmodes/xref.el > +++ b/lisp/progmodes/xref.el > @@ -477,6 +477,9 @@ xref--original-window-intent > (defvar-local xref--original-window nil > "The original window this xref buffer was created from.") > > +(defvar-local xref--original-command nil > + "The original command that created this xref buffer.") > + > (defun xref--show-pos-in-buf (pos buf) > "Goto and display position POS of buffer BUF in a window. > Honor `xref--original-window-intent', run `xref-after-jump-hook' > @@ -777,7 +788,8 @@ xref--analyze > (pop-to-buffer (current-buffer)) > (goto-char (point-min)) > (setq xref--original-window (assoc-default 'window alist) > - xref--original-window-intent (assoc-default 'display-action alist)) > + xref--original-window-intent (assoc-default 'display-action alist) > + xref--original-command this-command) > (current-buffer))))) I'm good with this patch, though, if you find it helpful for personal customization. When we implement two different display strategies, though, we might choose between them inside xref--show-xrefs straight away, instead of saving the original command for later. From debbugs-submit-bounces@debbugs.gnu.org Wed May 15 17:54:58 2019 Received: (at 35737) by debbugs.gnu.org; 15 May 2019 21:54:58 +0000 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 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 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) 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 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 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= 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 From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#35737: xref--original-command Organization: LINKOV.NET References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> Date: Thu, 16 May 2019 00:04:00 +0300 In-Reply-To: <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> (Dmitry Gutov's message of "Wed, 15 May 2019 04:07:53 +0300") Message-ID: <87tvdvpgzj.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrleelgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuffhomhgrihhnpehsthgrtghkohhvvghrfhhlohifrdgtohhmnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhunecuvehluhhsthgvrhfuihiivgeptd X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> 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. From debbugs-submit-bounces@debbugs.gnu.org Wed May 15 18:30:33 2019 Received: (at 35737) by debbugs.gnu.org; 15 May 2019 22:30:33 +0000 Received: from localhost ([127.0.0.1]:53579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR2Pw-0003vS-Oj for submit@debbugs.gnu.org; Wed, 15 May 2019 18:30:33 -0400 Received: from mail-wm1-f44.google.com ([209.85.128.44]:53985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR2Pv-0003vE-C5 for 35737@debbugs.gnu.org; Wed, 15 May 2019 18:30:31 -0400 Received: by mail-wm1-f44.google.com with SMTP id 198so1574474wme.3 for <35737@debbugs.gnu.org>; Wed, 15 May 2019 15:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cvSvguTtMMcDl3h28V8ZOfrkpVs2fM0i/p6V5ZZuoEU=; b=t1KrUPUEXw07rtsB/WwLmGDIx29ext9C6LSCSnEYlKh3Jbv5WTU4V8mH0CaHTvTUFJ 19s1c9R1Y5qPDAQ9gUBxwjwWRp+sTMmGEfMWxIx31mSrvM5V6qHuOpnyHBo11tEIlnYN lYi6zW4SgPH14a4NFukAv0NwJVX+cIaGa5TX+6ktnN4jiyIzAcbhVfWXuLBMr8tR6VEN bwh/ODHNXk+xmgoSRt4PdyprwkYQTVw6nSMQiexSzhK0XtMmpQrOnUDUCeaR8VBpvFAU mmyBb+QxLoNDWKdv42pp+mojdZOhfhnbubha2ZOoeTJCYkUEk27op1OOEvHAAsowJPMt /K5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cvSvguTtMMcDl3h28V8ZOfrkpVs2fM0i/p6V5ZZuoEU=; b=nET6vj/QsL6rc/Qr7D7MvaFzNY8PlH8989cJ11NxMxWjasr7rmmfAyI+YM4i4/VNEQ N9i4PKFIjyWc0P2fokNuekT/EpYLZVm2VPnY+rYX9hKRO3db8OxJIDP8B5lvEpb16wNV aBvi2+VQDAEcm5oMnhMV/TLNQvd/rSX25+I4yKRDCAGTJ4csh0WOM5n3V0XuJ5YGDK2m y1/XTVDnFKAWoOaPSkxby8wb/iKOhno9nS8EEuvw62/SLUawZtROVgwCWkk/nPL1RZT+ b8UgeCbw6Y3WCYCHzxwR04xvTb5xt+GIhkpynGXkdv/ILTDVZ04JzxB96g0/tVWY58rx mYxA== X-Gm-Message-State: APjAAAWthkqqqGEd/DLQkjpuQphhw7MkTdxyyHzv0nEdlA9i6Q5llzry MTVSFWyz68QU6qqWvaY86W2S4H0I X-Google-Smtp-Source: APXvYqy8RoDbHwEJHyidirxKdAAgn9putBeFqEBjQ/yYZO7onpHgrEWr5QkwNvqlcp3dDwQXVzhKGA== X-Received: by 2002:a1c:e90f:: with SMTP id q15mr26005926wmc.1.1557959425055; Wed, 15 May 2019 15:30:25 -0700 (PDT) Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id y7sm7246056wrg.45.2019.05.15.15.30.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 15:30:24 -0700 (PDT) Subject: Re: bug#35737: xref--original-command To: Juri Linkov References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: Date: Thu, 16 May 2019 01:30:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <87tvdvpgzj.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 16.05.2019 0:04, Juri Linkov wrote: > I don't propose to change its default behavior. Just allowing its > customization would be good. OK. But please wait a little, I'd like to show a patch for bug#35702 that can also provide a basic for the same distinction in functionality but without this variable. >> 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. OK. Still look very similar, but at least the behavior appears different from the outset. If you look at Atom's behavior, it actually shows regexp search results in a pane below the main area. The same direction where you want to show the definitions search result. Just something to keep in mind. >> 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. You mean like Speedbar? That's the part which I didn't exactly like. >> 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. BTW, there's a third-party package that implements something like that for LSP users: https://github.com/emacs-lsp/lsp-ui#lsp-ui-peek Not sure how likely we are to have this contributed to the core, though. >> 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. Except we have a UI for it which is expected to be usable without using arrow keys. And the completion entries in this case can contain spaces, parens, and basically any other characters. They can also be fairly long. So completing-read doesn't seem to fit the bill. I'm open to ideas. From debbugs-submit-bounces@debbugs.gnu.org Thu May 16 16:37:53 2019 Received: (at 35737) by debbugs.gnu.org; 16 May 2019 20:37:53 +0000 Received: from localhost ([127.0.0.1]:56582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRN8T-0003Q9-CL for submit@debbugs.gnu.org; Thu, 16 May 2019 16:37:53 -0400 Received: from bisque.maple.relay.mailchannels.net ([23.83.214.18]:20422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRN8P-0003Pp-1Z for 35737@debbugs.gnu.org; Thu, 16 May 2019 16:37:51 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A06D750138B; Thu, 16 May 2019 20:17:24 +0000 (UTC) Received: from pdx1-sub0-mail-a63.g.dreamhost.com (100-96-38-7.trex.outbound.svc.cluster.local [100.96.38.7]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E35F150128F; Thu, 16 May 2019 20:17:23 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a63.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); Thu, 16 May 2019 20:17:24 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Macabre-Continue: 3a4f4d154b817a5d_1558037844482_3749957226 X-MC-Loop-Signature: 1558037844482:296445722 X-MC-Ingress-Time: 1558037844482 Received: from pdx1-sub0-mail-a63.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a63.g.dreamhost.com (Postfix) with ESMTP id 2F72A83566; Thu, 16 May 2019 13:17:19 -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=Pxs4wpIRP9NWq/AEH29/oxkdpl4=; b= T4b7j7TX3Qica3Y2o9A7icEHIhkp4uFObdkRCwoPwerH45z8R0gO6Q6eqzUX6Ffg KwZ9tNzFMZfpEZuF6hYjw8kUMRJPbjr+/kOXdtj7NAJm1UKgF9UWaGLTSaM0k/9C 7oTxJumRgEnjcw/6Qq0S6g9XftHMQKmA5wPOUO+kJ2I= 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-a63.g.dreamhost.com (Postfix) with ESMTPSA id 104BA83564; Thu, 16 May 2019 13:17:15 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a63 From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#35737: xref--original-command Organization: LINKOV.NET References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> Date: Thu, 16 May 2019 22:58:27 +0300 In-Reply-To: (Dmitry Gutov's message of "Thu, 16 May 2019 01:30:22 +0300") Message-ID: <87woiqkwok.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddruddttddgudeghecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhunecuvehluhhsthgvrhfuihiivgeptd X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > But please wait a little, I'd like to show a patch for bug#35702 that can > also provide a basic for the same distinction in functionality but without > this variable. OK. >> Emacs has side windows too. > > You mean like Speedbar? That's the part which I didn't exactly like. I don't like Speedbar too because it's too intrusive. But maybe it can be rewritten using real side windows as documented in (info "(elisp) Side Windows") From debbugs-submit-bounces@debbugs.gnu.org Fri May 17 14:00:02 2019 Received: (at control) by debbugs.gnu.org; 17 May 2019 18:00:02 +0000 Received: from localhost ([127.0.0.1]:58934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRh9F-0006w2-Lq for submit@debbugs.gnu.org; Fri, 17 May 2019 14:00:01 -0400 Received: from mail-io1-f45.google.com ([209.85.166.45]:39091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRh9E-0006vq-HB for control@debbugs.gnu.org; Fri, 17 May 2019 14:00:00 -0400 Received: by mail-io1-f45.google.com with SMTP id m7so6178223ioa.6 for ; Fri, 17 May 2019 11:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=/f0cyP8uupAUx2chu3puf6OfEtnlorhTr2mdWqzkfbA=; b=KRjZ3UiEC46Vu58vWUR3F6uyrHtPCwMX5RbjyElv0fCLyoJVkU4crpGOrN/V3gq60n +CL4JdLFx6lTERNxd/rDdfIGLKe19NeACW8xkI7CjS6TOoRnpBqr6UEJ+vlBHNVSA47p DOEzZ8G6YYQub7UnQkes2z5pwIMX0oszngzhPSnoO/wctlRIYQtyEexEEKQnKK5P2UUR RIRbVbOrIKf3xkzUFUKlYzboQGZZCGwwROrMhrc11kI2ovw3emGyGPM/6KMULZtOcNUV e/RDj9LpbhR+DONX8quaC7Q0LCORgB3AmEkO5MeejypI1SYEGNdyCppcWbZ+jB3Y9VZ3 OqnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=/f0cyP8uupAUx2chu3puf6OfEtnlorhTr2mdWqzkfbA=; b=SWG+oNg8aFVDVdqSI5P7hWPJn0EBkya1XH++cA+3jAVAOqxowcfUyQo5CqZG19zef5 X0arWrQ9IV09a3fhW7P7WGomIlr5pGcQMrZLOCUhJeABq16DTM0X4Ogmu9NIMbVEdNUU dy0RsviMp6Hw7vqsKNpStbfYu4vDP+2o6Www4KjKhzdOL8+cJIpCJ7kOBCnUtC5QOYgw eLFqtvFqzMw4OPlN4Zrry+rUlBvEdkHD46N5aWctYd9IdJMCwDvFwgODo9IN4h4WMK6v 2UL3GJbSPDbV6uS46s2HbLUp4yTt3NyVdswNo6qsVoivzES3efgML0igFM4O0pysEft8 Q7ZA== X-Gm-Message-State: APjAAAXUxUKgNZGJqZAUcEIX4TVr5NCGHf/X3zYf/3dpnqs9rMUzmtYJ v/UqkkEj1K4EGOeyqdM2LwoI8bJm X-Google-Smtp-Source: APXvYqz6gENbZTjzCoHwRVm8Phi/PWNMMwxcYDnQ7H23EDV3ZHsTKhoHq1ogpoUAPU8V+qSeIxlTQw== X-Received: by 2002:a6b:b2c7:: with SMTP id b190mr31260066iof.14.1558115993618; Fri, 17 May 2019 10:59:53 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id s8sm2900728iot.55.2019.05.17.10.59.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 May 2019 10:59:52 -0700 (PDT) From: npostavs@gmail.com To: control@debbugs.gnu.org Subject: control message for bug #35737 Date: Fri, 17 May 2019 13:59:52 -0400 Message-ID: <85zhnlc67b.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 35737 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Thu May 23 21:59:50 2019 Received: (at 35737) by debbugs.gnu.org; 24 May 2019 01:59:50 +0000 Received: from localhost ([127.0.0.1]:45749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTzUr-0005BS-QO for submit@debbugs.gnu.org; Thu, 23 May 2019 21:59:49 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:36173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTzUq-0005BC-KO for 35737@debbugs.gnu.org; Thu, 23 May 2019 21:59:49 -0400 Received: by mail-wr1-f46.google.com with SMTP id s17so8256365wru.3 for <35737@debbugs.gnu.org>; Thu, 23 May 2019 18:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zMjcQ0OfgyUTRyFYBvi3N5a27FGJ8sH8q5RNs5HfTDE=; b=e7LP0+65SaGDng3K5+RwwtUmYfnnsHwk3YRBcUvLrg2zdbJ0XCa3CtlwDJFGn8cto0 AFye0xpNBKkT2eXU6lFJ3dqtbnGpTI/Qq+/drXFnr+Ig1ts+H/Ouznk/UzFxqdK1rfOI wPXXE1PYrfUmv+8BbCfLyP0XMuaE2iIb4S48prJYP2D6/dJ94VEaMPxsOvpkj3ZGrcZV w78qhedATgqk/E6wnr/YnfGgAtC0+UY/xuXkDeZYcVOi1Z5FualBgl4ZQIiHnohj3G12 ImsKbk10jAH8VvO7ZzPBMe0qATCqqPiAtJVR9b5QGnP2FRK2XpPGnRUBKBLDT99bY3la fBvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zMjcQ0OfgyUTRyFYBvi3N5a27FGJ8sH8q5RNs5HfTDE=; b=cFxfxkjQssTdOvuNkKtvbHumcelWhv9s2F48cxDNDO4xarKfbEvYbZkYc0ArQR6YKF GbvK3l2KpXjrD0Dd4QrzSHGpq8sp+yynFstTf1+GLQCQIKCs24aSPKJNkC/iuKmSDroC IDFuSSkCTacqJ8zUQ1OGY200Jv7fIGkWsLz4HGxV5uQS2UhjqnlYg22LjNkiHRynTHYT makiZ959IFCEEe3saNTaL5PmLSfEqg8e0QXfRPZIp69LU1+MaJlmFC1cY9DY3h0EwoH6 XFpSoLl12axoH9sbYhzxO41FnoIyorkXphE2mpBR0mSJWIkEV6FWBY9wVC8mzS5S6O1j LqeQ== X-Gm-Message-State: APjAAAWyVCefnEnR1242vXd6U+MONvSwzaan0IpuaChFEISGb2STR5+Z ofx9rF0ABU3HkFJ/GSbcLY7EdyLV X-Google-Smtp-Source: APXvYqzkgm7I23WWoemj4tm6MovkbaNzmDoByYG7dvewmUGnkZR6vM0mrlj3v3z8HqWHEOvMnmqq6g== X-Received: by 2002:a5d:494e:: with SMTP id r14mr10642406wrs.333.1558663182477; Thu, 23 May 2019 18:59:42 -0700 (PDT) Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id w13sm10673901wmk.0.2019.05.23.18.59.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 18:59:41 -0700 (PDT) Subject: Re: bug#35737: xref--original-command To: Juri Linkov References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: Date: Fri, 24 May 2019 04:59:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <87woiqkwok.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) On 16.05.2019 22:58, Juri Linkov wrote: >> But please wait a little, I'd like to show a patch for bug#35702 that can >> also provide a basic for the same distinction in functionality but without >> this variable. > > OK. Please see the latest commits. In particular, there is now a xref-show-definitions-function. So in addition to display-buffer-alist, you can change it to give xref-find-definitions a particular behavior. Or to propose a new default behavior, suggest a patch for xref--show-defs-buffer. It could do its own things instead of delegating to xref--show-xref-buffer, i.e. use a distinct new major mode and somewhat different keymap. And also call pop-to-buffer with different arguments. >>> Emacs has side windows too. >> >> You mean like Speedbar? That's the part which I didn't exactly like. > > I don't like Speedbar too because it's too intrusive. But maybe > it can be rewritten using real side windows as documented in > (info "(elisp) Side Windows") It's hard to comment without seeing, but those windows being to the side is, again, probably not my favorite feature. I think Emacs is doing fine showing Grep results in regular windows. But please show the patch if it's easy, of course. From debbugs-submit-bounces@debbugs.gnu.org Fri May 24 14:43:36 2019 Received: (at 35737) by debbugs.gnu.org; 24 May 2019 18:43:36 +0000 Received: from localhost ([127.0.0.1]:47331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUFAG-0000iD-Gs for submit@debbugs.gnu.org; Fri, 24 May 2019 14:43:36 -0400 Received: from ladybird.maple.relay.mailchannels.net ([23.83.214.98]:9296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUFAE-0000i3-M7 for 35737@debbugs.gnu.org; Fri, 24 May 2019 14:43:35 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 551421A1677; Fri, 24 May 2019 18:43:33 +0000 (UTC) Received: from pdx1-sub0-mail-a67.g.dreamhost.com (100-96-11-129.trex.outbound.svc.cluster.local [100.96.11.129]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E89031A2437; Fri, 24 May 2019 18:43:29 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a67.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); Fri, 24 May 2019 18:43:33 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Fearful-Juvenile: 1602a01f7d03b7bf_1558723413109_1969168816 X-MC-Loop-Signature: 1558723413108:3567421722 X-MC-Ingress-Time: 1558723413108 Received: from pdx1-sub0-mail-a67.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a67.g.dreamhost.com (Postfix) with ESMTP id 7514C8068C; Fri, 24 May 2019 11:43:26 -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=fiSt+3uQgFfBPlW/GBYuXkUbk9A=; b= 0JC5DB9n1PtXs36G+AbjP47HssDZvLZvutXKsuQy10vBvULdk8V33khb5kS5iuyF Wa1X4xxKQEfzg/JH3bUYFBgIdGDDTW5zgTEPGDY6irn0InyyuMIUS7+tqi9K4ZS4 vCjWgWMT6uot5tW56/fiVC4MDYWDs03mDZShIwuoFJU= 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-a67.g.dreamhost.com (Postfix) with ESMTPSA id ADA8F80696; Fri, 24 May 2019 11:43:22 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a67 From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#35737: xref--original-command Organization: LINKOV.NET References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> Date: Fri, 24 May 2019 21:40:27 +0300 In-Reply-To: (Dmitry Gutov's message of "Fri, 24 May 2019 04:59:40 +0300") Message-ID: <87r28nenzk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudduiedgudefudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhunecuvehluhhsthgvrhfuihiivgepud X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> But please wait a little, I'd like to show a patch for bug#35702 that can >>> also provide a basic for the same distinction in functionality but without >>> this variable. >> >> OK. > > Please see the latest commits. Thanks, I tried xref revert and it works fine. Also I agree with Eli regarding the command name, documentation and NEWS. > In particular, there is now a xref-show-definitions-function. > > So in addition to display-buffer-alist, you can change it to give > xref-find-definitions a particular behavior. But I don't want to write a new function. I just need to check if the xref buffer was created by a particular command. If the solution requires writing a new function, then much easier would be to use 'advice-add': (advice-add 'xref-find-definitions :after (lambda (&rest _args) (with-current-buffer (window-buffer) (setq-local xref--original-command 'xref-find-definitions)))) > Or to propose a new default behavior, suggest a patch for > xref--show-defs-buffer. It could do its own things instead of delegating to > xref--show-xref-buffer, i.e. use a distinct new major mode and somewhat > different keymap. And also call pop-to-buffer with different arguments. If despite a chain of indirections, xref still can't distinguish different commands that created the xref buffer, I'd rather close this feature request and use 'advice-add' in customization. From debbugs-submit-bounces@debbugs.gnu.org Fri May 24 18:48:44 2019 Received: (at 35737) by debbugs.gnu.org; 24 May 2019 22:48:44 +0000 Received: from localhost ([127.0.0.1]:47566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUIzT-0007AF-TS for submit@debbugs.gnu.org; Fri, 24 May 2019 18:48:44 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:38117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUIzR-00079x-RU for 35737@debbugs.gnu.org; Fri, 24 May 2019 18:48:42 -0400 Received: by mail-wm1-f53.google.com with SMTP id t5so10605992wmh.3 for <35737@debbugs.gnu.org>; Fri, 24 May 2019 15:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gCR6khwK8eDTbOmPfRcy3wcv5Tu17H2yPKJpfuGjloA=; b=rrfHAYF2FNnt3qvk2HyvC5IO6CwDCYhJ6ZG42noHSlLQMyl+E0Yz4ZKdVDfWy1Z1Gj K5yqy5oLGK2Ul5LdMhjo+8m5XyBJrZV2lGtmdajc2pI0LsbqRZrTTC5+4WYjfn1f+gbf pvp5jz0pEKHTkppkpIDykWdSY4Lc9Z/a6wEQneqOAgmY5NUa9OyHycV2ReCU6Zyttjwv 4S20QFBK3Q7VFs3fb+VaqEKX4JXqdwmCWhgxliPAu2mTVbCA9GYqCDvgKqaqvxwHK5SV V5LxCi/LB2n3kmvbeMln9ndHEPRLGqU3uZnMgh7ZZ58DoB+v3pj7EbDbbHVVpJgZdKTA IFkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gCR6khwK8eDTbOmPfRcy3wcv5Tu17H2yPKJpfuGjloA=; b=ilPloGzFdNs0IC/XFWC2KBcEOJcLbENRItl4yfKDayUpkHyt//IYv4biqncXW0cHys XGIBTD1X03XEwmNg/h1Qizw47tet9UdnW/hyrdIsedeX32zX3A/1T+14qq7FH7wjZ0Er Ui2IUmP7l8Eg4piCsGMUHcFq21IjsXOv1bIxzVHoZLjnlG4w2gfCdfh1MONYyFec5iTM yg6y7Ubc5Qi5+5srEhX4qGkdGrGldklHvdJR/2EyPL4/Wn0Vos3Mh6QKfCpEvCZwdfoT /PvQo7E279YAkKdoctPuXT7qeOfUIhnTqEUXWZ6rCtGMJbYihoj9jQakBn+MU5NtvpLs sfsA== X-Gm-Message-State: APjAAAVC1PJBdm4VaZJTnfBuWAT6QJDHW2FNOKjabp/U/ggf8EXAXHL5 6gp4oghXDPqzFXnTuqM8rfevQ7Ki X-Google-Smtp-Source: APXvYqz6BxYlK6PTmiJcPCheIFWUdmGcE32hwHFKRsTHEG+SNDH1GBfbUCmzacuMDu9fVlgeoZU01Q== X-Received: by 2002:a7b:ce8c:: with SMTP id q12mr1408134wmj.34.1558738115526; Fri, 24 May 2019 15:48:35 -0700 (PDT) Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id s11sm6855772wrb.71.2019.05.24.15.48.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 May 2019 15:48:34 -0700 (PDT) Subject: Re: bug#35737: xref--original-command To: Juri Linkov References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: Date: Sat, 25 May 2019 01:48:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <87r28nenzk.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) On 24.05.2019 21:40, Juri Linkov wrote: > Thanks, I tried xref revert and it works fine. > Also I agree with Eli regarding the command name, > documentation and NEWS. Should be good now. > But I don't want to write a new function. I just need to check > if the xref buffer was created by a particular command. I think you need to make a choice here. Do you want to customize your personal Emacs, or do you want to improve the default behavior? If it's the former, I think the advice you posted will work as well as any other solution. I was kind of expecting the latter. > If despite a chain of indirections, xref still can't distinguish > different commands that created the xref buffer, I'd rather close > this feature request and use 'advice-add' in customization. Do we really need to be able to distinguish between xref-find-references and project-find-regexp as well? TBH, xref--original-command is easy to add, but then we'll have an internal variable that isn't used anywhere. Somebody will just delete it someday. From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 16:09:58 2019 Received: (at 35737) by debbugs.gnu.org; 27 May 2019 20:09:58 +0000 Received: from localhost ([127.0.0.1]:54230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVLwT-00008x-W1 for submit@debbugs.gnu.org; Mon, 27 May 2019 16:09:58 -0400 Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:42480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVLwQ-00008k-NX for 35737@debbugs.gnu.org; Mon, 27 May 2019 16:09:56 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C0D231423BE; Mon, 27 May 2019 20:09:53 +0000 (UTC) Received: from pdx1-sub0-mail-a50.g.dreamhost.com (100-96-87-96.trex.outbound.svc.cluster.local [100.96.87.96]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 421271422C4; Mon, 27 May 2019 20:09:53 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a50.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); Mon, 27 May 2019 20:09:53 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Supply-Inform: 3a67042144e6c70d_1558987793633_898812891 X-MC-Loop-Signature: 1558987793633:1958551154 X-MC-Ingress-Time: 1558987793633 Received: from pdx1-sub0-mail-a50.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a50.g.dreamhost.com (Postfix) with ESMTP id 7303E832A5; Mon, 27 May 2019 13:09:51 -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=lqF/eSlKNea9E+Zd46vxfmIf2tA=; b= YkLLVdkTZgdPOmZ954lO/tnTKP2VnoORQknBk4Exm88ECmVY+dktSRPopFPF65pi SKEoZ+cPNLvBJExfJ3o6vxhrnCbr0YX4Q81XrycvCJUUivmBuueCtnSD8jh7eIr3 Hdgblv14valOinXS76xqgM2DTua5ROS/GbywmzIxKgA= Received: from mail.jurta.org (m91-129-96-73.cust.tele2.ee [91.129.96.73]) (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-a50.g.dreamhost.com (Postfix) with ESMTPSA id 504EC832A3; Mon, 27 May 2019 13:09:48 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a50 From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#35737: xref--original-command Organization: LINKOV.NET References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> Date: Mon, 27 May 2019 22:59:37 +0300 In-Reply-To: (Dmitry Gutov's message of "Sat, 25 May 2019 01:48:28 +0300") Message-ID: <8736kzekie.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddruddvfedguddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrjeefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirdejfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegughhuthhovheshigrnhguvgigrdhruhenucevlhhushhtvghrufhiiigvpedv X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Thanks, I tried xref revert and it works fine. >> Also I agree with Eli regarding the command name, >> documentation and NEWS. > > Should be good now. Thanks. I wonder why you renamed xref--revert-xref-buffer to a such strange name xref-refresh-results? Why not simply xref-revert-buffer? >> But I don't want to write a new function. I just need to check >> if the xref buffer was created by a particular command. > > I think you need to make a choice here. > > Do you want to customize your personal Emacs, or do you want to improve the > default behavior? > > If it's the former, I think the advice you posted will work as well as any > other solution. > > I was kind of expecting the latter. The goal was to improve the default behavior to make customization easier. >> If despite a chain of indirections, xref still can't distinguish >> different commands that created the xref buffer, I'd rather close >> this feature request and use 'advice-add' in customization. > > Do we really need to be able to distinguish between xref-find-references > and project-find-regexp as well? > > TBH, xref--original-command is easy to add, but then we'll have an internal > variable that isn't used anywhere. Somebody will just delete it someday. The idea was to make xref more customizable differently for different commands: xref-find-definitions, xref-find-references, project-find-regexp. From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 17:13:46 2019 Received: (at 35737) by debbugs.gnu.org; 27 May 2019 21:13:46 +0000 Received: from localhost ([127.0.0.1]:54343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVMwE-0003vB-6k for submit@debbugs.gnu.org; Mon, 27 May 2019 17:13:46 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:43855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVMwC-0003uh-0B for 35737@debbugs.gnu.org; Mon, 27 May 2019 17:13:45 -0400 Received: by mail-wr1-f51.google.com with SMTP id l17so9597046wrm.10 for <35737@debbugs.gnu.org>; Mon, 27 May 2019 14:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=t2E6APHIENP/aUnfWG3pG2kyJnhUCCJTU7j6xaM7ztM=; b=unDQnyRD7Lvz2WZVVy1jec1a1PE3urRUPTfUWfIjKnrNVVNe7ug8Cc/gnQK+08xW+m BAV/CbGElcMwxCgBZaLc+9CoJzqVkBjkcs2trwFEgAJGQHtoSdVmjJJyKQt2mGcWUswm p8eAZ6vxqMlRojTHDI5cCbKaqyx2fJc21Z4Vle222rNSrD+xKH6VbdJMBLWX+hI47a71 vIteM2mX8j+qDwanausrXEcfOzAfLYbw5/vWuFAEsQQIZTjwG2CIJAPW2rmEm1j488Jq fdW3r2S3HT/mGK0U5Dkwuz/VHU71nGJnGn8obXbsUZ69FSZ8JdDS+K6lVuXIy8/iPPaf LYlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=t2E6APHIENP/aUnfWG3pG2kyJnhUCCJTU7j6xaM7ztM=; b=NkgP2c7Zm+1w6xZ2KeuPQlhEuSCwm2HZMBTxHkQw91YMMYRy/0cSoV4/EVwkSfMGE6 onjc6vQCx9+vUsUKvW9GK/yu58KE0K5jwgPn1PPu9XClvIDJ1w83U/yO23jDf99Owbvv 6t76I/Bkjwwg73JDLZ0ZHkhfqcpiuByi02Yy4ulW6+Oigk6Zki+ulx6BXF1GrKl2Y8Xu 3Gz1NWXOgslUJDCeIo+cFlY+59ahaPcONIEG/kqxTSgI5WNeaDrDYRiMfJXfBNWAy25Z ikz4zlM7noVv/fpOGYTM+diDePxDrLO9YCmHSH6SAb/OQm669I6RafVO+hI8EAreYd7E SZ5g== X-Gm-Message-State: APjAAAXHnrEQ3A49Q9FmJ3nje8U39U6z1lScZ36GHZJ6QiFKW9DNlJWO tpwF1v8UfPjTz4/ztlDXlnA/SXi6 X-Google-Smtp-Source: APXvYqzAYdwzRx0Wl6efBN9ap8LgULOpmAw9DJOok1SKwBr7A/iv+AxT6OlfB578MnuGV3/eY2cNSg== X-Received: by 2002:adf:83c5:: with SMTP id 63mr45979368wre.33.1558991617899; Mon, 27 May 2019 14:13:37 -0700 (PDT) Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id u10sm439844wml.42.2019.05.27.14.13.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 14:13:37 -0700 (PDT) Subject: Re: bug#35737: xref--original-command To: Juri Linkov References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> <8736kzekie.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> Date: Tue, 28 May 2019 00:13:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <8736kzekie.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) On 27.05.2019 22:59, Juri Linkov wrote: > Thanks. I wonder why you renamed xref--revert-xref-buffer > to a such strange name xref-refresh-results? Why not simply > xref-revert-buffer? Strange? I had to think how to describe the new command in NEWS, and these are the terms I came up with. Hence the name. Do you not think these words are appropriate? "revert buffer" sounds like undoing changes, and we're repeating a search and refreshing (or maybe reloading) the results. > The goal was to improve the default behavior to make customization easier. That's why I added xref-show-definitions-function. Customizing display-buffer-alist is an arcane art. The hook this variable provides should be easier to understand for an average user. So, to clarify, you're not interested in changing the *visible* default behavior, at least for now? >> TBH, xref--original-command is easy to add, but then we'll have an internal >> variable that isn't used anywhere. Somebody will just delete it someday. > > The idea was to make xref more customizable differently for different > commands: xref-find-definitions, xref-find-references, project-find-regexp. I get the idea, but not the goal. I know why we'd want to make xref-find-definitions and project-find-regexp to behave differently. The rest, I'm not so clear. Anyway, I was hoping my efforts in improving the default behavior would benefit your goals as well, but it seems the split between xref--show-xrefs and xref--show-defs goes against them. That's too bad. You still have your alternative solution, though. From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 19:21:57 2019 Received: (at 35737) by debbugs.gnu.org; 27 May 2019 23:21:57 +0000 Received: from localhost ([127.0.0.1]:54497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVOwH-0007CL-17 for submit@debbugs.gnu.org; Mon, 27 May 2019 19:21:57 -0400 Received: from mail-lf1-f45.google.com ([209.85.167.45]:34200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVOwF-0007C8-6w for 35737@debbugs.gnu.org; Mon, 27 May 2019 19:21:55 -0400 Received: by mail-lf1-f45.google.com with SMTP id v18so13100287lfi.1 for <35737@debbugs.gnu.org>; Mon, 27 May 2019 16:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=MmKvX1c5451R6L/Y3BFY5mSOBi8qAo+WFp/l/X/2xc8=; b=HUmZy4615EwbfYQ5nHy0qsnt5bDNr7QpFb511x6kw02xMP4l/n1EWVisBbYrUH6DhM gHfyDuSk33eV11RTfHhVy/ccxhhOJ3rIOojKMO294+Nt0ZD1OaghvETWvsJIRY7XYvNo lWiwnla+AD6E5nHV91aPx4fKSdD5Sl+jBKVdFRqvWwncalYJSl4QCXgH1SshNTix2IDl UBRxua5RLhTI1uWIFGerDjSaXJ+DHaw/9pSfwitvVU+CWG1UcmmejtHDFxqKZXok3Y+V jjLgCwRWbVD6W1hAVdZkWXum6Rp+ubocLoQkzE2Psqc7WXhUuIdqo/HHQwc8F8nGDd7O L8mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:references:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=MmKvX1c5451R6L/Y3BFY5mSOBi8qAo+WFp/l/X/2xc8=; b=PlmEJT9W2ftLEAupxELZVhlNX1vWs2/sQAzBfpJfZAiNmf0KrMWNkEinK0umQ+XtB7 UNNuYYJHzTqZ3p9QEpwpckjt1xCDLa/vXeZ4MFF2C089RAXOg6XxieZalkIQXSS55b+N /sADbZ5mWzfOI7mioZBpD+EV0zYCfzcMniDvQYMN5r395nUAIVtPucJGXg9IDef1muQC tJOPKSO1wzdJz96ckxSbgD+wlqBU77N9ZxA0AQTTX7U8+4ggfrva1ujdP1SbW2toO1ab q5gvYhEB3kTP/wb1vLq+bMAi7Fs8PB/LuocNcRJhHPFbcjEy5VnPPbj+izuFKRfn749+ Wwgw== X-Gm-Message-State: APjAAAXC38ada5xeFHWsUIlP089qtG/TZ09kH/0I8/Jk+XPlT9+GNuPq 4rirhBF2MbUzQA3kyF55Uv8bH9NP X-Google-Smtp-Source: APXvYqwkDkHUFLUZgytSGvI3UQ4ecq0uLeHiJgfp3V55YlaIPeT21eyz8OqkaU2UvYt4H44S5ZYJ9w== X-Received: by 2002:a19:c312:: with SMTP id t18mr39325613lff.165.1558999308713; Mon, 27 May 2019 16:21:48 -0700 (PDT) Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id 12sm2572784ljf.12.2019.05.27.16.21.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 16:21:47 -0700 (PDT) Subject: Re: bug#35737: xref--original-command From: Dmitry Gutov To: Juri Linkov References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> <8736kzekie.fsf@mail.linkov.net> <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> Message-ID: <3adebd17-70e5-712d-ba78-6e3aa884cfa6@yandex.ru> Date: Tue, 28 May 2019 02:21:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> Content-Type: multipart/mixed; boundary="------------1C1D0903199CE39743C8DC1B" Content-Language: en-US X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) This is a multi-part message in MIME format. --------------1C1D0903199CE39743C8DC1B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To be clear, here's the kind of change I was thinking of. Though maybe instead of changing xref--show-defs-buffer, we'd add a new function named like xref--show-defs-buffer-below. --------------1C1D0903199CE39743C8DC1B Content-Type: text/x-patch; name="xref-find-definitions-at-bottom.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xref-find-definitions-at-bottom.diff" diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 58c0119a54..80f80cdd75 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -704,6 +704,16 @@ xref--xref-buffer-mode (setq next-error-function #'xref--next-error-function) (setq next-error-last-buffer (current-buffer))) +(defvar xref--definitions-buffer-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "RET") #'xref-quit-and-goto-xref) + (set-keymap-parent map xref--xref-buffer-mode-map) + map)) + +(define-derived-mode xref--definitions-buffer-mode + xref--xref-buffer-mode + "XREF Defs") + (defun xref--next-error-function (n reset?) (when reset? (goto-char (point-min))) @@ -725,7 +735,6 @@ xref--next-error-function (defvar xref--button-map (let ((map (make-sparse-keymap))) - (define-key map [(control ?m)] #'xref-goto-xref) (define-key map [mouse-1] #'xref-goto-xref) (define-key map [mouse-2] #'xref--mouse-2) map)) @@ -789,18 +798,21 @@ xref--show-xref-buffer (funcall fetcher))) (xref-alist (xref--analyze xrefs))) (with-current-buffer (get-buffer-create xref-buffer-name) - (setq buffer-undo-list nil) - (let ((inhibit-read-only t) - (buffer-undo-list t)) - (erase-buffer) - (xref--insert-xrefs xref-alist) - (xref--xref-buffer-mode) - (pop-to-buffer (current-buffer)) - (goto-char (point-min)) - (setq xref--original-window (assoc-default 'window alist) - xref--original-window-intent (assoc-default 'display-action alist)) - (setq xref--fetcher fetcher) - (current-buffer))))) + (xref--show-common-initialize xref-alist fetcher alist) + (xref--xref-buffer-mode) + (pop-to-buffer (current-buffer)) + (current-buffer)))) + +(defun xref--show-common-initialize (xref-alist fetcher alist) + (setq buffer-undo-list nil) + (let ((inhibit-read-only t) + (buffer-undo-list t)) + (erase-buffer) + (xref--insert-xrefs xref-alist) + (goto-char (point-min)) + (setq xref--original-window (assoc-default 'window alist) + xref--original-window-intent (assoc-default 'display-action alist)) + (setq xref--fetcher fetcher))) (defun xref-refresh-results () "Refresh the search results in the current buffer." @@ -826,9 +838,12 @@ xref--show-defs-buffer (xref--pop-to-location (car xrefs) (assoc-default 'display-action alist))) (t - (xref--show-xref-buffer fetcher - (cons (cons 'fetched-xrefs xrefs) - alist)))))) + (with-current-buffer (get-buffer-create xref-buffer-name) + (xref--show-common-initialize (xref--analyze xrefs) fetcher alist) + (xref--definitions-buffer-mode) + (pop-to-buffer (current-buffer) + '(display-buffer-in-direction . ((direction . below)))) + (current-buffer)))))) (defvar xref-show-xrefs-function 'xref--show-xref-buffer --------------1C1D0903199CE39743C8DC1B-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 22:41:56 2019 Received: (at 35737) by debbugs.gnu.org; 28 May 2019 02:41:56 +0000 Received: from localhost ([127.0.0.1]:54725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVS3o-0002Bm-Dv for submit@debbugs.gnu.org; Mon, 27 May 2019 22:41:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVS3k-0002BU-L3 for 35737@debbugs.gnu.org; Mon, 27 May 2019 22:41:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVS3e-00058H-8M; Mon, 27 May 2019 22:41:46 -0400 Received: from [176.228.60.248] (port=1128 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hVS3d-0002rs-ID; Mon, 27 May 2019 22:41:46 -0400 Date: Tue, 28 May 2019 05:41:51 +0300 Message-Id: <83d0k31es0.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> (message from Dmitry Gutov on Tue, 28 May 2019 00:13:34 +0300) Subject: Re: bug#35737: xref--original-command References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> <8736kzekie.fsf@mail.linkov.net> <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Dmitry Gutov > Date: Tue, 28 May 2019 00:13:34 +0300 > Cc: 35737@debbugs.gnu.org > > "revert buffer" sounds like undoing changes, and we're repeating a > search and refreshing (or maybe reloading) the results. In Emacs, "reverting" a buffer means re-loading it from its source. If that source has been updated outside of Emacs, then reverting doesn't mean undoing changes, it means something else. There are examples of such reverting elsewhere in Emacs: in Dired and Info buffers, for example. From debbugs-submit-bounces@debbugs.gnu.org Tue May 28 03:46:52 2019 Received: (at 35737) by debbugs.gnu.org; 28 May 2019 07:46:52 +0000 Received: from localhost ([127.0.0.1]:54958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVWot-00026s-Rl for submit@debbugs.gnu.org; Tue, 28 May 2019 03:46:52 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:37169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVWos-00026c-GH for 35737@debbugs.gnu.org; Tue, 28 May 2019 03:46:51 -0400 Received: by mail-wm1-f54.google.com with SMTP id 7so1647582wmo.2 for <35737@debbugs.gnu.org>; Tue, 28 May 2019 00:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OwjW2KeJLT3T6HyWKch6bFQ/IIb6mhKnfRx6HEZI6N8=; b=YboeSbshDyvSx3PGyR5qKyrNn/6IdK9dpoPZUzkxw5+znaO+9FMhLW9/cI70BJAFYA RqtKmmjiavkyxSez91EMtadrVaZcqvVZfzDtp+5qUhJhPahHDhaKuWVqkUGJluLnZH/F SHNHds0TdhX/5b8yOgs7xA4sCvJ4a28bUVyCqo95WLPlY8nYiVJJV280AlhQvQLv+ZB1 FCPm4AGSUwuUG30zLmleoL1xUmTvdtjHitPPHhFuYEWhQNkCAJnuRTm6JSZjjmEgdF+l tfZMpJaGwPPFZAPCHyIgv69xThO7nYQ3OycpezwRCCcLUCr6d0p75rQ07pOzywqsp7o+ egpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OwjW2KeJLT3T6HyWKch6bFQ/IIb6mhKnfRx6HEZI6N8=; b=F0bwzUtujaXe5/QLL5n83+pBADWnqc5tJWcbXWmXSPgBGdJY7Vzqbn2htAc/yANG+n Ejf5wRmCkPQ9vMCZv5SRCAj8QBZ5HbCzXfyQ5dwonGZVGr6OYMb7g8369WzRO5R+kOXX jWmD1jQkDeWjO+cw4m1CwFN4lVhM7GKsw++bBqci4mZJd78QVHjWPImvw2qxVjDlVNuf ryEvG5kYDUlH3L4uNePOs8+R1v+8OgnlApt1Xsr3OzIBZ9D/Ex0288NrjQqZ2n3N7iRS Eh8jE/qg1SnELb1TIA8xR1+MSI6Z07whYvNjvzJ0I4VaACBwEVLkp0FtD7+81QEs12sO egOA== X-Gm-Message-State: APjAAAXNdedvWJhNLB0I/0Guq3caFxuEIhdR3wiJFBfNB8Xx0DBMdReF mwpfYqUNE5JKRfmiIQAuSCM= X-Google-Smtp-Source: APXvYqxvk3xl+uBZRfXOdWY2Db8swOed48aXT8VE53wSb0/AeWjQibgkmGCjX+jeDMjxgjN0VZuMlw== X-Received: by 2002:a1c:f610:: with SMTP id w16mr1927038wmc.37.1559029603476; Tue, 28 May 2019 00:46:43 -0700 (PDT) Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id 205sm1875218wmd.43.2019.05.28.00.46.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 May 2019 00:46:42 -0700 (PDT) Subject: Re: bug#35737: xref--original-command To: Eli Zaretskii References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> <8736kzekie.fsf@mail.linkov.net> <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> <83d0k31es0.fsf@gnu.org> From: Dmitry Gutov Message-ID: Date: Tue, 28 May 2019 10:46:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <83d0k31es0.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) On 28.05.2019 5:41, Eli Zaretskii wrote: > In Emacs, "reverting" a buffer means re-loading it from its source. > If that source has been updated outside of Emacs, then reverting > doesn't mean undoing changes, it means something else. There are > examples of such reverting elsewhere in Emacs: in Dired and Info > buffers, for example. Right. But I figured I'd be a little more explicit. I don't have a strong opinion on this, though, so just say the word, and I'll rename the command. From debbugs-submit-bounces@debbugs.gnu.org Tue May 28 11:02:12 2019 Received: (at 35737) by debbugs.gnu.org; 28 May 2019 15:02:12 +0000 Received: from localhost ([127.0.0.1]:56822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVdcC-0002PQ-DO for submit@debbugs.gnu.org; Tue, 28 May 2019 11:02:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVdc9-0002P7-8A for 35737@debbugs.gnu.org; Tue, 28 May 2019 11:02:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVdbm-0001e7-J8; Tue, 28 May 2019 11:01:52 -0400 Received: from [176.228.60.248] (port=2781 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hVdba-0006bK-T3; Tue, 28 May 2019 11:01:37 -0400 Date: Tue, 28 May 2019 18:01:41 +0300 Message-Id: <831s0i1v3e.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: (message from Dmitry Gutov on Tue, 28 May 2019 10:46:40 +0300) Subject: Re: bug#35737: xref--original-command References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> <8736kzekie.fsf@mail.linkov.net> <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> <83d0k31es0.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35737 Cc: 35737@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 35737@debbugs.gnu.org, juri@linkov.net > From: Dmitry Gutov > Date: Tue, 28 May 2019 10:46:40 +0300 > > I don't have a strong opinion on this, though, so just say the word, and > I'll rename the command. I don't have a strong opinion, either, or I'd have talked already. I did remember raising a brow when reading that function, but that's all. From debbugs-submit-bounces@debbugs.gnu.org Tue May 28 16:47:15 2019 Received: (at 35737-done) by debbugs.gnu.org; 28 May 2019 20:47:16 +0000 Received: from localhost ([127.0.0.1]:57314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVj07-0006Gd-LH for submit@debbugs.gnu.org; Tue, 28 May 2019 16:47:15 -0400 Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:6339) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVj05-0006GS-7g for 35737-done@debbugs.gnu.org; Tue, 28 May 2019 16:47:14 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E198F5025C6; Tue, 28 May 2019 20:47:11 +0000 (UTC) Received: from pdx1-sub0-mail-a6.g.dreamhost.com (100-96-14-97.trex.outbound.svc.cluster.local [100.96.14.97]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 8F168501E65; Tue, 28 May 2019 20:47:10 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a6.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); Tue, 28 May 2019 20:47:11 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Keen-Supply: 24e2253d0c635928_1559076431747_3908980561 X-MC-Loop-Signature: 1559076431747:479176304 X-MC-Ingress-Time: 1559076431747 Received: from pdx1-sub0-mail-a6.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a6.g.dreamhost.com (Postfix) with ESMTP id 51FF2801A5; Tue, 28 May 2019 13:47:05 -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=rdzrcESfNJudmV40jrc9i1gDN9I=; b= rKBTDuxfoYGJ6IZ+qWXwxNCIp/cQcDR5lFyaPOqibgcP+20dpdQcSK1OldJN/hbf ZK9wOgfAQyD9WfXO7KJB1FdDAy3Dx0WqSgKiELOpRSkDQF3xlYABjAgBzAp0rqfo KtfaDcme6cgJSVmBOHdBDJJlq1caxqWyM3UbRuL0ZJ4= Received: from mail.jurta.org (m91-129-96-73.cust.tele2.ee [91.129.96.73]) (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-a6.g.dreamhost.com (Postfix) with ESMTPSA id 574CE8019E; Tue, 28 May 2019 13:47:02 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a6 From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#35737: xref--original-command Organization: LINKOV.NET References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> <8736kzekie.fsf@mail.linkov.net> <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> Date: Tue, 28 May 2019 23:30:30 +0300 In-Reply-To: <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> (Dmitry Gutov's message of "Tue, 28 May 2019 00:13:34 +0300") Message-ID: <87sgsyfoct.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddruddvhedgudehfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleeirdejfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrjeefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhunecuvehluhhsthgvrhfuihiivgepud X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35737-done Cc: 35737-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > "revert buffer" sounds like undoing changes, and we're repeating a search > and refreshing (or maybe reloading) the results. "revert buffer" is a standard term for updating an Emacs buffer. > I get the idea, but not the goal. I know why we'd want to make > xref-find-definitions and project-find-regexp to behave differently. The > rest, I'm not so clear. > > Anyway, I was hoping my efforts in improving the default behavior would > benefit your goals as well, but it seems the split between xref--show-xrefs > and xref--show-defs goes against them. That's too bad. Thanks for your efforts. Your recent changes would be useful for other goals, e.g. making the xref output to use grep-like output format. >> The goal was to improve the default behavior to make customization easier. > > That's why I added xref-show-definitions-function. > > Customizing display-buffer-alist is an arcane art. The hook this variable > provides should be easier to understand for an average user. > > So, to clarify, you're not interested in changing the *visible* default > behavior, at least for now? No, not a visual change this time. I'd also close bug#33992 because it's also leading nowhere. But maybe your recent patch with xref--definitions-buffer-mode is an improvement, I don't know. I'm looking at xref from customization's point of view, and I see no more improvements that could simplify xref customization. From debbugs-submit-bounces@debbugs.gnu.org Thu May 30 13:33:24 2019 Received: (at 35737) by debbugs.gnu.org; 30 May 2019 17:33:24 +0000 Received: from localhost ([127.0.0.1]:33794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWOvc-0003tv-BC for submit@debbugs.gnu.org; Thu, 30 May 2019 13:33:24 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:40167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWOva-0003tc-Ug for 35737@debbugs.gnu.org; Thu, 30 May 2019 13:33:23 -0400 Received: by mail-wm1-f43.google.com with SMTP id 15so4297059wmg.5 for <35737@debbugs.gnu.org>; Thu, 30 May 2019 10:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IihFGu/SOamj4ZO2APJXV14Enc7+6nAkatj2HECadCk=; b=XR6dwBEs5LPzd7YVD1l91b5RPdR4MyNSCpJzVgGlnmhqcNyE6xCdz+CmzGv/WB2+4X H8fFSu4FEAPm6bXm8/6PQFSZPC0b9Ah10EXSwr57Xt/h5lbDkquxBahwlZMZ9dhiPkd4 bGZslFz6dV0OrOUUKGZrPx+HUtZ1lIEkjLEYOUcjIQMs/NmVEAXm6Pcl0P9LyCDBpGX5 3KvZQbKb5CY+sMxsu6LjeV5tFS7+81N2xLf8AA4VaMB2dfbM0yv13ZI58zIYSYDG25eA LRtps2jnqMU0DpLxDI+CEe12e2X+Al+u864Bqm4Fg66u5MCbH3QPY/kD/qkEO/csvXtz YClA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IihFGu/SOamj4ZO2APJXV14Enc7+6nAkatj2HECadCk=; b=S6lySU+oHUXG9jbTstCB9zEb7s9G+vwQKXVnB3ixrPRJIdXNWtqxzvVXhAEuMRy59P 6UHA9aNh2KWWG+mk++ycUY/TC0Y0tyw8hMD13uHhlgZj3ViKRUObMqBEL92qRmtkH03E lkqD7vc3qymmSi8D1LOKtaOYaX+91YXkbY0OKr47kDonC/Hm/vVt41mrumWkYdux3L/A eIMduxXDqUPCSLWyBnJ2Xr2MKglp2mGX7fKivtXafJX6Upu8ATNsbQCGwAkKXEkQ+tVg ZEXDH304QStV7L9Whs75vMrm0pAdDVxeW0LCr0E+8u+2w1Difu6ITEKluMiMYAcUzJVN 5fAg== X-Gm-Message-State: APjAAAVgADENIDyijmHyagdCSzcdFme9ucGlujaU5Q6S6UfcjSdLEY2v 6cDpJfgCVp8EVQjubsQG674= X-Google-Smtp-Source: APXvYqyCi/BRRtWscCGbAij+jpz/iiYwPYxrfipdr9a24YFFEJRYAP2Wglz4Y9iI1qE0LBl3yn0inQ== X-Received: by 2002:a1c:f116:: with SMTP id p22mr2922290wmh.70.1559237597221; Thu, 30 May 2019 10:33:17 -0700 (PDT) Received: from [10.1.81.28] ([82.116.203.99]) by smtp.googlemail.com with ESMTPSA id j9sm3806797wrr.90.2019.05.30.10.33.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 May 2019 10:33:14 -0700 (PDT) Subject: Re: bug#35737: xref--original-command To: 35737@debbugs.gnu.org, juri@linkov.net References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> <8736kzekie.fsf@mail.linkov.net> <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> <87sgsyfoct.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: <094aa86b-059c-c6ea-3b59-10dd6a2314e3@yandex.ru> Date: Thu, 30 May 2019 20:33:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <87sgsyfoct.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 35737 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) On 28.05.2019 23:30, Juri Linkov wrote: >> "revert buffer" sounds like undoing changes, and we're repeating a search >> and refreshing (or maybe reloading) the results. > > "revert buffer" is a standard term for updating an Emacs buffer. OK, renamed. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 19:44:16 2019 Received: (at 35737) by debbugs.gnu.org; 9 Jun 2019 23:44:16 +0000 Received: from localhost ([127.0.0.1]:55593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ha7Tz-0007ON-V7 for submit@debbugs.gnu.org; Sun, 09 Jun 2019 19:44:16 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:46081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ha7Ty-0007O8-2c for 35737@debbugs.gnu.org; Sun, 09 Jun 2019 19:44:14 -0400 Received: by mail-wr1-f41.google.com with SMTP id n4so7267826wrw.13 for <35737@debbugs.gnu.org>; Sun, 09 Jun 2019 16:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kHGtu6yEx4YoC/bf+DMwj75+P9h4vlT4v5hV1MgoaxY=; b=qM543d3m8MoZ8drYehrVQrRwb0qHwPQMTm0vNBf7jk2L28qzMdV8/BrbgZHz5bVPLz tqnK7NrBQs0AWn1wrwz8hdVcUSclrHjMT7eMAn7W2XKHbVDaoe9R6Bit1Z7EH/iJmFD3 JPhEXRw2B//6qs0EhIbXNtztG7eN9nk59QylEYObkS/eM6eVw+nTnfJdxvyr0zsIGAht DQz+rVZj5zfTVy9zfSCjkY2js7D9skbmCnCaEI+tG9FogiXgp1SBohkmgQCPdyt29tNn Y1673GEssYnr6bNNbQ0OZ36BGNaHDKx2oSLgxJVydXxgvTvoOlQs7Ii6XQtPy7V1d34S 5UxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kHGtu6yEx4YoC/bf+DMwj75+P9h4vlT4v5hV1MgoaxY=; b=p2doEiE2hkg/+pv8yqtR9HrZYgaVTnLc9z4kqZaV8uCvR+uXpoSQoQ66MsgOPSGcpe 3xkVjD7smE3lBBn6xLkzfkHRcZYRYiLdPBz+AOv1+8DZdebOKqgXkQyb+tITWu//RjR8 JTGecpcf8SRRQiwh5uwWUkkQml16Uza7tj4d4DWViDN/09GoFDD6pOayeul3SqQqlXYp qi5LewnSK/cC84vxCSzm5i6FDzHpIQs7PAPeDIfEKYodbzN9KxYB8ghF+rf/e6KGA1kE LmzqnjTe1RLK2h3MH+ThGHnACyFSCfIkXQCeSvbYcN8owkebVNc7JBzSMv1pH8VzUjK1 OWRg== X-Gm-Message-State: APjAAAVLIjG9MzXLlYikh/Dy+lOH9Vw3qbFlcfgm9Lv3C7wq577yhUTj Ydv5wpFvo2ExNLXI+3CEAYdwkPg1qjQ= X-Google-Smtp-Source: APXvYqzYgu72Hb0r/WcQtn58+tSxe0VZH548qYscK2MDtPTniGO9myN8b507hZKKI5av9ZAdUZ0G/A== X-Received: by 2002:adf:db8e:: with SMTP id u14mr14133179wri.190.1560123848089; Sun, 09 Jun 2019 16:44:08 -0700 (PDT) Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id j132sm15954189wmj.21.2019.06.09.16.44.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jun 2019 16:44:06 -0700 (PDT) Subject: Re: bug#35737: xref--original-command To: 35737@debbugs.gnu.org, juri@linkov.net References: <87ftpgu59l.fsf@mail.linkov.net> <56943df5-f366-a8af-cb95-a40c244da837@yandex.ru> <87tvdvpgzj.fsf@mail.linkov.net> <87woiqkwok.fsf@mail.linkov.net> <87r28nenzk.fsf@mail.linkov.net> <8736kzekie.fsf@mail.linkov.net> <413fa232-ea7f-bd6a-ecce-632962a7f57e@yandex.ru> <87sgsyfoct.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: <0b28717b-7e2b-39bf-1d6a-27127669265c@yandex.ru> Date: Mon, 10 Jun 2019 02:44:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <87sgsyfoct.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 35737 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 28.05.2019 23:30, Juri Linkov wrote: >> Anyway, I was hoping my efforts in improving the default behavior would >> benefit your goals as well, but it seems the split between xref--show-xrefs >> and xref--show-defs goes against them. That's too bad. > > Thanks for your efforts. Your recent changes would be useful for other goals, > e.g. making the xref output to use grep-like output format. Not sure what you mean, but if you mean altering the behavior for all-commands-except-xref-find-definitions, then sure. Not sure why you think the split is helpful for this but not your present goal, though. >> So, to clarify, you're not interested in changing the *visible* default >> behavior, at least for now? > > No, not a visual change this time. I'd also close bug#33992 because > it's also leading nowhere. But maybe your recent patch with > xref--definitions-buffer-mode is an improvement, I don't know. That patch is a lateral move, to make experimenting with this particular behavior change easier. I've installed in the meantime. > I'm looking at xref from customization's point of view, and I see no more > improvements that could simplify xref customization. OK. If you have any further ideas, please don't hesitate to bring them up. From unknown Sun Jun 22 17:11:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 08 Jul 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator