GNU bug report logs -
#44979
project-search fails with file-missing error
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Tue, 1 Dec 2020 03:16:02 UTC
Severity: normal
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
I have a few broken symlinks in the current project, and when doing a
search, it stops at the first one it sees, with a backtrace like
(file-missing "Opening input file" "No such file or directory"
"etc/etc/etc")
insert-file-contents("etc/etc/etc" nil)
(if (not (and new novisit)) (set-buffer (find-file-noselect next))
(set-buffer (get-buffer-create " *next-file*"))
(kill-all-local-variables) (erase-buffer) (setq new next)
(insert-file-contents new nil))
(let* ((buffer (get-file-buffer next)) (new (not buffer))) (and
buffer fileloop-revert-buffers (not (verify-visited-file-modtime
buffer)) (if (eq fileloop-revert-buffers 'silent) (and (not
(buffer-modified-p buffer)) (let ((revertible nil)) (let
((--dolist-tail-- revert-without-query)) (while --dolist-tail-- (let ...
... ...))) revertible)) (y-or-n-p (format (if (buffer-modified-p buffer)
"File %s changed on disk. Discard your edits? " "File %s changed on
disk. Reread from disk? ") next))) (save-current-buffer (set-buffer
buffer) (revert-buffer t t))) (if (not (and new novisit)) (set-buffer
(find-file-noselect next)) (set-buffer (get-buffer-create "
*next-file*")) (kill-all-local-variables) (erase-buffer) (setq new next)
(insert-file-contents new nil)) new)
(let ((next (condition-case nil (iter-next fileloop--iterator)
(iter-end-of-sequence nil)))) (if next nil (and novisit (get-buffer "
*next-file*") (kill-buffer " *next-file*")) (user-error "All files
processed")) (let* ((buffer (get-file-buffer next)) (new (not buffer)))
(and buffer fileloop-revert-buffers (not (verify-visited-file-modtime
buffer)) (if (eq fileloop-revert-buffers 'silent) (and (not
(buffer-modified-p buffer)) (let ((revertible nil)) (let (...) (while
--dolist-tail-- ...)) revertible)) (y-or-n-p (format (if
(buffer-modified-p buffer) "File %s changed on disk. Discard your
edits? " "File %s changed on disk. Reread from disk? ") next)))
(save-current-buffer (set-buffer buffer) (revert-buffer t t))) (if (not
(and new novisit)) (set-buffer (find-file-noselect next)) (set-buffer
(get-buffer-create " *next-file*")) (kill-all-local-variables)
(erase-buffer) (setq new next) (insert-file-contents new nil)) new))
fileloop-next-file(t)
Not such what's the best solution, but either all commands which use
fileloop should pre-filter the list with file-exists-p, or
fileloop-next-file should skip over nonexistent files. This seems to work:
diff --git a/lisp/fileloop.el b/lisp/fileloop.el
index b778eca8e9..289df6d593 100644
--- a/lisp/fileloop.el
+++ b/lisp/fileloop.el
@@ -120,7 +120,10 @@ fileloop-next-file
(kill-all-local-variables)
(erase-buffer)
(setq new next)
- (insert-file-contents new nil))
+ (condition-case nil
+ (insert-file-contents new nil)
+ (file-missing
+ (fileloop-next-file novisit))))
new)))
(defun fileloop-continue ()
This bug report was last modified 3 years and 294 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.