From e44cbc393d1ac544a676fa7c4c75b28db4f57759 Mon Sep 17 00:00:00 2001 From: hmurata Date: Sun, 14 Dec 2003 10:26:06 +0000 Subject: [PATCH] * 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. --- elmo/ChangeLog | 9 +++++++++ elmo/elmo-flag.el | 10 ++++++++++ elmo/elmo-internal.el | 30 +++++++++++++++++++----------- elmo/elmo-sendlog.el | 3 +++ 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index dae5dbd..664cab6 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,12 @@ +2003-12-14 Hiroya Murata + + * 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 * elmo.el (elmo-folder-set-info-max-by-numdb): Don't use `sort' to diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index 895c99e..c7ed570 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -96,6 +96,16 @@ (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)) diff --git a/elmo/elmo-internal.el b/elmo/elmo-internal.el index 4de1308..ae489ea 100644 --- a/elmo/elmo-internal.el +++ b/elmo/elmo-internal.el @@ -70,17 +70,25 @@ (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)) diff --git a/elmo/elmo-sendlog.el b/elmo/elmo-sendlog.el index 937d2a1..f0ce85b 100644 --- a/elmo/elmo-sendlog.el +++ b/elmo/elmo-sendlog.el @@ -135,6 +135,9 @@ (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)) -- 1.7.10.4