ret-val))
;;;
-;; parsistent mark handling
-;; (for global!)
-
-(defvar elmo-msgdb-global-mark-alist nil)
-
-(defun elmo-msgdb-global-mark-delete (msgid)
- (let* ((path (expand-file-name
- elmo-msgdb-global-mark-filename
- elmo-msgdb-directory))
- (malist (or elmo-msgdb-global-mark-alist
- (setq elmo-msgdb-global-mark-alist
- (elmo-object-load path))))
- match)
- (when (setq match (assoc msgid malist))
- (setq elmo-msgdb-global-mark-alist
- (delete match elmo-msgdb-global-mark-alist))
- (elmo-object-save path elmo-msgdb-global-mark-alist))))
-
-(defun elmo-msgdb-global-mark-set (msgid mark)
- (let* ((path (expand-file-name
- elmo-msgdb-global-mark-filename
- elmo-msgdb-directory))
- (malist (or elmo-msgdb-global-mark-alist
- (setq elmo-msgdb-global-mark-alist
- (elmo-object-load path))))
- match)
- (if (setq match (assoc msgid malist))
- (setcdr match mark)
- (setq elmo-msgdb-global-mark-alist
- (nconc elmo-msgdb-global-mark-alist
- (list (cons msgid mark)))))
- (elmo-object-save path elmo-msgdb-global-mark-alist)))
-
-(defun elmo-msgdb-global-mark-get (msgid)
- (cdr (assoc msgid (or elmo-msgdb-global-mark-alist
- (setq elmo-msgdb-global-mark-alist
- (elmo-object-load
- (expand-file-name
- elmo-msgdb-global-mark-filename
- elmo-msgdb-directory)))))))
-
-;;;
;; persistent mark handling
;; (for each folder)
(defun elmo-msgdb-mark-alist-set (alist id mark msgdb)
(match-end matchn)) list)))
(nreverse list)))
+;;;
+;; parsistent mark handling
+;; (for global!)
+;; (FIXME: this should be treated in the msgdb.)
+
+(defvar elmo-msgdb-global-mark-alist nil)
+
+(defun elmo-msgdb-global-mark-delete (msgid)
+ (let* ((path (expand-file-name
+ elmo-msgdb-global-mark-filename
+ elmo-msgdb-directory))
+ (malist (or elmo-msgdb-global-mark-alist
+ (setq elmo-msgdb-global-mark-alist
+ (elmo-object-load path))))
+ match)
+ (when (setq match (assoc msgid malist))
+ (setq elmo-msgdb-global-mark-alist
+ (delete match elmo-msgdb-global-mark-alist))
+ (elmo-object-save path elmo-msgdb-global-mark-alist))))
+
+(defun elmo-msgdb-global-mark-set (msgid mark)
+ (let* ((path (expand-file-name
+ elmo-msgdb-global-mark-filename
+ elmo-msgdb-directory))
+ (malist (or elmo-msgdb-global-mark-alist
+ (setq elmo-msgdb-global-mark-alist
+ (elmo-object-load path))))
+ match)
+ (if (setq match (assoc msgid malist))
+ (setcdr match mark)
+ (setq elmo-msgdb-global-mark-alist
+ (nconc elmo-msgdb-global-mark-alist
+ (list (cons msgid mark)))))
+ (elmo-object-save path elmo-msgdb-global-mark-alist)))
+
+(defun elmo-msgdb-global-mark-get (msgid)
+ (cdr (assoc msgid (or elmo-msgdb-global-mark-alist
+ (setq elmo-msgdb-global-mark-alist
+ (elmo-object-load
+ (expand-file-name
+ elmo-msgdb-global-mark-filename
+ elmo-msgdb-directory)))))))
+
;;; File cache.
(defmacro elmo-make-file-cache (path status)
"PATH is the cache file name.
(defun elmo-file-cache-delete (path)
"Delete a cache on PATH."
- (when (file-exists-p path)
- (if (file-directory-p path)
- (progn
- (dolist (file (directory-files path t "^[^\\.]"))
- (delete-file file))
- (delete-directory path))
- (delete-file path))
- t))
+ (unless (elmo-msgdb-global-mark-get
+ (elmo-cache-to-msgid (file-name-nondirectory path)))
+ (when (file-exists-p path)
+ (if (file-directory-p path)
+ (progn
+ (dolist (file (directory-files path t "^[^\\.]"))
+ (delete-file file))
+ (delete-directory path))
+ (delete-file path))
+ t)))
(defun elmo-file-cache-exists-p (msgid)
"Returns 'section or 'entire if a cache which corresponds to MSGID exists."