Mercurial > emacs
changeset 23230:6e0d3186be0d
(dired-mark-files-containing-regexp):
Don't scan directories. Ignore non-readable files.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 10 Sep 1998 16:00:20 +0000 |
parents | 9c8df6d5d40d |
children | 01c23b1e1c32 |
files | lisp/dired.el |
diffstat | 1 files changed, 15 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/dired.el Thu Sep 10 15:59:36 1998 +0000 +++ b/lisp/dired.el Thu Sep 10 16:00:20 1998 +0000 @@ -2165,19 +2165,21 @@ (and (not (looking-at dired-re-dot)) (not (eolp)) ; empty line (let ((fn (dired-get-filename nil t))) - (and fn (let ((prebuf (get-file-buffer fn))) - (message "Checking %s" fn) - ;; For now we do it inside emacs - ;; Grep might be better if there are a lot of files - (if prebuf - (with-current-buffer prebuf - (save-excursion - (goto-char (point-min)) - (re-search-forward regexp nil t))) - (with-temp-buffer - (insert-file-contents fn) - (goto-char (point-min)) - (re-search-forward regexp nil t)))) + (when (and fn (file-readable-p fn) + (not (file-directory-p fn))) + (let ((prebuf (get-file-buffer fn))) + (message "Checking %s" fn) + ;; For now we do it inside emacs + ;; Grep might be better if there are a lot of files + (if prebuf + (with-current-buffer prebuf + (save-excursion + (goto-char (point-min)) + (re-search-forward regexp nil t))) + (with-temp-buffer + (insert-file-contents fn) + (goto-char (point-min)) + (re-search-forward regexp nil t)))) ))) "matching file")))