From: okada Date: Sun, 5 Nov 2000 17:54:53 +0000 (+0000) Subject: * elmo-imap4.el (elmo-imap4-list-folders): When hierarchy is X-Git-Tag: wl-2_4-root~10 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=33cff5ea35f842259850ff5b03b95c3633c675f2;p=elisp%2Fwanderlust.git * elmo-imap4.el (elmo-imap4-list-folders): When hierarchy is non-nil, make hierarchy. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index f181777..e41fdb2 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2000-11-06 Kenichi OKADA + + * elmo-imap4.el (elmo-imap4-list-folders): When hierarchy is + non-nil, make hierarchy. + 2000-11-05 OKAZAKI Tetsurou * elmo-pipe.el (elmo-pipe-drain): When calling `elmo-list-folder', diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 1d90519..f3d1327 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -567,11 +567,40 @@ BUFFER must be a single-byte buffer." (setq append-serv (concat append-serv (elmo-network-stream-type-spec-string type))))) - (mapcar (lambda (fld) - (concat "%" (elmo-imap4-decode-folder-string fld) - (and append-serv - (eval append-serv)))) - result))) + (if hierarchy + (let (folder folders ret) + (while (setq folders (car result)) + (if (prog1 + (string-match + (concat "^\\(" root "[^" delim "]" "+\\)" delim) + folders) + (setq folder (match-string 1 folders))) + (progn + (setq ret + (append ret (list (list + (concat "%" (elmo-imap4-decode-folder-string folder) + (and append-serv + (eval append-serv))))))) + (setq result + (delq nil + (mapcar '(lambda (fld) + (unless + (string-match + (concat "^" (regexp-quote folder)) + fld) + fld)) + result)))) + (setq ret (append ret (list + (concat "%" (elmo-imap4-decode-folder-string folders) + (and append-serv + (eval append-serv)))))) + (setq result (cdr result)))) + ret) + (mapcar (lambda (fld) + (concat "%" (elmo-imap4-decode-folder-string fld) + (and append-serv + (eval append-serv)))) + result)))) (defun elmo-imap4-folder-exists-p (spec) (let ((session (elmo-imap4-get-session spec)))