unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>, emacs-devel@gnu.org
Subject: Re: Xref/Eglot feature requests and a question
Date: Thu, 24 Aug 2023 18:13:12 +0300	[thread overview]
Message-ID: <a98d3a29-0621-f82b-57c5-86b5da3da005@gutov.dev> (raw)
In-Reply-To: <m2a5ugva3g.fsf@Mini.fritz.box>

On 24/08/2023 16:33, Gerd Möllmann wrote:
> I have a couple of feature requests regarding Xref and/or Eglot, after
> switching from Lsp-mode to Eglot yesterday, which BTW went really
> well. Thanks to João!
> 
> 1.
> 
> I'm in a C buffer with Eglot running, and I want to go to the definition
> of something whose name I know, but point is not on an identifier naming
> that thing.  For instance, I want to go the definition of Lisp_Package
> (in an obsure branch having a struct Lisp_Package), while point is
> somewhere.
> 
> C-u M-. offers some completions, but Lisp_Package is not among them.
> Not using a completion and entering Lisp_Package works.
> 
> Feature request: Could the completions be made to contain all workspace
> symbols?  Lsp-mode has something doing that, and I found it quite useful
> with Helm.
> 
> C-M-. Lisp_Package RET works fine, but entering a word list as
> advertised in the prompt, say "Li Pa", does not.
> 
> Question: Bug or limitation?

Both of these are up to Eglot, I think. Or the underlying language server.

> 3.
> 
> In C mode, Xref works using Eglot, in ELisp mode it uses something else
> (I have no tags tables).  Both work really well, but I apparently have
> to be in an ELisp buffer to use one and in a C buffer to use the other.
> 
> Feature request: Is it possible to use more than one backend at the same
> time?  So that I could C-M-. to find an ELisp function while being in a
> C file?  I couldn't find something like that mentioned in the docs, so I
> guess it's not yet possible.

No such capability at the moment, but we indeed have an ELPA package 
xref-union which implements the "merging" feature that has been 
requested in the past.

You are asking for something a little different, though: to be able to 
switch to a different language/project that's also present in the 
current Emacs session. Its backend function cannot be found in the 
xref-backend-functions in the current buffer (local or global), unlike 
the examples with mixing in etags or imenu results, like mentioned by 
Visuwesh.

A naive approach, or for the new code to search across different open 
buffers and look for different available xref-backend-functions 
elements. And then prompt the user, and then call (?) the said function 
in one of the buffers it was found in, because in all likelihood it 
would fail in unrelated ones.

Perhaps the solution is to add a new facility to Xref, where different 
"projects" would be able to register globally in. A feature request indeed.



      parent reply	other threads:[~2023-08-24 15:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 13:33 Xref/Eglot feature requests and a question Gerd Möllmann
2023-08-24 14:06 ` Visuwesh
2023-08-24 14:58 ` Eli Zaretskii
2023-08-25  6:53   ` Gerd Möllmann
2023-08-25  8:10     ` João Távora
2023-08-24 15:13 ` Dmitry Gutov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a98d3a29-0621-f82b-57c5-86b5da3da005@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=emacs-devel@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).