aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1994-10-20 21:17:44 +0000
committerRoland McGrath1994-10-20 21:17:44 +0000
commit5c9e49a953e19c82eea23b88549ffb394a02af33 (patch)
tree59ed2cf8a5af5c93f773e32f30a755cd6c81cb5a
parentb32701a7ff02dba163b010067559cb38c35d2d07 (diff)
downloademacs-5c9e49a953e19c82eea23b88549ffb394a02af33.tar.gz
emacs-5c9e49a953e19c82eea23b88549ffb394a02af33.zip
(next-file): Initialize next-file-list all at once from all tables.
Never call visit-tags-table-buffer when INITIALIZE is not t.
-rw-r--r--lisp/progmodes/etags.el32
1 files changed, 19 insertions, 13 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 42c43ee1f01..2cab15afec2 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1231,22 +1231,28 @@ if the file was newly read in, the value is the filename."
1231 (save-excursion 1231 (save-excursion
1232 ;; Visit the tags table buffer to get its list of files. 1232 ;; Visit the tags table buffer to get its list of files.
1233 (visit-tags-table-buffer) 1233 (visit-tags-table-buffer)
1234 (setq next-file-list (tags-table-files)))) 1234 ;; Copy the list so we can setcdr below.
1235 (setq next-file-list (copy-sequence (tags-table-files)))
1236 ;; Iterate over all the tags table files, collecting
1237 ;; a complete list of referenced file names.
1238 (while (visit-tags-table-buffer t)
1239 ;; Find the tail of the working list and chain on the new
1240 ;; sublist for this tags table.
1241 (let ((tail next-file-list))
1242 (while (cdr tail)
1243 (setq tail (cdr tail)))
1244 ;; Use a copy so the next loop iteration will not modify the
1245 ;; list later returned by (tags-table-files).
1246 (setcdr tail (copy-sequence (tags-table-files)))))))
1235 (t 1247 (t
1236 ;; Initialize the list by evalling the argument. 1248 ;; Initialize the list by evalling the argument.
1237 (setq next-file-list (eval initialize)))) 1249 (setq next-file-list (eval initialize))))
1238 (or next-file-list 1250 (if next-file-list
1239 (save-excursion 1251 ()
1240 ;; Get the files from the next tags table. 1252 (and novisit
1241 ;; When doing (visit-tags-table-buffer t), 1253 (get-buffer " *next-file*")
1242 ;; the tags table buffer must be current. 1254 (kill-buffer " *next-file*"))
1243 (if (and (visit-tags-table-buffer 'same) 1255 (error "All files processed."))
1244 (visit-tags-table-buffer t))
1245 (setq next-file-list (tags-table-files))
1246 (and novisit
1247 (get-buffer " *next-file*")
1248 (kill-buffer " *next-file*"))
1249 (error "All files processed."))))
1250 (let ((new (not (get-file-buffer (car next-file-list))))) 1256 (let ((new (not (get-file-buffer (car next-file-list)))))
1251 (if (not (and new novisit)) 1257 (if (not (and new novisit))
1252 (set-buffer (find-file-noselect (car next-file-list) novisit)) 1258 (set-buffer (find-file-noselect (car next-file-list) novisit))