GNU bug report logs - #44494
etags.el xref-location-marker does not handle TAGS references to .el.gz files

Previous Next

Package: emacs;

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


Message #60 received at 44494 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: pot <at> gnu.org, 2807 <at> debbugs.gnu.org, prouleau001 <at> gmail.com,
 44494 <at> debbugs.gnu.org, dgutov <at> yandex.ru, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#2807: Subject: 23.0.90; etags can't access .el.gz files
Date: Thu, 12 Oct 2023 12:04:47 -0300
[Message part 1 (text/plain, inline)]
On 12/10/23 11:28, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
>> +(defun etags--ensure-file (file)
>> +  "Ensure FILE can be visited.
>> +
>> +FILE should be an expanded file name.
>> +This function tries to locate FILE, possibly adding it a suffix
>> +present in `tags-compression-info-list'.  If the file can't be found,
>> +signals an error.
>> +Else, returns the filename that can be visited for sure."
>> +  (let ((f (locate-file file nil tags-compression-info-list)))
>> +    (unless f
>> +      (signal 'file-missing (list "Cannot locate file in TAGS" file)))
>> +    f))
>
> The patch looks pretty good, but other parts of the code use
> check `auto-compression-mode` before using `tags-compression-info-list`,
> so we should probably do the same here.

Thank you!  Yes, I should've added that check.  I attach a patch that
incorporates the check.

> As other comments mention in the file, this arrangement is suboptimal
> because the search for compressed filenames should probably be moved to
> jka-compr's code (e.g. using `jka-compr-compression-info-list` rather
> than `tags-compression-info-list`).

Yes, but I opted to go with this simpler patch for a 24 year-old bug
report.

> Historical side note: jka-compr used to have the ability to do what we
> want here "transparently" (it changed things like `find-file-noselect`
> to look for compressed versions of the file, among other things).
> IIRC it was removed when it got integrated into Emacs (don't know why
> but I assumed it was too hackish/ugly/costly/brittle).
>
> We should arguably re-add this feature, tho maybe not transparent,
> i.e. let packages who need that request that feature explicitly (like
> here).
>

That's good to know, thank you.  And I agree that the feature would be
good to have, but I hope that in the meantime we can go with the updated
patch.
[0001-Fix-searching-for-tags-in-compressed-files.patch (text/x-patch, attachment)]

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.