Commit a5024e2a authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(visit-tags-table-buffer): New local named

visit-tags-table-buffer-cont copies cont.
(tags-table-including): Set that, instead of cont.
parent 280a6a9f
......@@ -259,6 +259,10 @@ file the tag was in."
(setq list (cdr list)))
list)
;; Local var in visit-tags-table-buffer-cont
;; which is set by tags-table-including.
(defvar visit-tags-table-buffer-cont)
;; Subroutine of visit-tags-table-buffer. Frobs its local vars.
;; Search TABLES for one that has tags for THIS-FILE. Recurses on
;; included tables. Returns the tail of TABLES (or of an inner
......@@ -312,10 +316,11 @@ file the tag was in."
tags-table-parent-pointer-list)
tags-table-list-pointer found
tags-table-list-started-at found
;; CONT is a local variable of
;; Set a local variable of
;; our caller, visit-tags-table-buffer.
;; Set it so we won't frob lists later.
cont 'included)))
visit-tags-table-buffer-cont
'included)))
(or recursing
;; tags-table-parent-pointer-list now describes
;; the path of included tables taken by recursive
......@@ -343,17 +348,19 @@ If arg is nil or absent, choose a first buffer from information in
Returns t if it visits a tags table, or nil if there are no more in the list."
;; Set tags-file-name to the tags table file we want to visit.
(cond ((eq cont 'same)
(let ((visit-tags-table-buffer-cont cont))
(cond ((eq visit-tags-table-buffer-cont 'same)
;; Use the ambient value of tags-file-name.
(or tags-file-name
(error (substitute-command-keys
(concat "No tags table in use! "
"Use \\[visit-tags-table] to select one."))))
;; Set CONT to nil so the code below will make sure tags-file-name
;; Set VISIT-TAGS-TABLE-BUFFER-CONT to nil
;; so the code below will make sure tags-file-name
;; is in tags-table-list.
(setq cont nil))
(setq visit-tags-table-buffer-cont nil))
(cont
(visit-tags-table-buffer-cont
;; Find the next table.
(if (tags-next-table)
;; Skip over nonexistent files.
......@@ -374,7 +381,8 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
;; Third, look for a tags table that contains
;; tags for the current buffer's file.
;; If one is found, the lists will be frobnicated,
;; and CONT will be set non-nil so we don't do it below.
;; and VISIT-TAGS-TABLE-BUFFER-CONT
;; will be set non-nil so we don't do it below.
(car (or
;; First check only tables already in buffers.
(save-excursion (tags-table-including buffer-file-name
......@@ -410,7 +418,7 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
;; Expand the table name into a full file name.
(setq tags-file-name (tags-expand-table-name tags-file-name))
(if (and (eq cont t) (null tags-table-list-pointer))
(if (and (eq visit-tags-table-buffer-cont t) (null tags-table-list-pointer))
;; All out of tables.
nil
......@@ -444,7 +452,7 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
;; doesn't get in the user's way.
(bury-buffer (current-buffer))
(if cont
(if visit-tags-table-buffer-cont
;; No list frobbing required.
nil
......@@ -496,7 +504,7 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
(kill-local-variable 'tags-file-name)
(if (eq file tags-file-name)
(setq tags-file-name nil)))
(error "File %s is not a valid tags table" buffer-file-name))))
(error "File %s is not a valid tags table" buffer-file-name)))))
(defun file-of-tag ()
"Return the file name of the file whose tags point is within.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment