- (let ((map-file (nneething-map-file))
- (files (directory-files nneething-directory))
- touched map-files)
- (if (file-exists-p map-file)
- (condition-case nil
- (load map-file nil t t)
- (error nil)))
- (or nneething-active (setq nneething-active (cons 1 0)))
- ;; Old nneething had a different map format.
- (when (and (cdar nneething-map)
- (atom (cdar nneething-map)))
- (setq nneething-map
- (mapcar (lambda (n)
- (list (cdr n) (car n)
- (nth 5 (file-attributes
- (nneething-file-name (car n))))))
- nneething-map)))
- ;; Remove files matching the exclusion regexp.
- (when nneething-exclude-files
- (let ((f files)
+ (when (file-exists-p nneething-address)
+ (let ((map-file (nneething-map-file))
+ (files (directory-files nneething-address))
+ touched map-files)
+ (when (file-exists-p map-file)
+ (ignore-errors
+ (load map-file nil t t)))
+ (unless nneething-active
+ (setq nneething-active (cons 1 0)))
+ ;; Old nneething had a different map format.
+ (when (and (cdar nneething-map)
+ (atom (cdar nneething-map)))
+ (setq nneething-map
+ (mapcar (lambda (n)
+ (list (cdr n) (car n)
+ (nth 5 (file-attributes
+ (nneething-file-name (car n))))))
+ nneething-map)))
+ ;; Remove files matching the exclusion regexp.
+ (when nneething-exclude-files
+ (let ((f files)
+ prev)
+ (while f
+ (if (string-match nneething-exclude-files (car f))
+ (if prev (setcdr prev (cdr f))
+ (setq files (cdr files)))
+ (setq prev f))
+ (setq f (cdr f)))))
+ ;; Remove files not matching the inclusion regexp.
+ (when nneething-include-files
+ (let ((f files)
+ prev)
+ (while f
+ (if (not (string-match nneething-include-files (car f)))
+ (if prev (setcdr prev (cdr f))
+ (setq files (cdr files)))
+ (setq prev f))
+ (setq f (cdr f)))))
+ ;; Remove deleted files from the map.
+ (let ((map nneething-map)