From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83zh3t7hy8.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21501"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44494@debbugs.gnu.org To: Pierre Rouleau Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 07 08:20:10 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 1kbIWA-0005VJ-OX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Nov 2020 08:20:10 +0100 Original-Received: from localhost ([::1]:40848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbIW9-0007qP-Ba for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Nov 2020 02:20:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbIW2-0007qC-C0 for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 02:20:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46317) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbIW2-0005Cq-3B for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 02:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kbIW1-00038k-UZ for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 02:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Nov 2020 07:20:01 +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.160473354111988 (code B ref 44494); Sat, 07 Nov 2020 07:20:01 +0000 Original-Received: (at 44494) by debbugs.gnu.org; 7 Nov 2020 07:19:01 +0000 Original-Received: from localhost ([127.0.0.1]:57863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbIV3-00037F-D0 for submit@debbugs.gnu.org; Sat, 07 Nov 2020 02:19:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbIV1-000370-Sx for 44494@debbugs.gnu.org; Sat, 07 Nov 2020 02:19:00 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54840) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbIUw-0004rt-LB; Sat, 07 Nov 2020 02:18:54 -0500 Original-Received: from [176.228.60.248] (port=1499 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kbIUw-000737-1m; Sat, 07 Nov 2020 02:18:54 -0500 In-Reply-To: (message from Pierre Rouleau on Fri, 6 Nov 2020 18:22:46 -0500) 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:192811 Archived-At: > From: Pierre Rouleau > 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?