* elmo-internal.el (elmo-folder-list-subfolders): Rewrite; Fixed
authorhmurata <hmurata>
Sun, 14 Dec 2003 10:26:06 +0000 (10:26 +0000)
committerhmurata <hmurata>
Sun, 14 Dec 2003 10:26:06 +0000 (10:26 +0000)
behavior when one-level is nil.

* elmo-flag.el (elmo-folder-list-subfolders): Defined.

* elmo-sendlog.el (elmo-folder-have-subfolder-p): Ditto.

elmo/ChangeLog
elmo/elmo-flag.el
elmo/elmo-internal.el
elmo/elmo-sendlog.el

index dae5dbd..664cab6 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-14  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo-internal.el (elmo-folder-list-subfolders): Rewrite; Fixed
+       behavior when one-level is nil.
+
+       * elmo-flag.el (elmo-folder-list-subfolders): Defined.
+
+       * elmo-sendlog.el (elmo-folder-have-subfolder-p): Ditto.
+
 2003-12-06  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * elmo.el (elmo-folder-set-info-max-by-numdb): Don't use `sort' to
index 895c99e..c7ed570 100644 (file)
    (expand-file-name ".minfo" (elmo-folder-msgdb-path folder))
    (elmo-flag-folder-minfo-internal folder)))
 
+(luna-define-method elmo-folder-list-subfolders ((folder elmo-flag-folder)
+                                                &optional one-level)
+  (mapcar (lambda (flag)
+           (concat
+            (elmo-folder-prefix-internal folder)
+            (symbol-name (elmo-folder-type-internal folder))
+            "/"
+            (symbol-name flag)))
+         elmo-global-flag-list))
+
 (defun elmo-flag-folder-delete-message (folder number
                                               &optional keep-referrer)
   (let* ((elem (elmo-get-hash-val (concat "#" (number-to-string number))
index 4de1308..ae489ea 100644 (file)
 
 (luna-define-method elmo-folder-list-subfolders ((folder elmo-internal-folder)
                                                 &optional one-level)
-  (mapcar
-   (lambda (x)
-     (if (elmo-folder-have-subfolder-p
-         (elmo-make-folder
-          (concat (elmo-folder-prefix-internal folder)
-                  (symbol-name x))))
-        (list (concat (elmo-folder-prefix-internal folder)
-                      (symbol-name x)))
-       (concat (elmo-folder-prefix-internal folder)
-              (symbol-name x))))
-   elmo-internal-folder-list))
+  (if one-level
+      (mapcar
+       (lambda (x)
+        (let ((name (concat (elmo-folder-prefix-internal folder)
+                            (symbol-name x))))
+          (if (elmo-folder-have-subfolder-p (elmo-make-folder name))
+              (list name)
+            name)))
+       elmo-internal-folder-list)
+    (apply #'nconc
+          (mapcar
+           (lambda (x)
+             (let* ((name (concat (elmo-folder-prefix-internal folder)
+                                  (symbol-name x)))
+                    (subfolder (elmo-make-folder name)))
+               (if (elmo-folder-have-subfolder-p subfolder)
+                   (elmo-folder-list-subfolders subfolder)
+                 (list name))))
+           elmo-internal-folder-list))))
 
 (require 'product)
 (product-provide (provide 'elmo-internal) (require 'elmo-version))
index 937d2a1..f0ce85b 100644 (file)
 (luna-define-method elmo-message-file-p ((folder elmo-sendlog-folder) number)
   t)
 
+(luna-define-method elmo-folder-have-subfolder-p ((folder elmo-sendlog-folder))
+  nil)
+
 (require 'product)
 (product-provide (provide 'elmo-sendlog) (require 'elmo-version))