changeset 9631:a5bd0b6b080e

(next-file): Initialize next-file-list all at once from all tables. Never call visit-tags-table-buffer when INITIALIZE is not t.
author Roland McGrath <roland@gnu.org>
date Thu, 20 Oct 1994 21:17:44 +0000
parents 5410efcb7b6e
children 833a19698ef3
files lisp/progmodes/etags.el
diffstat 1 files changed, 19 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/etags.el	Thu Oct 20 20:35:57 1994 +0000
+++ b/lisp/progmodes/etags.el	Thu Oct 20 21:17:44 1994 +0000
@@ -1231,22 +1231,28 @@
 	 (save-excursion
 	   ;; Visit the tags table buffer to get its list of files.
 	   (visit-tags-table-buffer)
-	   (setq next-file-list (tags-table-files))))
+	   ;; Copy the list so we can setcdr below.
+	   (setq next-file-list (copy-sequence (tags-table-files)))
+	   ;; Iterate over all the tags table files, collecting
+	   ;; a complete list of referenced file names.
+	   (while (visit-tags-table-buffer t)
+	     ;; Find the tail of the working list and chain on the new
+	     ;; sublist for this tags table.
+	     (let ((tail next-file-list))
+	       (while (cdr tail)
+		 (setq tail (cdr tail)))
+	       ;; Use a copy so the next loop iteration will not modify the
+	       ;; list later returned by (tags-table-files).
+	       (setcdr tail (copy-sequence (tags-table-files)))))))
 	(t
 	 ;; Initialize the list by evalling the argument.
 	 (setq next-file-list (eval initialize))))
-  (or next-file-list
-      (save-excursion
-	;; Get the files from the next tags table.
-	;; When doing (visit-tags-table-buffer t),
-	;; the tags table buffer must be current.
-	(if (and (visit-tags-table-buffer 'same)
-		 (visit-tags-table-buffer t))
-	    (setq next-file-list (tags-table-files))
-	  (and novisit
-	       (get-buffer " *next-file*")
-	       (kill-buffer " *next-file*"))
-	  (error "All files processed."))))
+  (if next-file-list
+      ()
+    (and novisit
+	 (get-buffer " *next-file*")
+	 (kill-buffer " *next-file*"))
+    (error "All files processed."))
   (let ((new (not (get-file-buffer (car next-file-list)))))
     (if (not (and new novisit))
 	(set-buffer (find-file-noselect (car next-file-list) novisit))