aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/etags.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 01af927e301..58fcfcb84b9 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -29,6 +29,7 @@
29*File name of tags table. 29*File name of tags table.
30To switch to a new tags table, setting this variable is sufficient. 30To switch to a new tags table, setting this variable is sufficient.
31Use the `etags' program to make a tags table file.") 31Use the `etags' program to make a tags table file.")
32;;;###autoload (put 'tags-file-name 'variable-interactive "fVisit tags table: ")
32 33
33;;;###autoload 34;;;###autoload
34(defvar tags-table-list nil 35(defvar tags-table-list nil
@@ -89,8 +90,7 @@ nil means it has not yet been computed; use `tags-table-files' to do so.")
89;; Hooks for file formats. 90;; Hooks for file formats.
90 91
91(defvar tags-table-format-hooks '(etags-recognize-tags-table 92(defvar tags-table-format-hooks '(etags-recognize-tags-table
92 recognize-empty-tags-table 93 recognize-empty-tags-table)
93 ctags-recognize-tags-table)
94 "List of functions to be called in a tags table buffer to identify 94 "List of functions to be called in a tags table buffer to identify
95the type of tags table. The functions are called in order, with no arguments, 95the type of tags table. The functions are called in order, with no arguments,
96until one returns non-nil. The function should make buffer-local bindings 96until one returns non-nil. The function should make buffer-local bindings
@@ -164,7 +164,6 @@ file the tag was in."
164 default-directory) 164 default-directory)
165 t) 165 t)
166 current-prefix-arg)) 166 current-prefix-arg))
167 (setq file (abbreviate-file-name (expand-file-name file)))
168 (if (file-directory-p file) 167 (if (file-directory-p file)
169 (setq file (expand-file-name "TAGS" file))) 168 (setq file (expand-file-name "TAGS" file)))
170 (if local 169 (if local
@@ -260,6 +259,13 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
260 (revert-buffer t t) 259 (revert-buffer t t)
261 (initialize-new-tags-table))) 260 (initialize-new-tags-table)))
262 (set-buffer (find-file-noselect file)) 261 (set-buffer (find-file-noselect file))
262 (or (string= file buffer-file-name)
263 ;; find-file-noselect has changed the file name.
264 ;; Propagate the change to tags-file-name and tags-table-list.
265 (let ((tail (assoc file tags-table-list)))
266 (if tail
267 (setcar tail buffer-file-name))
268 (setq tags-file-name buffer-file-name)))
263 (initialize-new-tags-table)) 269 (initialize-new-tags-table))
264 270
265 (if (and put-in-list 271 (if (and put-in-list