summaryrefslogtreecommitdiff
path: root/lisp/progmodes/etags.el
diff options
context:
space:
mode:
authorHong Xu <hong@topbug.net>2019-10-09 07:03:33 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-09 07:03:33 +0200
commit5f727c6342dff0c96d09f6c21ac99d0168569c62 (patch)
tree10c1fec37de6077fde7ed38d4f9871594dd1f9ba /lisp/progmodes/etags.el
parente8dd6c9d832faf8445fccbc65f05a5e6e6d48ba7 (diff)
downloademacs-5f727c6342dff0c96d09f6c21ac99d0168569c62.tar.gz
Fix up previous visit-tags-table change
* 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.
Diffstat (limited to 'lisp/progmodes/etags.el')
-rw-r--r--lisp/progmodes/etags.el15
1 files changed, 1 insertions, 14 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 906ab37c6b9..6784894ba87 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -274,19 +274,6 @@ buffer-local and set them to nil."
(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 @@ in is given a local value of this variable which is the name of the tags
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): "