[Mew-dist 07749] Re: things to do
Kazu Yamamoto ( 山本和彦 )
kazu at example.com
1999年 2月 26日 (金) 11:10:49 JST
ドイツ語モード前(謎)の山本です。
From: Kazumi HARA <hara at example.com>
Subject: [Mew-dist 07675] Re: things to do
Date: Wed, 24 Feb 1999 15:05:27 +0900
> ・mew-inbox-folder (InboxFolder) が Config に応じて切り替えられる
> 事が出来ればありがたいです。
>
> つたない知識を基に、自分が対応しようとしていたヘナチョコ・アイデアとし
> ては ~/.emacs で
>
> (setq mew-config-imget-alist
> '(("kollege" . "+inboxko")
> ("spiel" . "+inboxsp")
> ("default" . "+inbox")))
>
> みたいなものをでっち上げて、うまい事やろうと思っては見たものの、時間も
> 無く、サクサクって書けないので、楽な方へ傾いちゃってます (^^;;
というわけで、作りました。以下のような Config があったとします。
case mew
InboxFolder=+ixmew
case wide
InboxFolder=+ixwide
以下のパッチをあてると impath --path は
ConfigCaseInbox=wide:+ixwide,mew:+ixmew
のように、case とフォルダのペアを返します。
また、以下のパッチを当てると起動時に Mew は、
mew-config-case-inbox -> '(("wide" "+ixwide") ("mew" "+ixmew"))
という alist を作ります。
といわけで、"C" で case を変えると、"i" したときに imget に適切な
--config=case が渡り、適切なフォルダにメッセージを読み込みます。
これは希望通りの動作をするか確認してもらうためのお試し番です。
mew-inbox-folder を使っている関数は "i" 以外にもたくさんあるので、おそ
らくまだ変更が必要でしょう。
とりあえず試して下さい。
--かず
-------------- next part --------------
Index: mew-scan.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-scan.el,v
retrieving revision 1.34
diff -c -r1.34 mew-scan.el
*** mew-scan.el 1999/02/23 07:37:58 1.34
--- mew-scan.el 1999/02/26 02:05:11
***************
*** 15,50 ****
(defun mew-summary-get (&optional arg)
"Get +inbox asynchronously."
(interactive "P")
! (if (get-buffer mew-inbox-folder)
! (switch-to-buffer mew-inbox-folder)
! (mew-summary-folder-create mew-inbox-folder))
! (if (and mew-summary-trace-directory
! (not (mew-folder-newsp mew-inbox-folder)))
! (cd (mew-expand-folder mew-inbox-folder)))
! (mew-summary-folder-cache-manage mew-inbox-folder)
! (if (and mew-summary-cache-use (mew-summary-folder-dir-newp))
! (progn
! ;; scan the gap
! (or arg (goto-char (point-max)))
! (mew-summary-scan-body mew-prog-imls
! 'mew-summary-mode
! mew-inbox-folder
! mew-cs-scan
! (mew-input-range mew-inbox-folder))
! ;; wait for asynchronous process
! (if mew-xemacs-p
! (while mew-summary-buffer-process
! (accept-process-output)
! (sit-for 0.1)) ;; to flush
! (while mew-summary-buffer-process (sit-for 1)))
! ))
! (set-marker mew-summary-inbox-position (point) (current-buffer))
! ;; for C-xC-x
! (or arg (goto-char (point-max)))
! (mew-summary-scan-body mew-prog-imget
! 'mew-summary-mode
! mew-inbox-folder
! mew-cs-scan))
(defun mew-summary-exchange-point ()
(interactive)
--- 15,58 ----
(defun mew-summary-get (&optional arg)
"Get +inbox asynchronously."
(interactive "P")
! (let (inbox)
! (cond
! ((string= mew-config-imget mew-config-default);; this may be lengthy
! (setq inbox mew-inbox-folder))
! ((assoc mew-config-imget mew-config-case-inbox)
! (setq inbox (nth 1 (assoc mew-config-imget mew-config-case-inbox))))
! (t
! (setq inbox inbox)))
! (if (get-buffer inbox)
! (switch-to-buffer inbox)
! (mew-summary-folder-create inbox))
! (if (and mew-summary-trace-directory
! (not (mew-folder-newsp inbox)))
! (cd (mew-expand-folder inbox)))
! (mew-summary-folder-cache-manage inbox)
! (if (and mew-summary-cache-use (mew-summary-folder-dir-newp))
! (progn
! ;; scan the gap
! (or arg (goto-char (point-max)))
! (mew-summary-scan-body mew-prog-imls
! 'mew-summary-mode
! inbox
! mew-cs-scan
! (mew-input-range inbox))
! ;; wait for asynchronous process
! (if mew-xemacs-p
! (while mew-summary-buffer-process
! (accept-process-output)
! (sit-for 0.1));; to flush
! (while mew-summary-buffer-process (sit-for 1)))
! ))
! (set-marker mew-summary-inbox-position (point) (current-buffer))
! ;; for C-xC-x
! (or arg (goto-char (point-max)))
! (mew-summary-scan-body mew-prog-imget
! 'mew-summary-mode
! inbox
! mew-cs-scan)))
(defun mew-summary-exchange-point ()
(interactive)
Index: mew.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew.el,v
retrieving revision 1.132
diff -c -r1.132 mew.el
*** mew.el 1999/02/25 03:04:40 1.132
--- mew.el 1999/02/26 01:58:19
***************
*** 151,156 ****
--- 151,157 ----
(defvar mew-trash-folder nil)
(defvar mew-imap-account nil)
(defvar mew-config-cases nil)
+ (defvar mew-config-case-inbox nil)
(defvar mew-path-alist
'(("MailPath" . mew-mail-path)
***************
*** 162,168 ****
("AliasFile" . mew-alias-file)
("PetnameFile" . mew-petname-file)
("ImapAccount" . mew-imap-account)
! ("ConfigCases" . mew-config-cases)))
(defvar mew-draft-mime-folder nil)
--- 163,170 ----
("AliasFile" . mew-alias-file)
("PetnameFile" . mew-petname-file)
("ImapAccount" . mew-imap-account)
! ("ConfigCases" . mew-config-cases)
! ("ConfigCaseInbox" . mew-config-case-inbox)))
(defvar mew-draft-mime-folder nil)
***************
*** 189,194 ****
--- 191,203 ----
(forward-line)))
(if mew-config-cases
(setq mew-config-list (mew-split mew-config-cases ?,)))
+ (if mew-config-case-inbox
+ (let (tmp)
+ (setq mew-config-case-inbox (mew-split mew-config-case-inbox ?,))
+ (while mew-config-case-inbox
+ (setq tmp (cons (mew-split (car mew-config-case-inbox) ?:) tmp))
+ (setq mew-config-case-inbox (cdr mew-config-case-inbox)))
+ (setq mew-config-case-inbox (nreverse tmp))))
(let (errmsg)
(mew-config-error mew-mail-path "MailDir")
(mew-config-error mew-news-path "NewsDir")
-------------- next part --------------
Index: impath.in
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/im/impath.in,v
retrieving revision 1.24
diff -c -r1.24 impath.in
*** impath.in 1999/02/25 04:57:19 1.24
--- impath.in 1999/02/26 01:48:10
***************
*** 122,127 ****
--- 122,128 ----
print "QueuePath=" . queue_path() . "\n";
print "ImapAccount=" . imapaccount() . "\n";
print "ConfigCases=" . config_cases() . "\n";
+ print "ConfigCaseInbox=" . config_case_inbox . "\n";
}
##
Index: IM/Config.pm.in
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/im/IM/Config.pm.in,v
retrieving revision 1.18
diff -c -r1.18 Config.pm.in
*** Config.pm.in 1999/02/25 04:57:20 1.18
--- Config.pm.in 1999/02/26 01:49:58
***************
*** 30,36 ****
help
home_dir conf_dir
mail_dir mail_path news_dir news_path queue_dir queue_path
! inbox_folder draft_folder trash_folder config_cases
preserve_dot
folder_mode msg_mode allowcrlf no_sync
aliases_file context_file getsbr_file scansbr_file petname_file
--- 30,36 ----
help
home_dir conf_dir
mail_dir mail_path news_dir news_path queue_dir queue_path
! inbox_folder draft_folder trash_folder config_cases config_case_inbox
preserve_dot
folder_mode msg_mode allowcrlf no_sync
aliases_file context_file getsbr_file scansbr_file petname_file
***************
*** 709,714 ****
--- 709,729 ----
return join(',', @cases);
} else {
return '';
+ }
+ }
+
+ sub config_case_inbox () {
+ my @cases = keys(%CASES);
+ my @caseinbox = ();
+ if (scalar(@cases) >= 2) {
+ foreach (@cases) {
+ if (defined($_->{InboxFolder})) {
+ push(@caseinbox, "$_:$_->{InboxFolder}");
+ }
+ }
+ return join(',', @caseinbox);
+ } else {
+ return '';
}
}
Mew-dist メーリングリストの案内