From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pierre Rouleau Newsgroups: gmane.emacs.bugs Subject: bug#44494: etags.el xref-location-marker does not handle TAGS references to .el.gz files Date: Sat, 7 Nov 2020 10:39:41 -0500 Message-ID: References: <1cdac9f7-8340-83eb-f619-583e028e6e23@yandex.ru> <83wnyx7g0u.fsf@gnu.org> <838sbd6xn1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e6f07905b3862342" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24926"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44494@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 07 16:40:28 2020 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 1kbQKJ-0006NX-Gf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Nov 2020 16:40:27 +0100 Original-Received: from localhost ([::1]:58818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbQKI-0008EV-1Z for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Nov 2020 10:40:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbQJv-0008EM-9A for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 10:40:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbQJv-0003cF-00 for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 10:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kbQJu-0000oj-T6 for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 10:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pierre Rouleau Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Nov 2020 15:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44494 X-GNU-PR-Package: emacs Original-Received: via spool by 44494-submit@debbugs.gnu.org id=B44494.16047636003124 (code B ref 44494); Sat, 07 Nov 2020 15:40:02 +0000 Original-Received: (at 44494) by debbugs.gnu.org; 7 Nov 2020 15:40:00 +0000 Original-Received: from localhost ([127.0.0.1]:59125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbQJs-0000oK-EJ for submit@debbugs.gnu.org; Sat, 07 Nov 2020 10:40:00 -0500 Original-Received: from mail-lf1-f51.google.com ([209.85.167.51]:34095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbQJq-0000o8-UE for 44494@debbugs.gnu.org; Sat, 07 Nov 2020 10:39:59 -0500 Original-Received: by mail-lf1-f51.google.com with SMTP id i6so6153062lfd.1 for <44494@debbugs.gnu.org>; Sat, 07 Nov 2020 07:39:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R7G/H9kkaCPgf9omo5gJX9tzyTuH6h0QN9DrKmiq5TM=; b=gqNbyJU1SwyyNX+SsmgoTRjHipeX7CDwIbFvQXGmZzGaknOaDgQpkeja16tWvP3wnN 3KYXffFO5fkyOlMbIb/vjSWOzmGLoHtdlFovRAnYrPeCTKztWbgA7dZqU9rIBGnCvo1f yxDCXzgdUQfvBBFCLnIrwdxODP2H4VabV8Ud2v47pqgsfbyBYJDAIFAAPkv8h7i71V8o WPl6TG9UUDtpgqPVg5YKnVBUdMJRPMxxiJtoip4HUr1tm1hLx1/RGnuzwSgQxPf3DeLy 6ErQ9zCEjkigffvBDmZr9K5gk+ugwERLDfy9/+tvKG/EgBZRLo+Ywr6mwsWTkEqbOgfF EoKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R7G/H9kkaCPgf9omo5gJX9tzyTuH6h0QN9DrKmiq5TM=; b=MTlSyuy2FUflEAz+ZoztdLVU3EUJ0NEgJkdK6VfzfkJxbpPmShSl0eDZAaiMqhFJJv sBlWVD/E+92bVDwj6GKpiAj7kzHY6sPlvgKMVO0yXop6Me8rldUqFPo4uCY+E65qHLtD FCBnDfUUP5KzUGWMQkig+mE8L2TfMmQSsi9yJZADbBvQmP0VoYbMIj6QzsFLckrQ5lf2 P+RwAEqLIB5HOmbqkgMK26f3Pct6W9/DZmxCHK3PKDbbF6PiGiFBEFts7MXueG389ocl SYwjH2gIo8a0v6XJZP+pTtNBfxJC3y3rwnQRTVblafPA30qDBInwqM6qy5RP1QTjvzbE x6sg== X-Gm-Message-State: AOAM531Dsw0GBMM7k6Nw5fP7LLpDQoEYHqUUz0rkwRFQrZ0e1nGrtr+W qEG1+K0f5pSTzXX0lzn+bTdPQ11B6GRPCVanQzo= X-Google-Smtp-Source: ABdhPJxDy5eECXutfNAiobQryJn2Ttluz9pX8cAdABsTHdSuocILYuINc8SfWlGA0ZU4813striOxtsdDCfe46kQuEI= X-Received: by 2002:a19:686:: with SMTP id 128mr1517103lfg.198.1604763592878; Sat, 07 Nov 2020 07:39:52 -0800 (PST) In-Reply-To: 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:192841 Archived-At: --000000000000e6f07905b3862342 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Nov 7, 2020 at 9:48 AM Pierre Rouleau wrote= : > On Sat, Nov 7, 2020 at 9:37 AM Eli Zaretskii wrote: > >> > From: Pierre Rouleau >> > Date: Sat, 7 Nov 2020 09:15:12 -0500 >> > Cc: dgutov@yandex.ru, 44494@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=3D=3D> prompts Visit tags table (default TAGS): .... >> > me =3D=3D=3D=3D> I select the TAGS file where all definitions are stor= ed and >> hit RET >> > - emacs 26.3 =3D=3D> Rerun etags: =E2=80=98^(defmacro cc-require =E2= =80=99 not found in >> > /usr/local/Cellar/emacs/26.3/share/emacs/26.3/lisp/progmod\ >> > es/cc-bytecomp.el >> > - emacs 27.1 =3D=3D> Rerun etags: =E2=80=98^(defmacro cc-require =E2= =80=99 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. --=20 /Pierre --000000000000e6f07905b3862342 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sat, Nov 7, 2020 at 9:48 AM Pierre Rouleau <prouleau001@gmail.com> wrote:
On Sat, Nov 7, = 2020 at 9:37 AM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Pierre Rouleau <prouleau001@gmail.com>
> Date: Sat, 7 Nov 2020 09:15:12 -0500
> Cc: dgutov@yande= x.ru, 44494@= debbugs.gnu.org
>
> To recap you need to try searching for something that is not already <= br> > loaded and use the etags xref backend with a file that contains the de= finition
> 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 "ema= cs
-Q".=C2=A0 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.=C2=A0 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=3D=3D> prompts Visit tags table (default TAGS): ....
> me =3D=3D=3D=3D> I select the TAGS file where all definitions are s= tored and hit RET
> - emacs 26.3 =3D=3D> Rerun etags: =E2=80=98^(defmacro cc-require = =E2=80=99 not found in
> /usr/local/Cellar/emacs/26.3/share/emacs/26.3/lisp/progmod\
> es/cc-bytecomp.el
> - emacs 27.1 =3D=3D> Rerun etags: =E2=80=98^(defmacro cc-require = =E2=80=99 not found in
> /usr/local/Cellar/emacs/27.1/share/emacs/27.1/lisp/progmodes/cc-byteco= mp.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<= /div>
(elisp--xref-backend t).

It fails with x= ref-find-definitions but works with find-tag.

I ag= ree there's a need to see what differs there.

= Thanks

--
/Pierre

One difference is that when using fi= nd-tag is using code from etags.el exclusively:
- find-tag-no= select
. - find-tag-in-order=C2=A0=C2=A0 , which tries different = predicates and the one that succeeds is tag-implicit-name-match-p
.=C2=A0 - it identifies the cc-bytecomp.el.gz=C2=A0
.- call= s etags-goto-tag-location

When using xref-find-def= inition the xref backend is used.=C2=A0 It's not the same code.=C2=A0 <= br>
The xref backend code for elisp does not find it.=C2=A0 The b= ackend code for etags does not find it either.
It tries to open c= c-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
--000000000000e6f07905b3862342--