- (function
- (lambda (d)
- (mapcar
- (function
- (lambda (f)
- (if (not (member f processed))
- (let (summary keystart keywords)
- (setq processed (cons f processed))
- (if (not finder-compile-keywords-quiet)
- (message "Processing %s ..." f))
- (save-excursion
- (set-buffer (get-buffer-create "*finder-scratch*"))
- (buffer-disable-undo (current-buffer))
- (erase-buffer)
- (insert-file-contents (expand-file-name f d))
- (condition-case err
- (setq summary (lm-synopsis)
- keywords (lm-keywords))
- (t (message "finder: error processing %s %S" f err))))
- (if (not summary)
- nil
- (insert (format " (\"%s\"\n " f))
- (prin1 summary (current-buffer))
- (insert "\n ")
- (setq keystart (point))
- (insert (if keywords (format "(%s)" keywords) "nil"))
- (subst-char-in-region keystart (point) ?, ? )
- (insert "\n ")
- (prin1 (abbreviate-file-name d) (current-buffer))
- (insert ")\n"))))))
- ;;
- ;; Skip null, non-existent or relative pathnames, e.g. "./", if
- ;; using load-path, so that they do not interfere with a scan of
- ;; library directories only.
- (if (and using-load-path
- (not (and d (file-name-absolute-p d) (file-exists-p d))))
- nil
- (setq d (file-name-as-directory (or d ".")))
- (directory-files d nil "^[^=].*\\.el$")))))
+ (lambda (d)
+ (mapcar
+ (lambda (f)
+ (when (and (not (member f processed)) (file-readable-p f))
+ (let (summary keystart keywords)
+ (setq processed (cons f processed))
+ (if (not finder-compile-keywords-quiet)
+ (message "Processing %s ..." f))
+ (save-excursion
+ (set-buffer (get-buffer-create "*finder-scratch*"))
+ (buffer-disable-undo (current-buffer))
+ (erase-buffer)
+ (insert-file-contents (expand-file-name f d))
+ (condition-case err
+ (setq summary (lm-synopsis)
+ keywords (lm-keywords))
+ (t (message "finder: error processing %s %S" f err))))
+ (when summary
+ (insert (format " (\"%s\"\n " f))
+ (prin1 summary (current-buffer))
+ (insert "\n ")
+ (setq keystart (point))
+ (insert (if keywords (format "(%s)" keywords) "nil"))
+ (subst-char-in-region keystart (point) ?, ? )
+ (insert "\n ")
+ (prin1 (abbreviate-file-name d) (current-buffer))
+ (insert ")\n")))))
+ ;;
+ ;; Skip null, non-existent or relative pathnames, e.g. "./", if
+ ;; using load-path, so that they do not interfere with a scan of
+ ;; library directories only.
+ (if (and using-load-path
+ (not (and d (file-name-absolute-p d) (file-exists-p d))))
+ nil
+ (setq d (file-name-as-directory (or d ".")))
+ (directory-files d nil "^[^=].*\\.el$"))))