From 982e4771c9b26f71d3c0d765ccff8e8914ac3127 Mon Sep 17 00:00:00 2001 From: yoichi Date: Tue, 4 Feb 2003 17:40:00 +0000 Subject: [PATCH] * elmo-shimbun.el (elmo-folder-initialize): Do not call shimbun-open in case of "@". (elmo-folder-open-internal): Cope with shimbun = nil case. (elmo-folder-plugged-p): Ditto. (elmo-folder-list-subfolders): Make list for "@/" group. --- elmo/ChangeLog | 8 ++++ elmo/elmo-shimbun.el | 113 +++++++++++++++++++++++++++++++------------------- 2 files changed, 78 insertions(+), 43 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index af26b9a..26dc940 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,11 @@ +2003-02-05 Yoichi NAKAYAMA + + * elmo-shimbun.el (elmo-folder-initialize): Do not call + shimbun-open in case of "@". + (elmo-folder-open-internal): Cope with shimbun = nil case. + (elmo-folder-plugged-p): Ditto. + (elmo-folder-list-subfolders): Make list for "@/" group. + 2003-01-31 Yoichi NAKAYAMA * elmo-imap4.el (elmo-folder-expand-msgdb-path): Don't expand diff --git a/elmo/elmo-shimbun.el b/elmo/elmo-shimbun.el index 1e2bf02..b7d989f 100644 --- a/elmo/elmo-shimbun.el +++ b/elmo/elmo-shimbun.el @@ -215,41 +215,44 @@ update overview when message is fetched." (luna-define-method elmo-folder-initialize ((folder elmo-shimbun-folder) name) - (let ((server-group (if (string-match "\\([^.]+\\)\\." name) - (list (elmo-match-string 1 name) - (substring name (match-end 0))) - (list name)))) - (when (nth 0 server-group) ; server - (elmo-shimbun-folder-set-shimbun-internal + (if (string= name "") + folder + (let ((server-group (if (string-match "\\([^.]+\\)\\." name) + (list (elmo-match-string 1 name) + (substring name (match-end 0))) + (list name)))) + (when (nth 0 server-group) ; server + (elmo-shimbun-folder-set-shimbun-internal + folder + (shimbun-open (nth 0 server-group) + (luna-make-entity 'shimbun-elmo-mua :folder folder)))) + (when (nth 1 server-group) + (elmo-shimbun-folder-set-group-internal + folder + (nth 1 server-group))) + (elmo-shimbun-folder-set-range-internal folder - (shimbun-open (nth 0 server-group) - (luna-make-entity 'shimbun-elmo-mua :folder folder)))) - (when (nth 1 server-group) - (elmo-shimbun-folder-set-group-internal - folder - (nth 1 server-group))) - (elmo-shimbun-folder-set-range-internal - folder - (or (cdr (elmo-string-matched-assoc (elmo-folder-name-internal folder) - elmo-shimbun-index-range-alist)) - elmo-shimbun-default-index-range)) - folder)) + (or (cdr (elmo-string-matched-assoc (elmo-folder-name-internal folder) + elmo-shimbun-index-range-alist)) + elmo-shimbun-default-index-range)) + folder))) (luna-define-method elmo-folder-open-internal ((folder elmo-shimbun-folder)) - (shimbun-open-group - (elmo-shimbun-folder-shimbun-internal folder) - (elmo-shimbun-folder-group-internal folder)) - (let ((inhibit-quit t)) - (unless (elmo-map-folder-location-alist-internal folder) - (elmo-map-folder-location-setup - folder - (elmo-msgdb-location-load (elmo-folder-msgdb-path folder)))) - (when (and (elmo-folder-plugged-p folder) - (elmo-shimbun-headers-check-p folder)) - (elmo-shimbun-get-headers folder) - (elmo-map-folder-update-locations - folder - (elmo-map-folder-list-message-locations folder))))) + (when (elmo-shimbun-folder-shimbun-internal folder) + (shimbun-open-group + (elmo-shimbun-folder-shimbun-internal folder) + (elmo-shimbun-folder-group-internal folder)) + (let ((inhibit-quit t)) + (unless (elmo-map-folder-location-alist-internal folder) + (elmo-map-folder-location-setup + folder + (elmo-msgdb-location-load (elmo-folder-msgdb-path folder)))) + (when (and (elmo-folder-plugged-p folder) + (elmo-shimbun-headers-check-p folder)) + (elmo-shimbun-get-headers folder) + (elmo-map-folder-update-locations + folder + (elmo-map-folder-list-message-locations folder)))))) (luna-define-method elmo-folder-reserve-status-p ((folder elmo-shimbun-folder)) t) @@ -277,9 +280,11 @@ update overview when message is fetched." (luna-define-method elmo-folder-plugged-p ((folder elmo-shimbun-folder)) (elmo-plugged-p "shimbun" - (shimbun-server-internal (elmo-shimbun-folder-shimbun-internal folder)) + (and (elmo-shimbun-folder-shimbun-internal folder) + (shimbun-server-internal (elmo-shimbun-folder-shimbun-internal folder))) nil nil - (shimbun-server-internal (elmo-shimbun-folder-shimbun-internal folder)))) + (and (elmo-shimbun-folder-shimbun-internal folder) + (shimbun-server-internal (elmo-shimbun-folder-shimbun-internal folder))))) (luna-define-method elmo-folder-set-plugged ((folder elmo-shimbun-folder) plugged &optional add) @@ -490,15 +495,37 @@ update overview when message is fetched." (luna-define-method elmo-folder-list-subfolders ((folder elmo-shimbun-folder) &optional one-level) - (unless (elmo-shimbun-folder-group-internal folder) - (mapcar - (lambda (x) - (concat (elmo-folder-prefix-internal folder) - (shimbun-server-internal - (elmo-shimbun-folder-shimbun-internal folder)) - "." - x)) - (shimbun-groups (elmo-shimbun-folder-shimbun-internal folder))))) + (let ((prefix (elmo-folder-prefix-internal folder))) + (cond ((elmo-shimbun-folder-shimbun-internal folder) + (unless (elmo-shimbun-folder-group-internal folder) + (mapcar + (lambda (fld) + (concat prefix + (shimbun-server-internal + (elmo-shimbun-folder-shimbun-internal folder)) + "." fld)) + (shimbun-groups (elmo-shimbun-folder-shimbun-internal folder))))) + ;; the rest are for "@/" group + (one-level + (mapcar + (lambda (server) (list (concat prefix server))) + (shimbun-servers-list))) + (t + (let (folders) + (dolist (server (shimbun-servers-list)) + (setq folders + (append folders + (mapcar + (lambda (fld) (concat prefix server "." fld)) + (shimbun-groups + (shimbun-open server + (let ((fld + (elmo-make-folder + (concat prefix server)))) + (luna-make-entity + 'shimbun-elmo-mua + :folder fld)))))))) + folders))))) (luna-define-method elmo-folder-exists-p ((folder elmo-shimbun-folder)) (if (elmo-shimbun-folder-group-internal folder) -- 1.7.10.4