[Mew-dist 11078] mew-draft-rehighlight

Takashi P.KATOH p-katoh at example.com
1999年 10月 26日 (火) 19:54:12 JST


mew-draft-rehighlight で、body については最初に unhighlight 
していないのは何か理由があるのでしょうか?

もしないのであれば、こんな感じなパッチは不可でしょうか?
# mew-highlight.el を見てると理由がありそうな感じがしますけど...

-- 
かとぺ / 加藤 貴司

-------------- next part --------------
--- mew/mew-highlight.el	Mon Aug 30 12:43:15 1999
+++ mew-highlight.el	Tue Oct 26 19:49:07 1999
@@ -111,11 +111,19 @@
        (save-excursion (end-of-line) (point))
        '(face nil))))
 
-(defun mew-unhighlight-header-region (BEG END)
+(defun mew-unhighlight-region (BEG END)
   (mew-overlay-delete-region BEG END))
 
 (defun mew-unhighlight-header ()
-  (mew-unhighlight-header-region (point-min) (mew-header-end)))
+  (save-restriction
+    (widen)
+    (mew-unhighlight-region (point-min) (mew-header-end))))
+
+(defun mew-unhighlight-body ()
+  (save-restriction
+    (widen)
+    (mew-unhighlight-region
+     (mew-header-end) (or (mew-attach-begin) (point-max)))))
 
 (defun mew-highlight-header-region (BEG END)
   "A function to highligh header in Message and Draft mode."
@@ -125,7 +133,7 @@
 	     (defval (intern-soft "mew-highlight-header-face-marginal"))
 	     key beg med n-spec overlay key-face val-face)
 	 (save-excursion
-	   (mew-unhighlight-header-region BEG END)
+	   (mew-unhighlight-region BEG END)
 	   (save-restriction
 	     (narrow-to-region BEG END)
 	     (goto-char (point-min))
@@ -146,7 +154,9 @@
 		 (mew-overlay-put overlay 'face val-face)))))))))
 
 (defun mew-highlight-header ()
-  (mew-highlight-header-region (point-min) (mew-header-end)))
+  (save-restriction
+    (widen)
+    (mew-highlight-header-region (point-min) (mew-header-end))))
 
 (defun mew-highlight-body ()
   "A function to highligh body in Message mode."
@@ -160,6 +170,7 @@
 	     (widen)
 	     (if (mew-header-p)
 		 (progn
+		   (mew-unhighlight-body)
 		   (goto-char (mew-header-end))
 		   (narrow-to-region (point)
 				     (or (mew-attach-begin) (point-max)))))


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