[mew-dist 23774] Re: illegal/broken messages

Kazu Yamamoto ( 山本和彦 ) kazu at example.com
2003年 6月 20日 (金) 16:52:46 JST


From: Hideyuki Ozaki <hideyuki.ozaki at example.com>
Subject: [mew-dist 23771] Re: illegal/broken messages

> Kazu> これは、Mew には判断できないので、「MIME-Version:があると思って
> Kazu> 解析しろ」というコマンドを提供し、ユーザに明示的に実行してもらう
> Kazu> 必要があると思います。
> 
> e-lispが良くわからないので、的外れかも知れませんが…
<snip>
> と出てくるので、判別可能かと思いましたが、難しいのでしょうか?

Mime-Version: がなければ、本文は単なるテキストであり、文字コードは地域
の取り決めに従うというルールになっています。

そのルールを破って、さらに Content-Type: があれば、それを自動的に使う
というコードを書けということでしょうか?

それはやりたくありません。

> Kazu> これの本文は何でしょうか?
> 
> 今まで見たものは、ほとんどが Content-Type: Text/Plain でした。charset
> はiso-2022-jpだったり、us-asciiだったり色々ありましたが。
> 
> 現状だとText形式のアタッチメントになってしまい、C-uC-cC-eなどでは表示
> できないんですよね。

こちらに関しては、少し検索パターンを緩めたいと思います。具体的には、
"Text/" ではなく "Text" でマッチさせて、テキストか否かを判断するように
してみました。

以下のパッチで問題がないようなら、マージします。

--かず

Index: mew-vars2.el
===================================================================
RCS file: /cvsroot/mew/mew/mew-vars2.el,v
retrieving revision 1.95.2.2
diff -c -r1.95.2.2 mew-vars2.el
*** mew-vars2.el	2003/04/01 07:44:04	1.95.2.2
--- mew-vars2.el	2003/06/20 07:56:57
***************
*** 189,195 ****
  ;;;
  
  (defsubst mew-ct-textp (ct)
!   (string-match "^Text/" (capitalize ct)))
  
  (defsubst mew-ct-imagep (ct)
    (string-match "^Image/" (capitalize ct)))
--- 189,195 ----
  ;;;
  
  (defsubst mew-ct-textp (ct)
!   (string-match "^Text" (capitalize ct)))
  
  (defsubst mew-ct-imagep (ct)
    (string-match "^Image/" (capitalize ct)))
***************
*** 351,357 ****
      ("text/xml"      "\\.xml$"   nil     mew-prog-xml       mew-icon-text)
      ("text/rfc822-headers" "\\.hdr$" nil
       mew-prog-rfc822-headers     mew-icon-message/rfc822)
!     ("text/"         "^$"        nil     mew-prog-text      mew-icon-text)
      ;; Unkown CT: matches here.
      (t               "^$"       nil   mew-prog-octet-stream mew-icon-unknown)
      ;; Unknown suffix matches here and return the entry specified 
--- 351,357 ----
      ("text/xml"      "\\.xml$"   nil     mew-prog-xml       mew-icon-text)
      ("text/rfc822-headers" "\\.hdr$" nil
       mew-prog-rfc822-headers     mew-icon-message/rfc822)
!     ("text"         "^$"        nil     mew-prog-text      mew-icon-text)
      ;; Unkown CT: matches here.
      (t               "^$"       nil   mew-prog-octet-stream mew-icon-unknown)
      ;; Unknown suffix matches here and return the entry specified 
***************
*** 403,409 ****
  ;;;
  
  (defvar mew-mime-content-disposition
!   '(("text/"      "inline"     t)
      ("image/"     "inline"     t)
      ("message/"   "inline"     nil)
      ("multipart/" nil          nil)
--- 403,409 ----
  ;;;
  
  (defvar mew-mime-content-disposition
!   '(("text"      "inline"     t)
      ("image/"     "inline"     t)
      ("message/"   "inline"     nil)
      ("multipart/" nil          nil)



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