+2013-08-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-decode.el (mm-temp-files-delete): Fix file deletion logic.
+
2013-08-19 Katsumi Yamaoka <yamaoka@jpl.org>
* mm-util.el (mm-coding-system-priorities): Exclude iso-2022-jp-2 and
(split-string (buffer-string) "\n" t))))
fails)
(dolist (temp (append cache mm-temp-files-to-be-deleted))
- (unless (and (file-exists-p temp)
- (if (file-directory-p temp)
- ;; A parent directory left at the previous time.
+ (when (and (file-exists-p temp)
+ (if (file-directory-p temp)
+ ;; A parent directory left at the previous time.
+ (progn
+ (ignore-errors (delete-directory temp))
+ (file-exists-p temp))
+ ;; Delete a temporary file and its parent directory.
+ (ignore-errors (delete-file temp))
+ (or (file-exists-p temp)
(progn
+ (setq temp (file-name-directory temp))
(ignore-errors (delete-directory temp))
- (not (file-exists-p temp)))
- ;; Delete a temporary file and its parent directory.
- (ignore-errors (delete-file temp))
- (and (not (file-exists-p temp))
- (progn
- (setq temp (file-name-directory temp))
- (ignore-errors (delete-directory temp))
- (not (file-exists-p temp))))))
+ (file-exists-p temp)))))
(push temp fails)))
(if fails
;; Schedule the deletion of the files left at the next time.