+2001-04-12 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-util.el (elmo-file-cache-save): Ignore errors.
+
+ * elmo-net.el (elmo-message-fetch): Check cache-path is non-nil before
+ saving.
+
2001-04-09 Yuuichi Teranishi <teranisi@gohome.org>
* elmo.el (elmo-folder-synchronize): Added optional no-check argument.
(elmo-file-cache-status (elmo-file-cache-get msgid)))
(defun elmo-file-cache-save (cache-path section)
- "Save current buffer as cache on PATH."
- (let ((path (if section (expand-file-name section cache-path) cache-path))
- files dir)
- (if (and (null section)
- (file-directory-p path))
- (progn
- (setq files (directory-files path t "^[^\\.]"))
- (while files
- (delete-file (car files))
- (setq files (cdr files)))
- (delete-directory path))
- (if (and section
- (not (file-directory-p cache-path)))
- (delete-file cache-path)))
- (when path
- (setq dir (directory-file-name (file-name-directory path)))
- (if (not (file-exists-p dir))
- (elmo-make-directory dir))
- (write-region-as-binary (point-min) (point-max)
- path nil 'no-msg))))
+ "Save current buffer as cache on PATH.
+Return t if cache is saved successfully."
+ (condition-case nil
+ (let ((path (if section (expand-file-name section cache-path)
+ cache-path))
+ files dir)
+ (if (and (null section)
+ (file-directory-p path))
+ (progn
+ (setq files (directory-files path t "^[^\\.]"))
+ (while files
+ (delete-file (car files))
+ (setq files (cdr files)))
+ (delete-directory path))
+ (if (and section
+ (not (file-directory-p cache-path)))
+ (delete-file cache-path)))
+ (when path
+ (setq dir (directory-file-name (file-name-directory path)))
+ (if (not (file-exists-p dir))
+ (elmo-make-directory dir))
+ (write-region-as-binary (point-min) (point-max)
+ path nil 'no-msg)
+ t))
+ ;; ignore error
+ (error)))
(defun elmo-file-cache-get (msgid &optional section)
"Returns the current file-cache object associated with MSGID.