GNU bug report logs - #71068
30.0.50; Incorrect xref positions for eglot-execute

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Sun, 19 May 2024 15:56:02 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eshel Yaron <me <at> eshelyaron.com>, 71068 <at> debbugs.gnu.org
Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute
Date: Sun, 26 May 2024 06:04:56 +0300
Hi! Thanks for the report.

On 19/05/2024 18:55, Eshel Yaron via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Using xref to find the definition of eglot-execute seems to yield
> imprecise definition locations:
> 
> 1. emacs -Q
> 2. (require 'eglot)
> 3. M-. eglot-execute RET
> 
> This produces an*xref*  buffer that lists two definitions:
> 
> --8<---------------cut here---------------start------------->8---
> .../lisp/progmodes/eglot.el
>    (cl-defgeneric eglot-execute)
>    (cl-defmethod eglot-execute (server action))
> --8<---------------cut here---------------end--------------->8---
> 
> Following the first definition leads to the definition of
> eglot-execute-command (which is different from eglot-execute, although
> the former is defined right above the latter), while the second
> definition leads to the top of the file.

I've (hopefully) fixed the first problem just now in commit 2a12f39ffe8.

Regarding the second one, looks like it's using a more advanced syntax 
that our functions haven't been taught about.

Since the method has been defined through a :method property on 
defgeneric, I suppose cl--generic-search-method should be taught to 
search for such definitions too.

The definition itself could be rewritten in a simpler fashion, though. 
Just using cl-defmethod (the generic is then created implicitly, and the 
arguments list is not repeated).




This bug report was last modified 1 year and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.