[Mew-Win32 02355] Re: mew-summary-hlでこんなこと...

Hideyuki SHIRAI ( 白井秀行 ) shirai at example.com
2000年 1月 17日 (月) 20:28:37 JST


From: Ichiro Murata <ichigo at example.com> さん曰く
Subject: [Mew-Win32 02350] mew-summary-hlでこんなこと...
Message-ID: <20000114.224256.00601862.ichigo at example.com>
Date: Fri, 14 Jan 2000 22:42:56 +0900 (JST)

村田> summary bufferで、ある特定の人から来たメールの色を変えることは出来ない
村田> でしょうか?

というわけで、(やっぱり)やってみました。

# mew-summary-hl 自体が力づくなので、これも力づくです。^^;;;

附属のパッチを mew-summary-hl.el にあてて、特別な人を

(setq mew-summary-hl-special-persons
      '("Kazu Yamamoto (山本和彦)"
	"Shuichi KITAGUCHI (北口 "
	"Miyashita Hisashi(宮下  "
	"Hideyuki SHIRAI (白井秀 "
	"Keiichi Suzuki          "
	"Katsumi Yamaoka         "
	))

の様に設定して下さい。上記の例だと mew-summary-hl-from-width=>24
の場合で、設定と summary での見え方が *完全* に一致しないと色漬
けしません。(string-match だと遅そうだから)
~/.emacs に雛型を書いて、summary から yank するのが楽だと思いま
す。

# 御意見、御要望受付中。

-- 
白井秀行@mew-win32-mvm は待っててね。(^^)
-------------- next part --------------
--- mew-summary-hl.el	Mon Jan 17 19:42:43 2000
+++ mew-summary-hl2.el	Mon Jan 17 20:07:15 2000
@@ -52,7 +52,8 @@
 ;; face の書体と色はお好みで変えよう。
 ;; この設定だと http://www.netlaputa.ne.jp/~hshirai/Image/summary1.png 
 ;; のようになります。
-(defvar mew-sumamry-hl-face-list '("num" "from" "to" "ml" "subject" "body"))
+(defvar mew-sumamry-hl-face-list
+  '("num" "from" "to" "ml" "special" "subject" "body"))
 
 (defvar mew-summary-hl-face-num-type 'italic)
 (defvar mew-summary-hl-face-num-color "Maroon")
@@ -63,6 +64,9 @@
 (defvar mew-summary-hl-face-to-type 'bold-italic)
 (defvar mew-summary-hl-face-to-color "DarkOrange3")
 
+(defvar mew-summary-hl-face-special-type 'bold-italic)
+(defvar mew-summary-hl-face-special-color "navy")
+
 (defvar mew-summary-hl-face-ml-type 'italic)
 (defvar mew-summary-hl-face-ml-color "DarkGreen")
 
@@ -72,6 +76,17 @@
 (defvar mew-summary-hl-face-body-type 'italic)
 (defvar mew-summary-hl-face-body-color "Grey50")
 
+;; 特別な人を設定する。
+(defvar mew-summary-hl-special-persons nil)
+;; summary で見えるのと全く同じに mew-summary-hl-from-width 分設定する。
+;; summary から copy するのがいいでしょう。
+;; 例えば、以下のような感じ
+;; (setq mew-summary-hl-special-persons
+;;    '("Kazu Yamamoto (山本和彦)"
+;; 	"Shuichi KITAGUCHI (北口 "
+;;	"Miyashita Hisashi(宮下  "
+;;	))
+
 ;; MUE/MHC などの色づけ用関数を定義する
 (defvar mew-summary-hl-external-function nil)
 
@@ -116,30 +131,43 @@
       (mew-elet
        (goto-char beg)
        (beginning-of-line)
-       (setq beg (point))
-       (remove-text-properties beg end '(face nil))
+       (remove-text-properties (point) end '(face nil))
        (while (< (point) end)
 	 (cond
 	  ;; 普通の行
 	  ((looking-at mew-summary-hl-start-regex)
 	   (put-text-property (match-beginning 1) (match-end 1)
 			      'face 'mew-summary-hl-face-num)
-	   (goto-char (match-end 0))
+	   (setq beg (goto-char (match-end 0)))
 	   (if (looking-at "To:")
 	       ;; 自分のメール
-	       (put-text-property (point)
+	       (put-text-property beg
 				  (progn (move-to-column
 					  (+ (current-column)
 					     mew-summary-hl-from-width))
 					 (point))
 				  'face 'mew-summary-hl-face-to)
-	     ;; 他の人のメール
-	     (put-text-property (point)
-				(progn (move-to-column
-					(+ (current-column)
-					   mew-summary-hl-from-width))
-				       (point))
-				'face 'mew-summary-hl-face-from))
+	     (if mew-summary-hl-special-persons
+		 (if (member (mew-buffer-substring beg
+						   (progn
+						     (move-to-column
+						      (+ (current-column)
+							 mew-summary-hl-from-width))
+						     (point)))
+			     mew-summary-hl-special-persons)
+		     ;; 特別な人のメール
+		     (put-text-property beg (point)
+					'face 'mew-summary-hl-face-special)
+		   ;; 他の人のメール
+		   (put-text-property beg (point)
+				      'face 'mew-summary-hl-face-from))
+	       ;; 他の人のメール
+	       (put-text-property beg
+				  (progn (move-to-column
+					  (+ (current-column)
+					     mew-summary-hl-from-width))
+					 (point))
+				  'face 'mew-summary-hl-face-from)))
 	   (if (not (looking-at mew-summary-hl-ml))
 	       ()
 	     ;; [mew-dist 0123] や (pgp-users 1234) があった


Mew-win32 メーリングリストの案内