GNU bug report logs -
#44494
etags.el xref-location-marker does not handle TAGS references to .el.gz files
Previous Next
Reported by: Pierre Rouleau <prouleau001 <at> gmail.com>
Date: Fri, 6 Nov 2020 23:24:02 UTC
Severity: normal
Tags: confirmed, patch
Merged with 2807
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On Sat, Nov 7, 2020 at 9:48 AM Pierre Rouleau <prouleau001 <at> gmail.com> wrote:
> On Sat, Nov 7, 2020 at 9:37 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>> > From: Pierre Rouleau <prouleau001 <at> gmail.com>
>> > Date: Sat, 7 Nov 2020 09:15:12 -0500
>> > Cc: dgutov <at> yandex.ru, 44494 <at> debbugs.gnu.org
>> >
>> > To recap you need to try searching for something that is not already
>> > loaded and use the etags xref backend with a file that contains the
>> definition
>> > of what one is searching and that is located inside a compressed file.
>>
>> OK, I've now tried this with paren.el, which is not loaded in "emacs
>> -Q". I can confirm that M-. fails to find functions in paren.el (I
>> tried show-paren-function, FTR), even if I use xref-etags-mode, but
>> "M-x find-tag" succeeds.
>>
>> So I think we should try to understand why find-tag does work in this
>> case, and see how to make xref-find-definitions do the same. Could
>> you perhaps do that?
>>
>> > . emacs -Q
>> > . C-x C-f lisp/simple.el.gz
>> > . M-x xref-etags-mode
>> > . C-u M-x cc-require
>> > emacs==> prompts Visit tags table (default TAGS): ....
>> > me ====> I select the TAGS file where all definitions are stored and
>> hit RET
>> > - emacs 26.3 ==> Rerun etags: ‘^(defmacro cc-require ’ not found in
>> > /usr/local/Cellar/emacs/26.3/share/emacs/26.3/lisp/progmod\
>> > es/cc-bytecomp.el
>> > - emacs 27.1 ==> Rerun etags: ‘^(defmacro cc-require ’ not found in
>> >
>> /usr/local/Cellar/emacs/27.1/share/emacs/27.1/lisp/progmodes/cc-bytecomp.el
>>
>> Note that at this point, you have an empty cc-bytecomp.el buffer.
>> Which I think gives a clue as to where the problem lies.
>>
>
> You are correct, I tried it with find-tag in emacs 26.3 and 27.1 and
> find-tag cc-require
> does find it, even with the xref-backend-functions set to its default of
> (elisp--xref-backend t).
>
> It fails with xref-find-definitions but works with find-tag.
>
> I agree there's a need to see what differs there.
>
> Thanks
>
> --
> /Pierre
>
One difference is that when using find-tag is using code from etags.el
exclusively:
- find-tag-noselect
. - find-tag-in-order , which tries different predicates and the one that
succeeds is tag-implicit-name-match-p
. - it identifies the cc-bytecomp.el.gz
.- calls etags-goto-tag-location
When using xref-find-definition the xref backend is used. It's not the
same code.
The xref backend code for elisp does not find it. The backend code for
etags does not find it either.
It tries to open cc-bytecomp.el as its the file name it gets from the TAGS
file.
It detects the file not being present and reports it as missing, assuming
the file have been removed.
To me the 2 sets of code look very different.
--
/Pierre
[Message part 2 (text/html, inline)]
This bug report was last modified 1 year and 218 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.