unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Xref/Eglot feature requests and a question
@ 2023-08-24 13:33 Gerd Möllmann
  2023-08-24 14:06 ` Visuwesh
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Gerd Möllmann @ 2023-08-24 13:33 UTC (permalink / raw)
  To: emacs-devel

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?

2.

THere are some useful eglot functions that can currently only invoked
with M-x, by default.  I'm currently defining a keymap

(define-keymap :prefix 'my-eglot-bindings
  "a" 'eglot-code-actions
  "f" 'eglot-format
  "h" 'eglot-inlay-hints-mode
  "r" 'eglot-rename)

that I bind to a a prefix key in c-mode-common-hook.

Feature request: Could eglot-mode do something like that?

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xref/Eglot feature requests and a question
  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-24 15:13 ` Dmitry Gutov
  2 siblings, 0 replies; 6+ messages in thread
From: Visuwesh @ 2023-08-24 14:06 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel

[வியாழன் ஆகஸ்ட் 24, 2023] Gerd Möllmann wrote:

> 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.

Fallback to other backend was discussed in bug#28407, and there's also
the xref-union [1] GNU ELPA package.  IME implementing imenu-xref for
bug#28407, etags xref backend was/is particularly annoying so I am not
sure how well xref-union will work for you if etags is not the _last_
xref backend to check.

1. https://git.sr.ht/~pkal/xref-union



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xref/Eglot feature requests and a question
  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-24 15:13 ` Dmitry Gutov
  2 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2023-08-24 14:58 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Date: Thu, 24 Aug 2023 15:33:23 +0200
> 
> Feature request: Could eglot-mode do something like that?
> [...]
> 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.

I suggest to submit 3 separate feature-request bug reports for these
two requests.  The second one is for Eglot, the others for Xref, so
mixing them in a single issue is not recommended.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xref/Eglot feature requests and a question
  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-24 15:13 ` Dmitry Gutov
  2 siblings, 0 replies; 6+ messages in thread
From: Dmitry Gutov @ 2023-08-24 15:13 UTC (permalink / raw)
  To: Gerd Möllmann, emacs-devel

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xref/Eglot feature requests and a question
  2023-08-24 14:58 ` Eli Zaretskii
@ 2023-08-25  6:53   ` Gerd Möllmann
  2023-08-25  8:10     ` João Távora
  0 siblings, 1 reply; 6+ messages in thread
From: Gerd Möllmann @ 2023-08-25  6:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Date: Thu, 24 Aug 2023 15:33:23 +0200
>> 
>> Feature request: Could eglot-mode do something like that?
>> [...]
>> 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.
>
> I suggest to submit 3 separate feature-request bug reports for these
> two requests.  The second one is for Eglot, the others for Xref, so
> mixing them in a single issue is not recommended.

65520 normal     Gerd Möllmann      30.0.50; [FR Xref] Project-wide operations
65519 normal     Gerd Möllmann      30.0.50; [FR Eglot] keymaps for useful functions
65518 normal     Gerd Möllmann      30.0.50; [FR Eglot] Completions over all workspace symbols
65517 normal     Gerd Möllmann      30.0.50; Eglot: word list input



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xref/Eglot feature requests and a question
  2023-08-25  6:53   ` Gerd Möllmann
@ 2023-08-25  8:10     ` João Távora
  0 siblings, 0 replies; 6+ messages in thread
From: João Távora @ 2023-08-25  8:10 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: Eli Zaretskii, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]

Thanks, but please Gerd (and others), when creating bug reports for Eglot,
remember to Cc me directly (or X-Debbugs-CC me) in these emails as it
greatly helps me sort out my inbox and not lose track of this. I don't
always track emacs-devel and bug-gnu-emacs very closely.

João

On Fri, Aug 25, 2023, 07:54 Gerd Möllmann <gerd.moellmann@gmail.com> wrote:

> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> >> Date: Thu, 24 Aug 2023 15:33:23 +0200
> >>
> >> Feature request: Could eglot-mode do something like that?
> >> [...]
> >> 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.
> >
> > I suggest to submit 3 separate feature-request bug reports for these
> > two requests.  The second one is for Eglot, the others for Xref, so
> > mixing them in a single issue is not recommended.
>
> 65520 normal     Gerd Möllmann      30.0.50; [FR Xref] Project-wide
> operations
> 65519 normal     Gerd Möllmann      30.0.50; [FR Eglot] keymaps for useful
> functions
> 65518 normal     Gerd Möllmann      30.0.50; [FR Eglot] Completions over
> all workspace symbols
> 65517 normal     Gerd Möllmann      30.0.50; Eglot: word list input
>
>

[-- Attachment #2: Type: text/html, Size: 2358 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-25  8:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).