[mew-dist 25793] Re: リモートフォルダ(のローカルキャッシュ)対応 mew-nmz.el
Hideyuki SHIRAI ( 白井秀行 )
shirai at example.com
2004年 12月 22日 (水) 14:38:38 JST
From: Kazu Yamamoto (山本和彦) <kazu at example.com> さん曰く
Subject: [mew-dist 25791] Re: リモートフォルダ(のローカルキャッシュ)対応 mew-nmz.el
Message-ID: <20041222.112408.141560893.kazu at example.com>
Date: Wed, 22 Dec 2004 11:24:08 +0900 (JST)
> Mew 4.1.52 を出していいのかなぁ。
> 夕方ぐらいに出すかなぁ。
4.2 前の最後(?)の diff です。
>> (6) nmz-virtual や nmz-namazu のときの検索対象フォルダの指定方法
>> が case 対応やリモートフォルダ対応で変わりました。
>>
>> 例:
>> "*:*" => すべての case のすべてのフォルダ対象
>> "*" => default case のすべてのフォルダ対象
>> "%" とか "%*" => default case のすべての imap フォルダ対象
>> "hoge:*" => case "hoge" のすべてのフォルダ対象
>> "hoge:%" とか "hoge:%*" => case "hoge" のすべてを imap フォルダの対象
>> "hoge:%foo*" => case "hoge" の %foo ではじまるフォルダすべてを対象
>> "+ml/mew-*" => "+ml/mew-" ではじまるフォルダ全部(前と一緒)
"*:%" => すべての case の imap
のように case に "*" を指定できるようにしました。
# "*:*" は例外的に処理をしているの。
--
白井秀行 (mailto:shirai at example.com)
Index: mew-nmz.el
===================================================================
RCS file: /cvsmew/mew/mew-nmz.el,v
retrieving revision 1.6
diff -u -u -r1.6 mew-nmz.el
--- mew-nmz.el 21 Dec 2004 14:45:13 -0000 1.6
+++ mew-nmz.el 22 Dec 2004 05:33:25 -0000
@@ -624,7 +624,7 @@
;; all folder search
(message "Searching %s...all folders" message)
(setq range (mew-nmz-multi-pick
- (mew-nmz-expand-folder-regexp "*")
+ (mew-nmz-expand-folder-regexp "*:*")
(car pattern) 'catch))
(if (null range)
(setq pattern (cdr pattern))
@@ -1061,7 +1061,8 @@
(while retmsgs
(setq sortfld (cons (car (car retmsgs)) sortfld))
(setq retmsgs (cdr retmsgs)))
- (setq sortfld (sort sortfld 'string<))
+ ;; no sort
+ ;; (setq sortfld (sort sortfld 'string<))
(while sortfld
(setq cell (assoc (car sortfld) intmsgs))
(setq retmsgs
@@ -1090,7 +1091,8 @@
(while (setq fld (car flds))
(setq fld (mew-nmz-case-folder-normalize (directory-file-name fld)))
(cond
- ((string-match suffix fld)
+ ((or (string-match suffix fld)
+ (string-match "^\\*" fld))
(setq nmzdirs (append nmzdirs
(mew-nmz-expand-folder-regexp fld))))
((setq tmp (mew-nmz-folder-to-nmzdir fld))
@@ -1101,19 +1103,22 @@
(defun mew-nmz-expand-folder-regexp (case:folder)
(mew-nmz-setup)
(let ((alist mew-nmz-fld-index-alist)
- (case (mew-case:folder-case case:folder))
- (fld (mew-case:folder-folder case:folder))
- caseregex nmzdirs tmpfld nmzdir protos newcase)
+ case fld caseregex nmzdirs tmpfld nmzdir protos newcase)
(if (string= case:folder "*:*")
;; all case, all proto, all folder
(while alist
(setq nmzdirs (cons (cdr (car alist)) nmzdirs))
(setq alist (cdr alist)))
+ (if (string-match "^\\([^:]+\\):\\(.*\\)$" case:folder)
+ (setq case (match-string 1 case:folder)
+ fld (match-string 2 case:folder))
+ (setq case "")
+ (setq fld case:folder))
(when (string-match "^.*\\*$" fld)
(setq fld (substring fld 0 -1))
(setq fld (directory-file-name fld)))
(cond
- ((not case)
+ ((string= case "*")
;; all case
(setq caseregex "^\\([^:]+:\\)?"))
((or (string= case "") (string= mew-case-default case))
@@ -1138,7 +1143,7 @@
(setq caseregex "^")
(setq caseregex (concat "^" (regexp-quote case) ":")))))
(if (string= fld "")
- (setq caseregex (concat caseregex "[^:]+"))
+ (setq caseregex (concat caseregex "[^:]+$"))
(setq caseregex (concat caseregex (regexp-quote fld))))
(while alist
(setq tmpfld (car (car alist)))
@@ -1146,7 +1151,7 @@
(when (string-match caseregex tmpfld)
(setq nmzdirs (cons nmzdir nmzdirs)))
(setq alist (cdr alist))))
- (nreverse nmzdirs)))
+ nmzdirs))
(defun mew-nmz-goto-folder-msg (fld msg &optional pos)
(mew-summary-visit-folder fld)
@@ -1316,7 +1321,7 @@
(file-exists-p (expand-file-name "NMZ.i" nmzdir)))))
(defun mew-nmz-gather-indexed-folder (case folders-alist &optional nntp)
- (let (fld nmzdir)
+ (let (fld nmzdir fld-index-alist url-fld-alist)
(unless case (setq case ""))
(while (setq fld (car (car folders-alist)))
(setq fld (directory-file-name (if (string= case "")
@@ -1327,11 +1332,15 @@
(setq nmzdir (mew-nmz-expand-folder fld))
(file-directory-p nmzdir)
(file-exists-p (expand-file-name "NMZ.i" nmzdir)))
- (setq mew-nmz-fld-index-alist
- (cons (cons fld nmzdir) mew-nmz-fld-index-alist))
- (setq mew-nmz-url-fld-alist
- (cons (cons (mew-expand-folder fld) fld) mew-nmz-url-fld-alist)))
- (setq folders-alist (cdr folders-alist)))))
+ (setq fld-index-alist
+ (cons (cons fld nmzdir) fld-index-alist))
+ (setq url-fld-alist
+ (cons (cons (mew-expand-folder fld) fld) url-fld-alist)))
+ (setq folders-alist (cdr folders-alist)))
+ (setq mew-nmz-fld-index-alist (append mew-nmz-fld-index-alist
+ (nreverse fld-index-alist)))
+ (setq mew-nmz-url-fld-alist (append mew-nmz-url-fld-alist
+ (nreverse url-fld-alist)))))
(defun mew-nmz-setup ()
(unless mew-nmz-setup-p
@@ -1365,19 +1374,20 @@
(setq case-alist (cons (cons case case) case-alist))
(setq gcase (cons case gcase)))
(setq cases (cdr cases)))
+ (setq gcase (nreverse gcase))
(cond
((mew-folder-imapp (car prefixes))
- (setq mew-nmz-imap-case-alist case-alist)
+ (setq mew-nmz-imap-case-alist (nreverse case-alist))
(while (setq case (car gcase))
(mew-nmz-gather-indexed-folder case (mew-imap-folder-alist case))
(setq gcase (cdr gcase))))
((mew-folder-popp (car prefixes))
- (setq mew-nmz-pop-case-alist case-alist)
+ (setq mew-nmz-pop-case-alist (nreverse case-alist))
(while (setq case (car gcase))
(mew-nmz-gather-indexed-folder case `((,mew-pop-inbox-folder)))
(setq gcase (cdr gcase))))
((mew-folder-nntpp (car prefixes))
- (setq mew-nmz-nntp-case-alist case-alist)
+ (setq mew-nmz-nntp-case-alist (nreverse case-alist))
(while (setq case (car gcase))
(mew-nmz-gather-indexed-folder case (mew-nntp-folder-alist case) 'nntp)
(setq gcase (cdr gcase))))
Mew-dist メーリングリストの案内