[mew-dist 23299] Re: summary 表示変更
弓岡 也守輝 (YUMIOKA Yasuteru)
te-kun at example.com
2003年 3月 17日 (月) 01:20:09 JST
すいません、添付し忘れました。
--
弓岡
te-kun at example.com
http://www.te-kun.com/
-------------- next part --------------
;;; mew-mlsubj.el ---
;; 扱うヘッダを指定。最後は Body にすること
(setq mew-scan-fields
'("Folder:" "Filename:" "Subject:" "Date:" "From:" "To:"
"Content-Type:" "Message-Id:" "X-Mew-UIDL:"
"In-Reply-To:" "References:"
"X-Ml-Name:" "X-Mail-Count:" "X-ML-COUNT:" "X-Seqno:" "X-Sequence:" "Body"))
;; 対応する alias を設定
;; mew-scan-fields と順番を一致させる
(setq mew-scan-fields-alias
'("FLD" "NUM" "SUBJ" "DATE" "FROM" "TO" "CT"
"ID" "UID" "IRT" "REF"
"MLNAME" "MAILCOUNT" "MLCOUNT" "SEQNO" "SEQUENCE"
"BODY"))
;; 関数定義
(defun mew-summary-form-mailcount ()
(let ((mailcount (MEW-MAILCOUNT)))
mailcount))
(defun mew-summary-form-mlcount ()
(let ((mlcount (MEW-MLCOUNT)))
mlcount))
(defun mew-summary-form-seqno ()
(let ((seqno (MEW-SEQNO)))
seqno))
(defun mew-summary-form-sequence ()
(let ((sequence (MEW-SEQUENCE)))
(if (string-match ".+ \\([0-9]+\\)$" sequence)
(substring sequence (match-beginning 1))
"")))
(defun mew-summary-form-bracket ()
(let ((bracket (MEW-SUBJ)))
(if (string-match "^\\[.*?[:, ]+\\([0-9]+\\)\\]" bracket)
(substring bracket (match-beginning 1) (match-end 1))
"")))
(defun mew-summary-form-mlname ()
(let ((mlname (MEW-MLNAME)))
mlname))
(defun mew-summary-form-mlsubj ()
"A function to return Subject:. Unnecessary white spaces are removed."
;; The beginning white spaces have been removed in mew-scan-header
;; (mew-keyval).
(let ((mlsubj (MEW-SUBJ)))
(if (string= mlsubj "") (setq mlsubj mew-error-no-subject))
(if (string-match "\\(\\[.*?\\][ \t\n]*\\)\\(.*\\)$"
(mew-replace-white-space mlsubj))
(substring (mew-replace-white-space mlsubj)
(match-beginning 2) (match-end 2))
(mew-replace-white-space mlsubj))))
(defun mew-summary-form-youbi ()
(let ((s (MEW-DATE)))
(when (>= (length s) 3)
(setq s (substring s 0 3)))
(cdr
(assoc s
'(("Mon" . "月")
("Tue" . "火")
("Wed" . "水")
("Thu" . "木")
("Fri" . "金")
("Sat" . "土")
("Sun" . "日"))))))
;; ディレクトリ名の指定方法を正規表現にする
(setq mew-summary-form-list-list-type 'regex) ; or 'recursive or 'string
;; mew-summary-form の設定
;; 最初に type が必須
;; default は (type (5 date) " " (14 from) " " t (30 subj) "|" (0 body))
;; t の位置からスレッド表示されます
;;
;; 配送されるメールのヘッダをから、ML 名、Count 数を調べて、適切に
;; 指定してください。
;; 書式は (表示する行数 表示するヘッダ)
;;
;; X-Ml-Name: → mlname
;; X-Mail-Count: → mailcount
;; X-ML-COUNT: → mlcount
;; X-Seqno: → seqno
;; に対応しています。
;; mlsubj が [**** 12345] を削除した subjectです。
(setq mew-summary-form-list
'(
(("[+/]mail[+/]meadow" "[+/]mail[+/]semi-gnus")
( type (5 date) " " (14 from) " " t (5 mlcount) " " (30 subj) "|" (0 body)))
(("[+/]mail[+/]mule")
( type (5 date) " " (14 from) " " t (5 seqno) " " (30 subj) "|" (0 body)))
(("[+/]mail[+/]mew")
( type (5 date) " " (14 from) " " t (5 mailcount) " " (30 mlsubj) "|" (0 body)))
(("[+/]mail[+/]script-cgi")
( type (5 date) " " (14 from) " " t (5 mlcount) " " (30 mlsubj) "|" (0 body)))
(("[+/]inbox")
( type (5 date) "(" (2 youbi) ")[" (5 time) "]" (-4 size) " " (14 from) " " t (30 subj) "|" (0 body)))
(t ;; 残りは default 値に
(type (5 date) " " (14 from) " " t (30 subj) "|" (0 body)))
))
;;; mew-mlsubj.el ends here
Mew-dist メーリングリストの案内