# HG changeset patch # User Roland McGrath # Date 782687864 0 # Node ID a5bd0b6b080eb2cd92bcea638d8e3adbdfce3d39 # Parent 5410efcb7b6e97b1b04332bc68011f037c32b14d (next-file): Initialize next-file-list all at once from all tables. Never call visit-tags-table-buffer when INITIALIZE is not t. diff -r 5410efcb7b6e -r a5bd0b6b080e lisp/progmodes/etags.el --- 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))