* elmo-flag.el (elmo-folder-expand-msgdb-path): Define.
authorhmurata <hmurata>
Thu, 18 Sep 2003 07:57:01 +0000 (07:57 +0000)
committerhmurata <hmurata>
Thu, 18 Sep 2003 07:57:01 +0000 (07:57 +0000)
(elmo-folder-initialize): Use it.

elmo/ChangeLog
elmo/elmo-flag.el

index 9435a9d..10f6665 100644 (file)
@@ -1,7 +1,12 @@
+2003-09-18  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo-flag.el (elmo-folder-expand-msgdb-path): Define.
+       (elmo-folder-initialize): Use it.
+
 2003-09-18  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * 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.
        (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.
 
index 7c13b4c..52f1062 100644 (file)
       (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))))
                                       ":" (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