From: Eli Zaretskii <eliz@gnu.org>
To: Pierre Rouleau <prouleau001@gmail.com>
Cc: 44494@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 [thread overview]
Message-ID: <83zh3t7hy8.fsf@gnu.org> (raw)
In-Reply-To: <CALTqLiZ4ELYsP=Sabau7eoUu3LGvg0HiNxtH9FQfnq+ZFi-VWQ@mail.gmail.com> (message from Pierre Rouleau on Fri, 6 Nov 2020 18:22:46 -0500)
> From: Pierre Rouleau <prouleau001@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?
prev parent reply other threads:[~2020-11-07 7:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 23:22 bug#44494: etags.el xref-location-marker does not handle TAGS references to .el.gz files Pierre Rouleau
2020-11-07 2:22 ` Dmitry Gutov
2020-11-07 3:31 ` Pierre Rouleau
2020-11-07 8:00 ` Eli Zaretskii
2020-11-07 14:15 ` Pierre Rouleau
2020-11-07 14:22 ` Eli Zaretskii
2020-11-07 14:37 ` Eli Zaretskii
2020-11-07 14:48 ` Pierre Rouleau
2020-11-07 15:39 ` Pierre Rouleau
2020-11-07 15:52 ` Eli Zaretskii
2020-11-07 16:09 ` Pierre Rouleau
2020-11-07 7:18 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83zh3t7hy8.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=44494@debbugs.gnu.org \
--cc=prouleau001@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.