X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tm-parse.el;h=40d5f5fa3709f99ebc93c956613b9f48f691d353;hb=a7388c9a369504a8de494bed38b72f386e5e004d;hp=0503a976883fcd2d305a51a649e21765938ecc9f;hpb=d1f12c89ac3491cdbbba0e24173e9b31f79ba73a;p=elisp%2Ftm.git diff --git a/tm-parse.el b/tm-parse.el index 0503a97..40d5f5f 100644 --- a/tm-parse.el +++ b/tm-parse.el @@ -3,8 +3,7 @@ ;; Copyright (C) 1994,1995,1996 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: -;; $Id: tm-parse.el,v 7.11 1996/08/30 06:20:52 morioka Exp $ +;; Version: $Id: tm-parse.el,v 7.16 1996/12/17 11:44:55 morioka Exp $ ;; Keywords: mail, news, MIME, multimedia ;; This file is part of tm (Tools for MIME). @@ -20,13 +19,13 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Code: -(require 'tl-822) +(require 'std11) (require 'tl-misc) (require 'tm-def) @@ -34,6 +33,21 @@ ;;; @ field parser ;;; +(defconst rfc822/quoted-pair-regexp "\\\\.") +(defconst rfc822/qtext-regexp + (concat "[^" (char-list-to-string std11-non-qtext-char-list) "]")) +(defconst rfc822/quoted-string-regexp + (concat "\"" + (regexp-* + (regexp-or rfc822/qtext-regexp rfc822/quoted-pair-regexp) + ) + "\"")) + +(defconst mime/content-parameter-value-regexp + (concat "\\(" + rfc822/quoted-string-regexp + "\\|[^; \t\n]*\\)")) + (defconst mime::parameter-regexp (concat "^[ \t]*\;[ \t]*\\(" mime/token-regexp "\\)" "[ \t]*=[ \t]*\\(" mime/content-parameter-value-regexp "\\)")) @@ -43,7 +57,7 @@ (let ((e (match-end 2))) (cons (cons (downcase (substring str (match-beginning 1) (match-end 1))) - (rfc822/strip-quoted-string + (std11-strip-quoted-string (substring str (match-beginning 2) e)) ) (substring str e) @@ -183,10 +197,12 @@ and return parsed it. [tm-parse.el]" ) (let ((boundary (assoc "boundary" params))) (cond (boundary - (setq boundary (rfc822/strip-quoted-string (cdr boundary))) + (setq boundary (std11-strip-quoted-string (cdr boundary))) (mime/parse-multipart boundary ctype params encoding rcnum) ) - ((string-equal ctype "message/rfc822") + ((or (string-equal ctype "message/rfc822") + (string-equal ctype "message/news") + ) (goto-char (point-min)) (mime::content-info/create rcnum (point-min) (point-max)