GNU bug report logs - #37673
[PATCH] Simplify the search of the default tags file in, `visit-tags-table'

Previous Next

Package: emacs;

Reported by: Hong Xu <hong <at> topbug.net>

Date: Wed, 9 Oct 2019 05:01:01 UTC

Severity: normal

Tags: patch

Done: Hong Xu <hong <at> topbug.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37673 in the body.
You can then email your comments to 37673 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#37673; Package emacs. (Wed, 09 Oct 2019 05:01:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hong Xu <hong <at> topbug.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 09 Oct 2019 05:01:02 GMT) Full text and rfc822 format available.

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

From: Hong Xu <hong <at> topbug.net>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Cc: Phil Sainty <psainty <at> orcon.net.nz>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: [PATCH] Simplify the search of the default tags file in,
 `visit-tags-table'
Date: Tue, 8 Oct 2019 21:59:40 -0700
* lisp/progmodes/etags.el (visit-tags-table): Reimplement
`tags--find-default-tags-dir-recursively' using the much simpler
`locate-dominating-file'. Following up bug#37518.
---
 lisp/progmodes/etags.el | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 906ab37c6b9f..6784894ba87e 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -274,19 +274,6 @@ tags-table-mode
   (setq buffer-undo-list t)
   (initialize-new-tags-table))

-(defun tags--find-default-tags-dir-recursively (current-dir)
-  "Find the directory in which the default TAGS file lives.
-It is the first directory that contains a file named TAGS
-encountered when recursively searching upward from CURRENT-DIR."
-  (let ((tag-filename (expand-file-name "TAGS" current-dir)))
-    (if (file-exists-p tag-filename)
-        current-dir
-      (let ((parent-dir
-             (file-name-directory (directory-file-name current-dir))))
-        (if (string= parent-dir current-dir)  ;; root dir is reached
-            nil
-          (tags--find-default-tags-dir-recursively parent-dir))))))
-
 ;;;###autoload
 (defun visit-tags-table (file &optional local)
   "Tell tags commands to use tags table file FILE.
@@ -301,7 +288,7 @@ visit-tags-table
 file the tag was in."
   (interactive
    (let ((default-tag-dir
-           (or (tags--find-default-tags-dir-recursively default-directory)
+           (or (locate-dominating-file default-directory "TAGS")
                default-directory)))
      (list (read-file-name
             "Visit tags table (default TAGS): "
--
2.20.1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37673; Package emacs. (Wed, 09 Oct 2019 05:05:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Hong Xu <hong <at> topbug.net>
Cc: Phil Sainty <psainty <at> orcon.net.nz>, bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: [PATCH] Simplify the search of the default tags file in,
 `visit-tags-table'
Date: Wed, 09 Oct 2019 07:04:04 +0200
Hong Xu <hong <at> topbug.net> writes:

> * lisp/progmodes/etags.el (visit-tags-table): Reimplement
> `tags--find-default-tags-dir-recursively' using the much simpler
> `locate-dominating-file'. Following up bug#37518.

Looks good to me; applied to Emacs 27 now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply sent to Hong Xu <hong <at> topbug.net>:
You have taken responsibility. (Sat, 12 Oct 2019 18:56:02 GMT) Full text and rfc822 format available.

Notification sent to Hong Xu <hong <at> topbug.net>:
bug acknowledged by developer. (Sat, 12 Oct 2019 18:56:02 GMT) Full text and rfc822 format available.

Message #13 received at 37673-done <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Phil Sainty <psainty <at> orcon.net.nz>, Eli Zaretskii <eliz <at> gnu.org>,
 37673-done <at> debbugs.gnu.org
Subject: Re: [PATCH] Simplify the search of the default tags file in,
 `visit-tags-table'
Date: Sat, 12 Oct 2019 11:55:29 -0700
On 10/8/19 10:04 PM, Lars Ingebrigtsen wrote:
> Looks good to me; applied to Emacs 27 now.
> 

Shall we close this one?





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 10 Nov 2019 12:24:15 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 226 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.