From: morioka Date: Tue, 12 May 1998 12:23:35 +0000 (+0000) Subject: Sync up with REMI 1.4.0-pre2. X-Git-Tag: semi-1_4_3~4 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5e61092ff551ba77a011a81a894595a0d67c20e1;p=elisp%2Fsemi.git Sync up with REMI 1.4.0-pre2. --- diff --git a/ChangeLog b/ChangeLog index c1837d3..fc7da81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +1998-05-12 MORIOKA Tomohiko + + * mime-parse.el (make-mime-content-type): New function. + (mime-parse-Content-Type): Use 'make-mime-content-type. + (mime-parse-multipart): Use 'make-mime-content-type. + +1998-05-12 MORIOKA Tomohiko + + * mime-parse.el: Change data format of mime-content-disposition. + +1998-05-11 MORIOKA Tomohiko + + * mime-parse.el: Rename 'mime/Content-Transfer-Encoding -> + 'mime-read-Content-Transfer-Encoding. + +1998-05-11 MORIOKA Tomohiko + + * mime-view.el (mime-raw-get-subject): Use + 'mime-content-disposition-parameters. + + * mime-play.el (mime-raw-get-original-filename): Use + 'mime-content-disposition-parameters. + + * mime-parse.el (mime-content-disposition-type): New function. + (mime-content-disposition-parameters): New function. + +1998-05-11 MORIOKA Tomohiko + + * mime-parse.el, mime-play.el, mime-view.el: Rename + 'mime/Content-Disposition -> 'mime-read-Content-Disposition. + 1998-05-11 MORIOKA Tomohiko * Makefile (PACKAGE): New variable. diff --git a/mime-parse.el b/mime-parse.el index f656abb..b389222 100644 --- a/mime-parse.el +++ b/mime-parse.el @@ -72,6 +72,12 @@ ;;; @ Content-Type ;;; +(defsubst make-mime-content-type (type subtype &optional parameters) + (list* (cons 'type type) + (cons 'subtype subtype) + (nreverse parameters)) + ) + (defun mime-parse-Content-Type (string) "Parse STRING as field-body of Content-Type field. Return value is @@ -91,9 +97,8 @@ are string." (setq dest (cons (car ret) dest) string (cdr ret)) ) - (list* (cons 'type (intern type)) - (cons 'subtype (intern subtype)) - (nreverse dest)) + (make-mime-content-type (intern type)(intern subtype) + (nreverse dest)) ))) (defun mime-read-Content-Type () @@ -128,32 +133,41 @@ and return parsed it. Format of return value is as same as (setq string (std11-unfold-string string)) (if (string-match `,(concat "^" mime-disposition-type-regexp) string) (let* ((e (match-end 0)) - (ctype (downcase (substring string 0 e))) + (type (downcase (substring string 0 e))) ret dest) (setq string (substring string e)) (while (setq ret (mime-parse-parameter string)) (setq dest (cons (car ret) dest) string (cdr ret)) ) - (cons ctype (nreverse dest)) + (cons (cons 'type (intern type)) + (nreverse dest)) ))) -(defun mime/Content-Disposition () +(defun mime-read-Content-Disposition () "Read field-body of Content-Disposition field from current-buffer, -and return parsed it. [mime-parse.el]" +and return parsed it." (let ((str (std11-field-body "Content-Disposition"))) (if str (mime-parse-Content-Disposition str) ))) +(defsubst mime-content-disposition-type (content-disposition) + "Return disposition-type of CONTENT-DISPOSITION." + (cdr (car content-disposition))) + +(defsubst mime-content-disposition-parameters (content-disposition) + "Return disposition-parameters of CONTENT-DISPOSITION." + (cdr content-disposition)) + ;;; @ Content-Transfer-Encoding ;;; -(defun mime/Content-Transfer-Encoding (&optional default-encoding) +(defun mime-read-Content-Transfer-Encoding (&optional default-encoding) "Read field-body of Content-Transfer-Encoding field from current-buffer, and return it. -If is is not found, return DEFAULT-ENCODING. [mime-parse.el]" +If is is not found, return DEFAULT-ENCODING." (let ((str (std11-field-body "Content-Transfer-Encoding"))) (if str (progn @@ -162,8 +176,7 @@ If is is not found, return DEFAULT-ENCODING. [mime-parse.el]" ) (downcase str) ) - default-encoding) - )) + default-encoding))) ;;; @ message parser @@ -204,8 +217,8 @@ If is is not found, return DEFAULT-ENCODING. [mime-parse.el]" (rsep (concat delimiter "[ \t]*\n")) (dc-ctl (if (eq subtype 'digest) - '(message rfc822) - '(text plain) + (make-mime-content-type 'message 'rfc822) + (make-mime-content-type 'text 'plain) )) cb ce ret ncb children (i 0)) (save-restriction @@ -246,7 +259,7 @@ mime-{parse|read}-Content-Type." (let ((primtype (mime-content-type-primary-type default-ctl)) (subtype (mime-content-type-subtype default-ctl)) (params (mime-content-type-parameters default-ctl)) - (encoding (or (mime/Content-Transfer-Encoding) default-encoding))) + (encoding (mime-read-Content-Transfer-Encoding default-encoding))) (let ((boundary (assoc "boundary" params))) (cond (boundary (setq boundary (std11-strip-quoted-string (cdr boundary))) diff --git a/mime-play.el b/mime-play.el index 95d93e1..20991eb 100644 --- a/mime-play.el +++ b/mime-play.el @@ -335,8 +335,11 @@ window.") (defun mime-raw-get-original-filename (param &optional encoding) (or (mime-raw-get-uu-filename param encoding) (let (ret) - (or (if (or (and (setq ret (mime/Content-Disposition)) - (setq ret (assoc "filename" (cdr ret))) + (or (if (or (and (setq ret (mime-read-Content-Disposition)) + (setq ret + (assoc + "filename" + (mime-content-disposition-parameters ret))) ) (setq ret (assoc "name" param)) (setq ret (assoc "x-name" param)) diff --git a/mime-view.el b/mime-view.el index 1ac09d0..8ae704c 100644 --- a/mime-view.el +++ b/mime-view.el @@ -917,8 +917,10 @@ The compressed face will be piped to this command.") (defun mime-raw-get-subject (param &optional encoding) (or (std11-find-field-body '("Content-Description" "Subject")) (let (ret) - (if (or (and (setq ret (mime/Content-Disposition)) - (setq ret (assoc "filename" (cdr ret))) + (if (or (and (setq ret (mime-read-Content-Disposition)) + (setq ret + (assoc "filename" + (mime-content-disposition-parameters ret))) ) (setq ret (assoc "name" param)) (setq ret (assoc "x-name" param))