From: Roland McGrath Date: Fri, 25 Aug 1995 16:39:34 +0000 (+0000) Subject: (next-file): Advance next-file-list before finding the file named in its X-Git-Tag: emacs-19.34~2918 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f042d383859e631c3f81bed06b7415a49f1db164;p=emacs.git (next-file): Advance next-file-list before finding the file named in its car, in case finding signals an error. --- diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index fb8ab956b2f..6d4dc28c674 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1280,16 +1280,19 @@ if the file was newly read in, the value is the filename." (get-buffer " *next-file*") (kill-buffer " *next-file*")) (error "All files processed.")) - (let ((new (not (get-file-buffer (car next-file-list))))) + (let* ((next (car next-file-list)) + (new (not (get-file-buffer next)))) + ;; Advance the list before trying to find the file. + ;; If we get an error finding the file, don't get stuck on it. + (setq next-file-list (cdr next-file-list)) (if (not (and new novisit)) - (set-buffer (find-file-noselect (car next-file-list) novisit)) + (set-buffer (find-file-noselect next novisit)) ;; Like find-file, but avoids random warning messages. (set-buffer (get-buffer-create " *next-file*")) (kill-all-local-variables) (erase-buffer) - (setq new (car next-file-list)) + (setq new next) (insert-file-contents new nil)) - (setq next-file-list (cdr next-file-list)) new)) (defvar tags-loop-operate nil