- (set-buffer (get-buffer-create " cus-dep temp"))
- (dolist (subdir command-line-args-left)
- (message "Directory %s" subdir)
- (let ((files (directory-files subdir nil "\\`[^=].*\\.el\\'"))
- (default-directory (expand-file-name subdir))
- (preloaded (concat "\\`"
- (regexp-opt (mapcar
- (lambda (f)
- (file-name-sans-extension
- (file-name-nondirectory f)))
- preloaded-file-list) t)
- "\\.el\\'")))
- (dolist (file files)
- (when (and (file-exists-p file)
- ;; Ignore files that are preloaded.
- (not (string-match preloaded file)))
- (erase-buffer)
- (insert-file-contents file)
- (goto-char (point-min))
- (string-match "\\`\\(.*\\)\\.el\\'" file)
- (let ((name (file-name-nondirectory (match-string 1 file)))
- (load-file-name file))
- (if (save-excursion
- (re-search-forward
+ (with-temp-buffer
+ (dolist (subdir command-line-args-left)
+ (message "Directory %s" subdir)
+ (let ((files (directory-files subdir nil "\\`[^=].*\\.el\\'"))
+ (default-directory (expand-file-name subdir))
+ (preloaded (concat "\\`"
+ (regexp-opt (mapcar
+ (lambda (f)
+ (file-name-sans-extension
+ (file-name-nondirectory f)))
+ preloaded-file-list) t)
+ "\\.el\\'")))
+ (dolist (file files)
+ (unless (or (string-match custom-dependencies-no-scan-regexp file)
+ (string-match preloaded file)
+ (not (file-exists-p file)))
+ (erase-buffer)
+ (insert-file-contents file)
+ (goto-char (point-min))
+ (string-match "\\`\\(.*\\)\\.el\\'" file)
+ (let ((name (file-name-nondirectory (match-string 1 file)))
+ (load-file-name file))
+ (if (save-excursion
+ (re-search-forward