From fffd0da7b44e04e4b5561841a9b246edb8b6e644 Mon Sep 17 00:00:00 2001 From: hmurata Date: Thu, 18 Sep 2003 07:57:01 +0000 Subject: [PATCH] * elmo-flag.el (elmo-folder-expand-msgdb-path): Define. (elmo-folder-initialize): Use it. --- elmo/ChangeLog | 11 ++++++++--- elmo/elmo-flag.el | 33 +++++++++++++++++---------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 9435a9d..10f6665 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,7 +1,12 @@ +2003-09-18 Hiroya Murata + + * elmo-flag.el (elmo-folder-expand-msgdb-path): Define. + (elmo-folder-initialize): Use it. + 2003-09-18 Yuuichi Teranishi * elmo-flag.el: New file. - + * elmo-mark.el: Removed. * modb-legacy.el (modb-legacy-new-mark, @@ -64,7 +69,7 @@ (elmo-folder-unflag-read): Ditto. (elmo-folder-flag-as-read): Ditto. (elmo-folder-unflag-answered): Ditto. - (elmo-folder-flag-as-answered): Ditto. + (elmo-folder-flag-as-answered): Ditto. * elmo-multi.el (elmo-folder-list-importants): Don't call elmo-folder-list-messages-with-global-mark. @@ -105,7 +110,7 @@ (elmo-map-folder-flag-as-answered): Ditto. (elmo-map-folder-unflag-answered): Ditto. - * elmo-localdir.el (elmo-folder-msgdb-create): Call + * elmo-localdir.el (elmo-folder-msgdb-create): Call `elmo-global-flags-set'. (elmo-global-flags-set): Added autoload setting. diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index 7c13b4c..52f1062 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -50,26 +50,22 @@ (setq name (match-string 1 name)) (setq name (symbol-name (car elmo-global-flag-list)))) (or (cdr (assq (intern name) elmo-global-flag-folder-alist)) - (progn - (unless (file-directory-p (expand-file-name (concat "flag/" name) - elmo-msgdb-directory)) - (elmo-make-directory (expand-file-name (concat "flag/" name) - elmo-msgdb-directory))) + (let (msgdb-path) + (elmo-flag-folder-set-flag-internal folder (intern name)) + ;; must be AFTER set flag slot. + (setq msgdb-path (elmo-folder-msgdb-path folder)) + (unless (file-directory-p msgdb-path) + (elmo-make-directory msgdb-path)) (elmo-localdir-folder-set-dir-name-internal - folder (expand-file-name (concat "flag/" name) - elmo-msgdb-directory)) + folder + msgdb-path) (elmo-localdir-folder-set-directory-internal folder - (expand-file-name (concat "flag/" name) - elmo-msgdb-directory)) - (if (file-exists-p (expand-file-name - (concat "flag/" name "/.minfo") - elmo-msgdb-directory)) + msgdb-path) + (if (file-exists-p (expand-file-name "/.minfo" msgdb-path)) (elmo-flag-folder-set-minfo-internal folder - (elmo-object-load (expand-file-name - (concat "flag/" name "/.minfo") - elmo-msgdb-directory)))) + (elmo-object-load (expand-file-name "/.minfo" msgdb-path)))) (elmo-flag-folder-set-minfo-hash-internal folder (elmo-make-hash (length (elmo-flag-folder-minfo-internal folder)))) @@ -84,11 +80,16 @@ ":" (car pair)) elem (elmo-flag-folder-minfo-hash-internal folder)))) - (elmo-flag-folder-set-flag-internal folder (intern name)) (setq elmo-global-flag-folder-alist (cons (cons (intern name) folder) elmo-global-flag-folder-alist)) folder))) +(luna-define-method elmo-folder-expand-msgdb-path ((folder elmo-flag-folder)) + (expand-file-name (concat "flag/" + (symbol-name + (elmo-flag-folder-flag-internal folder))) + elmo-msgdb-directory)) + (luna-define-method elmo-folder-commit :after ((folder elmo-flag-folder)) (elmo-object-save -- 1.7.10.4