From 56f02fb82d8b7defef2225327cb02db55bce134e Mon Sep 17 00:00:00 2001 From: morioka Date: Wed, 13 May 1998 01:52:35 +0000 Subject: [PATCH] Sync up with SEMI 1.4.3 (Ichiburi). --- ChangeLog | 82 ++++++++++++++++++++++++++++++++++++++---- Makefile | 15 ++++---- README.en | 66 +++++++++++++++++++++++++++++----- TODO | 39 ++++++++++++++++++++ mime-edit.el | 7 ++-- mime-parse.el | 107 +++++++++++++++++++++++++++++++++---------------------- mime-partial.el | 4 ++- mime-play.el | 7 ++-- mime-view.el | 6 ++-- semi-def.el | 2 +- 10 files changed, 262 insertions(+), 73 deletions(-) diff --git a/ChangeLog b/ChangeLog index cff5b10..fbe2e32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,73 @@ +1998-05-12 Kazuhiro Ohta + + * mime-partial.el: start and end of the region fixed. + +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. + (tar): Use $(PACKAGE). + +1998-05-11 MORIOKA Tomohiko + + * mime-parse.el: Change data format of mime-content-type. + +1998-05-11 MORIOKA Tomohiko + + * mime-edit.el (mime-edit-decode-buffer): Use + 'mime-content-type-primary-type, 'mime-content-type-subtype and + 'mime-content-type-parameters. + +1998-05-11 MORIOKA Tomohiko + + * mime-parse.el (mime-content-type-primary-type): New function. + (mime-content-type-subtype): New function. + (mime-content-type-parameters): New function. + (mime-parse-message): Use 'mime-content-type-primary-type, + 'mime-content-type-subtype and 'mime-content-type-parameters. + +1998-05-10 MORIOKA Tomohiko + + * mime-parse.el: Abolish function 'symbol-concat because it is not + used. + +1998-05-07 MORIOKA Tomohiko + + * README.en (Authors): New section. + + * README.en (CVS based development): New section. + + 1998-05-07 MORIOKA Tomohiko * WEMI: Version 1.4.2 (Chigasaki) released. @@ -23,7 +93,7 @@ 1998-05-06 MORIOKA Tomohiko - * WEMI: Version 1.4.1 (Tsujid-Dò) was released.-A + * WEMI: Version 1.4.1 (Tsujid-Dò)-A was released. * README.en (Required environment): Modify for FLIM 1.2.0. @@ -127,7 +197,7 @@ 1998-05-02 MORIOKA Tomohiko - * WEMI: Version 1.3.1 (-DÒfuna) was released.-A + * WEMI: Version 1.3.1 (-DÒfuna)-A was released. 1998-05-02 MORIOKA Tomohiko @@ -394,7 +464,7 @@ 1998-04-07 MORIOKA Tomohiko - * WEMI: Version 1.2.0 (T-Dòkyò) was released.-A + * WEMI: Version 1.2.0 (T-Dòkyò)-A was released. * README.en: Modify for WEMI. @@ -862,7 +932,7 @@ 1998-03-13 MORIOKA Tomohiko - * SEMI: Version 1.0.2 (Nonoichi-K-Dòdaimae) was released.-A + * SEMI: Version 1.0.2 (Nonoichi-K-Dòdaimae)-A was released. 1998-03-12 MORIOKA Tomohiko @@ -974,7 +1044,7 @@ 1998-02-25 MORIOKA Tomohiko - * SEMI: Version 1.0.0 (Nukaj-Dþtaku-mae) was released.-A + * SEMI: Version 1.0.0 (Nukaj-Dþtaku-mae)-A was released. * SEMI-ELS: Remove mime-tar.el. @@ -1111,7 +1181,7 @@ 1997-11-16 MORIOKA Tomohiko - * SEMI: Version 0.116 (D-Dòhòji) was released.-A + * SEMI: Version 0.116 (D-Dòhòji)-A was released. 1997-11-15 MORIOKA Tomohiko diff --git a/Makefile b/Makefile index f9c0dd1..25e9f95 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ # Makefile for WEMI. # -VERSION = 1.4.2 +VERSION = 1.4.3 +PACKAGE = wemi SHELL = /bin/sh MAKE = make @@ -57,14 +58,14 @@ clean: tar: cvs commit - sh -c 'cvs tag -RF wemi-`echo $(VERSION) \ + sh -c 'cvs tag -RF $(PACKAGE)-`echo $(VERSION) \ | sed s/\\\\./_/ | sed s/\\\\./_/`; \ cd /tmp; \ cvs -d :pserver:anonymous@chamonix.jaist.ac.jp:/hare/cvs/root \ - export -d wemi-$(VERSION) \ - -r wemi-`echo $(VERSION) \ + export -d $(PACKAGE)-$(VERSION) \ + -r $(PACKAGE)-`echo $(VERSION) \ | sed s/\\\\./_/ | sed s/\\\\./_/` semi' - $(RM) /tmp/wemi-$(VERSION)/ftp.in - cd /tmp; $(TAR) cvzf wemi-$(VERSION).tar.gz wemi-$(VERSION) - cd /tmp; $(RM) -r wemi-$(VERSION) + $(RM) /tmp/$(PACKAGE)-$(VERSION)/ftp.in + cd /tmp; $(TAR) cvzf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) + cd /tmp; $(RM) -r $(PACKAGE)-$(VERSION) sed "s/VERSION/$(VERSION)/" < ftp.in > ftp diff --git a/README.en b/README.en index 98418dd..e4c8993 100644 --- a/README.en +++ b/README.en @@ -1,8 +1,7 @@ [README for WEMI kernel package (English Version)] -by MORIOKA Tomohiko What's WEMI? ------------- +============ WEMI is a branch of SEMI kernel package using widget. It is a library to provide MIME feature for GNU Emacs based on SEMI API. @@ -37,7 +36,7 @@ What's WEMI? Required environment --------------------- +==================== WEMI supports XEmacs 20.3 or later with mule, and Emacs 20.2. @@ -67,7 +66,7 @@ Required environment Installation ------------- +============ % make install @@ -107,7 +106,7 @@ Installation Initialization --------------- +============== (a) load-path @@ -131,7 +130,7 @@ Initialization Documentation -------------- +============= To get started, please read ${archive}/README.en. @@ -141,8 +140,8 @@ Documentation ftp://ftp.merit.edu/internet/documents/rfc/ -Bug reports ------------ +Mailing lists +============= If you write bug-reports and/or suggestions for improvement, please send them to the tm Mailing List: @@ -156,3 +155,54 @@ Bug reports tm-en-help@chamonix.jaist.ac.jp (English) tm-ja-help@chamonix.jaist.ac.jp (Japanese) + + +CVS based development +===================== + + If you would like to join CVS based development, please send mail to + + cvs@chamonix.jaist.ac.jp + + with your account name and UNIX style crypted password. We hope you + will join the open development. + + +Authors +======= + +Original authors + + MORIOKA Tomohiko + (the author of mime-view and various parts of SEMI) + UMEDA Masanobu + (the author of mime.el of emacs-mime-tools. mime.el is the + origin of mime-edit.el of SEMI) + +Other authors + + Shuhei KOBAYASHI + (a major author of signature.el and a lot of codes) + MASUTANI Yasuhiro + (anonymous ftp codes of mime-play.el) + OKABE Yasuo + (a major author of mime-partial.el and signature.el) + + Steinar Bang + Steven L. Baur + Kevin Broadey + Alastair Burt + Eric Ding + Thierry Emery + Simon Josefsson + Jens Lautenbacher + Carsten Leonhardt + Pekka Marjola + Hisashi Miyashita + Kazuhiro Ohta + Alexandre Oliva + François Pinard + Artur Pioro + Dan Rich + (contribute to evolve mime-image.el with XEmacs) + Katsumi Yamaoka diff --git a/TODO b/TODO index 85171d1..c7de264 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,6 @@ +[TODO] +====== + * MIME-View ** Mother entity should modify preview-situation of children @@ -15,6 +18,22 @@ ** Use MIME-Preview like tag and display +** Redesign to use two buffers for one message + + MIME-View is based on "Multiple Representation Space (layer) Model". +In this model, network representation and its presentation are +distinguished. Thus MIME-View uses two buffers for one message, +'mime-raw-buffer (for network representation) and +'mime-preview-buffer. MIME-View manages them based on information of +entities. According to experience of MIME-View, this model is good to +treat complex structured data, such as MIME. + + MIME-Edit was designed to use one buffer for one message. So it is +hard to edit like WYSIWYG style. Format of tag is limited by +translation. Content of forwarded message is unreadable. It is +better to introduce "Multiple Representation Space Model" to resolve +these problems. + ** Check available MIME-charset MIME-charset $B0J30$,@8@.$5$l$k>l9g$N=hM}$r;XDj$G$-$k$h$&$K$9$k!#(B @@ -25,3 +44,23 @@ (b) display warning message (e.g. "`x-ctext' is generated. Do you send it? (yes/no)") (c) stop sending + +** Don't use buffer-local variables + + Don't use buffer-local variables to control behavior about +translating to network representation, such as 'mime-transfer-level, +'mime-transfer-level-string, +'mime-edit-charset-default-encoding-alist, 'mime-edit-pgp-processing. +Because they have problem with Semi-gnus. + + +* Etc. + +** Write manual + + + +[Known Bugs] +============ + +* MIME-Edit diff --git a/mime-edit.el b/mime-edit.el index b9f0d3e..4209551 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -2553,10 +2553,9 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n" (goto-char (point-min)) (let ((ctl (mime-read-Content-Type))) (if ctl - (let ((type (car ctl)) - (stype (car (cdr ctl))) - (params (cdr (cdr ctl))) - ) + (let ((type (mime-content-type-primary-type ctl)) + (stype (mime-content-type-subtype ctl)) + (params (mime-content-type-parameters ctl))) (cond ((and (eq type 'application)(eq stype 'pgp-signature)) (delete-region (point-min)(point-max)) diff --git a/mime-parse.el b/mime-parse.el index ea75f65..b389222 100644 --- a/mime-parse.el +++ b/mime-parse.el @@ -28,16 +28,6 @@ (require 'std11) (require 'mime-def) -(defsubst symbol-concat (&rest args) - "Return a symbol whose name is concatenation of arguments ARGS -which are string or symbol." - (intern (mapconcat (function - (lambda (s) - (cond ((symbolp s) (symbol-name s)) - ((stringp s) s) - ))) - args ""))) - ;;; @ field parser ;;; @@ -78,6 +68,16 @@ which are string or symbol." (substring str e) )))) + +;;; @ 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 @@ -97,9 +97,34 @@ are string." (setq dest (cons (car ret) dest) string (cdr ret)) ) - (cons (intern type) (cons (intern subtype) (nreverse dest))) + (make-mime-content-type (intern type)(intern subtype) + (nreverse dest)) ))) +(defun mime-read-Content-Type () + "Read field-body of Content-Type field from current-buffer, +and return parsed it. Format of return value is as same as +`mime-parse-Content-Type'." + (let ((str (std11-field-body "Content-Type"))) + (if str + (mime-parse-Content-Type str) + ))) + +(defsubst mime-content-type-primary-type (content-type) + "Return primary-type of CONTENT-TYPE." + (cdr (car content-type))) + +(defsubst mime-content-type-subtype (content-type) + "Return primary-type of CONTENT-TYPE." + (cdr (cadr content-type))) + +(defsubst mime-content-type-parameters (content-type) + "Return primary-type of CONTENT-TYPE." + (cddr content-type)) + + +;;; @ Content-Disposition +;;; (defconst mime-disposition-type-regexp mime-token-regexp) @@ -108,33 +133,41 @@ are string." (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)) ))) - -;;; @ field reader -;;; - -(defun mime-read-Content-Type () - "Read field-body of Content-Type field from current-buffer, -and return parsed it. Format of return value is as same as -`mime-parse-Content-Type'." - (let ((str (std11-field-body "Content-Type"))) +(defun mime-read-Content-Disposition () + "Read field-body of Content-Disposition field from current-buffer, +and return parsed it." + (let ((str (std11-field-body "Content-Disposition"))) (if str - (mime-parse-Content-Type str) + (mime-parse-Content-Disposition str) ))) -(defun mime/Content-Transfer-Encoding (&optional default-encoding) +(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-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 @@ -143,16 +176,7 @@ If is is not found, return DEFAULT-ENCODING. [mime-parse.el]" ) (downcase str) ) - default-encoding) - )) - -(defun mime/Content-Disposition () - "Read field-body of Content-Disposition field from current-buffer, -and return parsed it. [mime-parse.el]" - (let ((str (std11-field-body "Content-Disposition"))) - (if str - (mime-parse-Content-Disposition str) - ))) + default-encoding))) ;;; @ message parser @@ -193,8 +217,8 @@ and return parsed it. [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 @@ -232,11 +256,10 @@ DEFAULT-CTL is used when an entity does not have valid Content-Type field. Its format must be as same as return value of mime-{parse|read}-Content-Type." (setq default-ctl (or (mime-read-Content-Type) default-ctl)) - (let ((primtype (car default-ctl)) - (subtype (car (cdr default-ctl))) - (params (cdr (cdr default-ctl))) - (encoding (or (mime/Content-Transfer-Encoding) default-encoding)) - ) + (let ((primtype (mime-content-type-primary-type default-ctl)) + (subtype (mime-content-type-subtype default-ctl)) + (params (mime-content-type-parameters default-ctl)) + (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-partial.el b/mime-partial.el index cb9d439..c240070 100644 --- a/mime-partial.el +++ b/mime-partial.el @@ -84,7 +84,9 @@ partial messages using mime-view." (if (string= the-id id) (progn (mime-method-to-store-message/partial - (point-min)(point-max) parameters) + (mime-entity-point-min mime-raw-message-info) + (mime-entity-point-max mime-raw-message-info) + parameters) (if (file-exists-p full-file) (throw 'tag nil) ) 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 3572e09..349155c 100644 --- a/mime-view.el +++ b/mime-view.el @@ -918,8 +918,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)) diff --git a/semi-def.el b/semi-def.el index dce3382..03dc72a 100644 --- a/semi-def.el +++ b/semi-def.el @@ -29,7 +29,7 @@ (eval-when-compile (require 'cl)) -(defconst mime-module-version '("WEMI" "Chigasaki" 1 4 2) +(defconst mime-module-version '("WEMI" "Hiratsuka" 1 4 3) "Implementation name, version name and numbers of MIME-kernel package.") (autoload 'mule-caesar-region "mule-caesar" -- 1.7.10.4