From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#50067: Context menus Date: Wed, 01 Sep 2021 10:08:38 +0300 Organization: LINKOV.NET Message-ID: <87czps95tt.fsf@mail.linkov.net> References: <83sfz639lh.fsf@gnu.org> <83eeanyrm5.fsf@gnu.org> <4BC1074D-DE75-4303-8385-B70BAACFCDA0@acm.org> <83czq7youc.fsf@gnu.org> <32ef6b91-107c-d7e5-b103-0ff062bf8ebd@yandex.ru> <83y28twahy.fsf@gnu.org> <7af845e0-1f19-61fc-65e0-b23fac3927aa@yandex.ru> <83v93wx5ny.fsf@gnu.org> <83r1ekwfrd.fsf@gnu.org> <871r6ki6aw.fsf@mail.linkov.net> <838s0otl6b.fsf@gnu.org> <0273902a-1f93-c643-da26-ab314d6d2db4@yandex.ru> <8335qvs8re.fsf@gnu.org> <835yvnkuwb.fsf@gnu.org> <87wno26qlo.fsf@mail.linkov.net> <87fsupr1rv.fsf@mail.linkov.net> <3656c47f-49e2-1a90-ce2f-12b8899742aa@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="982"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: alan@idiocy.org, mattiase@acm.org, homeros.misasa@gmail.com, tkk@misasa.okayama-u.ac.jp, larsi@gnus.org, 50067@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 01 09:26:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLKdR-000Ae3-BD for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Sep 2021 09:26:13 +0200 Original-Received: from localhost ([::1]:50994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLKdQ-0000jh-1f for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Sep 2021 03:26:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLKdH-0000gR-9F for bug-gnu-emacs@gnu.org; Wed, 01 Sep 2021 03:26:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLKdG-000362-0O for bug-gnu-emacs@gnu.org; Wed, 01 Sep 2021 03:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mLKdF-0002wV-RZ for bug-gnu-emacs@gnu.org; Wed, 01 Sep 2021 03:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Sep 2021 07:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50067 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 50067-submit@debbugs.gnu.org id=B50067.163048114411263 (code B ref 50067); Wed, 01 Sep 2021 07:26:01 +0000 Original-Received: (at 50067) by debbugs.gnu.org; 1 Sep 2021 07:25:44 +0000 Original-Received: from localhost ([127.0.0.1]:36055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLKcy-0002vb-Gx for submit@debbugs.gnu.org; Wed, 01 Sep 2021 03:25:44 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:46351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLKcw-0002vK-N4 for 50067@debbugs.gnu.org; Wed, 01 Sep 2021 03:25:43 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id F093D200013; Wed, 1 Sep 2021 07:25:32 +0000 (UTC) In-Reply-To: <3656c47f-49e2-1a90-ce2f-12b8899742aa@yandex.ru> (Dmitry Gutov's message of "Tue, 31 Aug 2021 23:23:43 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:213142 Archived-At: >> so the new option could provide at least these choices: >> 1. 'jump': Jump to the first location by selecting its window; >> 2. 'show': Show the first item, but keep focus in the Xref window; >> 3. 'move': Move point to the first item in the Xref window >> without showing it (maybe this should be the default behavior). > > We can do that. Do you expect to be using more than 1 of these values > yourself, or is it just for completeness? A good indication that all values are needed is that I still can't decide which to use, so it would be possible to switch to another value when one of them does too much or too little. > Regarding 3 as default, it makes a certain sense, but then you won't be > able to iterate through all locations with just 'n'. You'd have to press > 'C-o' and then 'n', 'n', 'n'... I agree, it should not be the default. >> To be able to add later a similar variable for xref-find-references, >> the new variable for xref-find-definitions could be named accordingly >> with a name that refers to xref-find-definitions, for example, >> xref-find-definitions-auto-jump. Then later xref-find-references-auto-jump. > > I think the "other" variable would be called something with the word > "xrefs", not "references", and apply to other commands as well, such as > xref-find-apropos and project-find-regexp. > > So the proposed scheme would not quite work. Maybe like this instead? > > - xref-auto-jump-to-first-definition > - xref-auto-jump-to-first-. Or just > xref-auto-jump-to-first. grep/compilation already supports the value 'jump' by non-nil 'compilation-auto-jump-to-first-error', and the value 'move' when 'compilation-scroll-output' is customized to 'first-error'. But I think for xref still two separate options are needed xref-auto-jump-to-first-definition for xref-find-definitions, and xref-auto-jump-to-first-xref for other more grep-like xref commands. BTW, I'm testing compilation errors/warnings on xref context menu, and it reposts this warning: prog-mode.el:60:12: Warning: the function `xref-backend-identifier-at-point' is not known to be defined. on this code: (defun prog-context-menu (menu) (require 'xref) (define-key-after menu [prog-separator] menu-bar-separator 'mark-whole-buffer) (when (save-excursion (mouse-set-point last-input-event) (xref-backend-identifier-at-point (xref-find-backend))) (define-key-after menu [xref-find-def] '(menu-item "Find Definition" xref-find-definitions-at-mouse :help "Find definition of identifier") 'prog-separator)) Maybe `xref-backend-identifier-at-point' should be autoloaded?