[mew-dist 20072] Re: mew-cs-m17n

Tatsuya Kinoshita tats at example.com
2002年 1月 13日 (日) 22:53:12 JST


In message [mew-dist 19796], on Sat, 8 Dec 2001,
Tatsuya Kinoshita <tats at example.com> wrote:

> `C-c C-i'(mew-summary-find-file)についても対応しました。+draftの
> 場合だけcoding-system-for-readをmew-cs-m17nにしてから読み込みます。

さらに+draftでSummaryが化けないよう修正しました。

-- 
木下達也
-------------- next part --------------

 This patch is written by Tatsuya Kinoshita.  Copyright is disclaimed.

diff -ur mew.orig/mew-bq.el mew/mew-bq.el
--- mew.orig/mew-bq.el	Tue Dec 11 19:38:02 2001
+++ mew/mew-bq.el	Sun Jan 13 22:30:50 2002
@@ -644,7 +644,7 @@
 	(concat "The '" param "' parameter has encoded-word.\n")))
       (mew-xinfo-get-warning)))))
 
-(defun mew-header-decode-region (key rbeg rend)
+(defun mew-header-decode-region (key rbeg rend &optional draftp)
   "RFC 2047 decoding. This is liberal on the one point from RFC 2047.
 That is, each line may be more than 75. "
   (setq key (capitalize key))
@@ -653,10 +653,12 @@
       (narrow-to-region rbeg rend)
       ;; Handling illegal raw text.
       (goto-char (point-min))
-      (when (and mew-decode-broken
-		 (re-search-forward mew-regex-esc-or-nonascii nil t))
-	(mew-decode-warning-fields key 'raw)
-	(mew-cs-decode-region (point-min) (point-max) mew-cs-autoconv))
+      (if draftp
+	  (mew-cs-decode-region (point-min) (point-max) mew-cs-m17n)
+	(when (and mew-decode-broken
+		   (re-search-forward mew-regex-esc-or-nonascii nil t))
+	  (mew-decode-warning-fields key 'raw)
+	  (mew-cs-decode-region (point-min) (point-max) mew-cs-autoconv)))
       ;;
       (mew-header-unfold-region type)
       ;;
diff -ur mew.orig/mew-local.el mew/mew-local.el
--- mew.orig/mew-local.el	Sun Dec 16 14:15:31 2001
+++ mew/mew-local.el	Sun Jan 13 22:30:30 2002
@@ -301,6 +301,7 @@
 	 (pnm (process-name process))
 	 (folder (mew-scan-pnm-to-bnm pnm))
 	 (virtualp (mew-folder-virtualp folder))
+	 (draftp (mew-folder-draftp folder))
 	 vec)
     (mew-filter
      (goto-char (point-max))
@@ -309,7 +310,7 @@
      (goto-char (point-min))
      (while (and (re-search-forward mew-eoh nil t) (not (eobp)))
        (mew-set-buffer-multibyte t)
-       (setq vec (mew-scan-header))
+       (setq vec (mew-scan-header draftp))
        (mew-set-buffer-multibyte nil)
        (mew-scan-insert-line folder vec width nil virtualp)
        (forward-line)
diff -ur mew.orig/mew-scan.el mew/mew-scan.el
--- mew.orig/mew-scan.el	Mon Dec 17 19:07:06 2001
+++ mew/mew-scan.el	Sun Jan 13 22:28:35 2002
@@ -397,7 +397,7 @@
 ;;; Sub-functions for Scan
 ;;;
 
-(defun mew-scan-header ()
+(defun mew-scan-header (&optional draftp)
   (let (vec key med str n)
     (setq vec (make-vector (length mew-scan-fields) ""))
     (save-restriction
@@ -412,7 +412,7 @@
 	  (mew-header-goto-next)
 	  (when (setq n (mew-member-case-equal key mew-scan-fields))
 	    ;; xxx this may be able to tune up.
-	    (mew-header-decode-region key med (point))
+	    (mew-header-decode-region key med (point) draftp)
 	    ;; Need to inherit properties.
 	    ;; So, we use buffer-substring, not mew-buffer-substring.
 	    (setq str (buffer-substring med (1- (point))))


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