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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pierre Rouleau <prouleau001 <at> gmail.com>
Cc: 44494 <at> debbugs.gnu.org
Subject: bug#44494: etags.el xref-location-marker does not handle TAGS references to .el.gz files
Date: Sat, 07 Nov 2020 09:18:55 +0200
> From: Pierre Rouleau <prouleau001 <at> gmail.com>
> Date: Fri, 6 Nov 2020 18:22:46 -0500
> 
> One could consider that the issue is inside the etags utility.

I don't think this is the best alternative.  TAGS tables are supposed
to provide information in a way that doesn't require re-running etags
each time some change in the sources is made.  The way things are now,
compressing or decompressing a file doesn't require re-running etags,
which is a Good Thing.

Handling this in the code which accesses and interprets TAGS sounds
like a better alternative.

> Here's a proposal for a solution:
> 
> (defun etags-file-or-compressed-file-for (fname)
>   "Return the valid file name for FNAME.
> Check if FNAME is an existing file name, if not
> try FNAME appended with the following compression extensions:
> - \".gz\", the extension of compressed files created by gzip
> - \".bz2\", the extension for compressed files created by bzip2
> - \".xz\", the extension for compressed files created by xz
> - \".lzma\", the extension for compressed files created by xz.
> 
> Return the file that exists or nil if nothing found."
>   (let ((fpath nil))
>     (cl-dolist (ext '(""
>                       ".gz"
>                       ".bz2"
>                       ".xz"
>                       ".lzma"))
>       (setq fpath (concat fname ext))
>       (when (file-exists-p fpath)
>         (cl-return fpath)))))

We already have in etags.el support for finding compressed files, see
tag-find-file-of-tag-noselect.  Can't that be reused?  If not, let's
at least reuse tags-compression-info-list, okay?




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.