From: teranisi Date: Thu, 12 Apr 2001 04:02:00 +0000 (+0000) Subject: * elmo-util.el (elmo-file-cache-save): Ignore errors. X-Git-Tag: wl-2_6-root^3~52 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=26a149ca74c1ef84c3c02fc44c9f8ca3801ebdcc;p=elisp%2Fwanderlust.git * elmo-util.el (elmo-file-cache-save): Ignore errors. * elmo-net.el (elmo-message-fetch): Check cache-path is non-nil before saving. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index de28723..9f7ec8b 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,10 @@ +2001-04-12 Yuuichi Teranishi + + * 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 * elmo.el (elmo-folder-synchronize): Added optional no-check argument. diff --git a/elmo/elmo-net.el b/elmo/elmo-net.el index 022aeab..9d4c1e6 100644 --- a/elmo/elmo-net.el +++ b/elmo/elmo-net.el @@ -438,7 +438,8 @@ Returns a process object. if making session failed, returns nil." (current-buffer) unseen) (elmo-delete-cr-buffer) (when (and (> (buffer-size) 0) - (elmo-fetch-strategy-save-cache strategy)) + (elmo-fetch-strategy-save-cache strategy) + (elmo-fetch-strategy-cache-path strategy)) (elmo-file-cache-save (elmo-fetch-strategy-cache-path strategy) section)) diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 55f05d4..1c29b0f 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -1437,26 +1437,32 @@ SECTION is the section string." (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.