From 2c80ce7a636b0e4b45600772b3071860dfbc0a2a Mon Sep 17 00:00:00 2001 From: morioka Date: Wed, 24 Jun 1998 15:54:30 +0000 Subject: [PATCH] Sync up with chao-1_6_0. --- ChangeLog | 7 +++++++ FLIM-VERSION | 2 ++ mime-def.el | 6 ++++-- mime-parse.el | 63 +++++++++++++++++++++++++++------------------------------ 4 files changed, 43 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index a84770d..1cf2775 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1998-06-24 MORIOKA Tomohiko + + * mime-def.el (mime-entity-set-children): New function. + + * mime-parse.el (mime-parse-multipart): Change interface. + (mime-parse-message): Use `mime-entity-set-children'. + 1998-06-24 Shuhei KOBAYASHI * mime.el (mime-read-field): Fix typo. diff --git a/FLIM-VERSION b/FLIM-VERSION index 00f9aca..881bd0d 100644 --- a/FLIM-VERSION +++ b/FLIM-VERSION @@ -16,6 +16,7 @@ 1.4.1 Momoyama-Gory-Dòmae-A $(BEm;38fNMA0(B 1.5.0 Mukaijima $(B8~Eg(B 1.6.0 Ogura $(B>.AR(B +1.6.1 Iseda $(B0K@*ED(B [Chao Version names] @@ -29,3 +30,4 @@ 1.2.0 Takeda $(BC]ED(B ; = $(B6aE4(B $(B5~ET@~(B 1.3.0 Kuinabashi $(B$/$$$J66(B 1.4.0 J-Dþjò-A $(B==>r(B +1.6.0 Kuj-Dò-A $(B6e>r(B diff --git a/mime-def.el b/mime-def.el index 3611b08..7cb0f7b 100644 --- a/mime-def.el +++ b/mime-def.el @@ -24,7 +24,7 @@ ;;; Code: -(defconst mime-library-version-string "FLIM 1.6.0 - \"Ogura\"") +(defconst mime-library-version-string "FLIM 1.6.1 - \"Iseda\"") ;;; @ variables @@ -205,7 +205,9 @@ (defsubst mime-entity-parsed-header (entity) (aref entity 11)) (defsubst mime-entity-set-original-header (entity header) - (aset entity 9 header)) + (aset entity 9 header)) +(defsubst mime-entity-set-children (entity children) + (aset entity 10 children)) (defsubst mime-entity-set-parsed-header (entity header) (aset entity 11 header)) diff --git a/mime-parse.el b/mime-parse.el index 69e91b4..87df395 100644 --- a/mime-parse.el +++ b/mime-parse.el @@ -150,14 +150,11 @@ If is is not found, return DEFAULT-ENCODING." ;;; @ message parser ;;; -(defun mime-parse-multipart (header-start header-end body-start body-end - content-type content-disposition - encoding node-id) +(defun mime-parse-multipart (entity) (goto-char (point-min)) - (let* ((dash-boundary - (concat "--" - (std11-strip-quoted-string - (mime-content-type-parameter content-type "boundary")))) + (let* ((content-type (mime-entity-content-type entity)) + (dash-boundary + (concat "--" (mime-content-type-parameter content-type "boundary"))) (delimiter (concat "\n" (regexp-quote dash-boundary))) (close-delimiter (concat delimiter "--[ \t]*$")) (rsep (concat delimiter "[ \t]*\n")) @@ -166,6 +163,9 @@ If is is not found, return DEFAULT-ENCODING." (make-mime-content-type 'message 'rfc822) (make-mime-content-type 'text 'plain) )) + (header-end (mime-entity-header-end entity)) + (body-end (mime-entity-body-end entity)) + (node-id (mime-entity-node-id entity)) cb ce ret ncb children (i 0)) (save-restriction (goto-char body-end) @@ -194,11 +194,19 @@ If is is not found, return DEFAULT-ENCODING." ) (setq children (cons ret children)) ) - (make-mime-entity (current-buffer) - header-start header-end body-start body-end - node-id content-type content-disposition encoding - (nreverse children)) - )) + (mime-entity-set-children entity (nreverse children)) + entity)) + +(defun mime-parse-encapsulated (entity) + (mime-entity-set-children + entity + (save-restriction + (narrow-to-region (mime-entity-body-start entity) + (mime-entity-body-end entity)) + (list (mime-parse-message + nil nil (cons 0 (mime-entity-node-id entity)))) + )) + entity) ;;;###autoload (defun mime-parse-message (&optional default-ctl default-encoding node-id) @@ -211,7 +219,8 @@ mime-{parse|read}-Content-Type." body-start (body-end (point-max)) content-type content-disposition encoding - primary-type) + primary-type + entity) (goto-char header-start) (if (re-search-forward "^$" nil t) (setq header-end (match-end 0) @@ -239,33 +248,21 @@ mime-{parse|read}-Content-Type." default-encoding)) primary-type (mime-content-type-primary-type content-type)) ) + (setq entity + (make-mime-entity (current-buffer) + header-start header-end body-start body-end + node-id + content-type content-disposition encoding nil)) (cond ((eq primary-type 'multipart) - (mime-parse-multipart header-start header-end - body-start body-end - content-type content-disposition encoding - node-id) + (mime-parse-multipart entity) ) ((and (eq primary-type 'message) (memq (mime-content-type-subtype content-type) '(rfc822 news external-body) )) - (make-mime-entity (current-buffer) - header-start header-end body-start body-end - node-id - content-type content-disposition encoding - (save-restriction - (narrow-to-region body-start body-end) - (list (mime-parse-message - nil nil (cons 0 node-id))) - )) + (mime-parse-encapsulated entity) ) - (t - (make-mime-entity (current-buffer) - header-start header-end body-start body-end - node-id - content-type content-disposition encoding nil) - )) - )) + (t entity)))) ;;; @ for buffer -- 1.7.10.4