From e791364898616771469e70c43bacc3daa2f8aea6 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 6 Jul 1998 14:32:04 +0000 Subject: [PATCH] Sync up with flim-1_3_0 to flim-1_8_1. --- ChangeLog | 494 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ FLIM-ELS | 2 + FLIM-VERSION | 38 +++-- Makefile | 21 +-- README.en | 177 ++------------------ eword-decode.el | 39 ++--- mailcap.el | 7 +- mel-b.el | 121 +++++++++----- mel-q.el | 79 ++++----- mel.el | 34 +++- mime-def.el | 133 ++++++++++++++- 11 files changed, 840 insertions(+), 305 deletions(-) diff --git a/ChangeLog b/ChangeLog index ecbc77a..7b5dad3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1998-07-06 Tanaka Akira + + * Sync up with flim-1_3_0 to flim-1_8_1. + 1998-06-08 Tanaka Akira * Sync up with flim-1_2_1 to flim-1_3_0. @@ -118,6 +122,496 @@ * Sync up with flim-1_0_0 to flim-1_0_1. +1998-07-05 MORIOKA Tomohiko + + * FLIM: Version 1.8.1 (Kutsukawa) was released. + +1998-07-04 MORIOKA Tomohiko + + * mime-en.sgml, mime-ja.sgml (Entity Attributes): Add description + about `default-encoding' of `mime-entity-encoding'. + + * mime-en.texi, mime-en.sgml: New files. + + * mime-ja.sgml (media-type): Fix typo. + + * mime-ja.sgml (Glossary): Fix order. + + * mime-ja.sgml (Entity Attributes): Use tag for nil. + + * mime-ja.sgml (Entity Attributes): Fix typo. + +1998-07-03 MORIOKA Tomohiko + + * mime.el (mime-entity-encoding): Add new optional argument + `default-encoding'; set default encoding if + Content-Transfer-Encoding field is not found. + +1998-07-03 MORIOKA Tomohiko + + * mmbuffer.el (mmbuffer-write-entity): Use + `mime-entity-buffer-internal', `mmbuffer-entity-point-min' and + `mmbuffer-entity-point-max'. + (mmbuffer-write-entity-body): Use `mime-entity-buffer-internal', + `mime-entity-body-start-internal' and + `mime-entity-body-end-internal'. + (mmbuffer-insert-decoded-header): Use + `mime-entity-buffer-internal', `mime-entity-header-start-internal' + and `mime-entity-header-end-internal'. + + +1998-07-01 MORIOKA Tomohiko + + * FLIM: Version 1.8.0 (-DÒkubo)-A was released. + + * README.en: Delete `How to use'. + +1998-07-01 MORIOKA Tomohiko + + * mime-ja.sgml (Entity creation): Add reference for `mm-backend' + in description of `mime-open-entity'. + + * mime-ja.sgml (mm-backend): New section. + +1998-07-01 MORIOKA Tomohiko + + * mime-ja.sgml (Entity-header): Modify description about + `mime-insert-decoded-header'. + + * mmcooked.el (mmcooked-insert-decoded-header): New function. + + * mmbuffer.el (mmbuffer-insert-decoded-header): New function. + + * mime.el (mime-insert-decoded-header): Use implementation of + mm-backend; abolish optional argument `code-conversion'. + +1998-06-30 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-encoded-text): Use + `decode-mime-charset-string'. + +1998-06-30 MORIOKA Tomohiko + + * mmcooked.el (mmcooked-write-entity-body): New function. + + * mmbuffer.el (mmbuffer-write-entity-body): New function. + + * mime.el (mime-write-entity-body): Use implementation of + mm-backend. + +1998-06-30 MORIOKA Tomohiko + + * mmcooked.el (mmcooked-write-entity): New function. + + * mmbuffer.el (mmbuffer-write-entity): New function. + + * mime.el (mime-write-entity): Use implementation of mm-backend. + +1998-06-30 MORIOKA Tomohiko + + * mmcooked.el (mmcooked-entity-content): New alias for + `mmbuffer-entity-content'. + (mmcooked-write-entity-content): New function. + + * mmbuffer.el (mmbuffer-entity-content): New function. + (mmbuffer-write-entity-content): New function. + + * mime.el (mime-entity-send): New function. + (mime-entity-buffer): Use `mime-entity-send'. + (mime-entity-point-min): Likewise. + (mime-entity-point-max): Likewise. + (mime-entity-header-start): Likewise. + (mime-entity-header-end): Likewise. + (mime-entity-body-start): Likewise. + (mime-entity-body-end): Likewise. + (mime-fetch-field): Likewise. + (mime-entity-content): Use implementation of mm-backend. + (mime-write-entity-content): Likewise. + + +1998-06-30 MORIOKA Tomohiko + + * FLIM: Version 1.7.0 (Iseda) was released. + + * mime-ja.sgml (Entity creation): Add description of + `mime-open-entity'. + (Entity Attributes): Add description of `mime-entity-cooked-p'. + (Entity-content): Add description of `mime-write-entity-content', + `mime-write-entity' and `mime-write-entity-body'. + +1998-06-29 MORIOKA Tomohiko + + * mime.el (mime-write-entity-content): New function. + +1998-06-28 MORIOKA Tomohiko + + * mime.el (mime-write-entity-body): New function. + + * mime.el (mime-write-entity): New function. + +1998-06-28 MORIOKA Tomohiko + + * mime-parse.el (mime-parse-multipart): Change media-type of + entity to application/octet-stream if the first delimiter is not + found. + +1998-06-28 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Add `mmbuffer' and `mmcooked'. + + * mmcooked.el: New file. + + * mmbuffer.el: New file. + + * mime.el (mime-entity-implementation-alist): New variable. + (mime-find-function): New function. + (mime-open-entity): New function. + (mime-entity-function): New function. + (mime-entity-cooked-p): New function. + (mime-entity-buffer): Use backend-module. + (mime-entity-point-min): Likewise. + (mime-entity-point-max): Likewise. + (mime-entity-header-start): Likewise. + (mime-entity-header-end): Likewise. + (mime-entity-body-start): Likewise. + (mime-entity-body-end): Likewise. + (mime-fetch-field): Likewise. + + * mime-parse.el (mime-parse-message): New optional argument + `representation-type'. + (mime-parse-buffer): Likewise. + + * mime-def.el: Change format of mime-entity-internal to add + `representation-type' and `location'. + + +1998-06-28 MORIOKA Tomohiko + + * FLIM-Chao: Version 1.7.0 (Goj-Dò)-A was released. + +1998-06-26 MORIOKA Tomohiko + + * mime-ja.sgml: Modify for FLIM 1.7. + + * mime.el (mime-entity-number): Add DOC. + +1998-06-26 MORIOKA Tomohiko + + * mime.el (mime-entity-encoding): New implementation. + + * mime-parse.el (mime-parse-message): Abolish argument `encoding'. + + * mime-def.el (make-mime-entity-internal): Abolish argument + `encoding'. + (mime-entity-set-encoding-internal): New function. + +1998-06-26 MORIOKA Tomohiko + + * mime.el (mime-entity-content-disposition): New implementation. + + * mime-parse.el (mime-parse-message): Don't parse + Content-Disposition. + + * mime-def.el (make-mime-entity-internal): Delete argument + `content-disposition'. + (mime-entity-set-content-disposition-internal): New function. + +1998-06-25 MORIOKA Tomohiko + + * eword-decode.el: Move function `eword-visible-field-p' and + `mime-insert-decoded-header' to mime.el. + + * mime-parse.el: Use internal functions of mime-entity. + + * mime.el (mime-entity-children): Moved from mime-def.el; use + `mime-entity-children-internal'. + (mime-entity-node-id): Moved from mime-def.el; use + `mime-entity-node-id-internal'. + (mime-entity-number): Moved from mime-def.el; use + `mime-entity-node-id-internal'. + (mime-entity-buffer): Moved from mime-def.el; use + `mime-entity-buffer-internal'. + (mime-entity-point-min): Moved from mime-def.el; use + `mime-entity-header-start-internal'. + (mime-entity-point-max): Moved from mime-def.el; use + `mime-entity-body-end-internal'. + (mime-entity-header-start): Moved from mime-def.el; use + `mime-entity-header-start-internal'. + (mime-entity-header-end): Moved from mime-def.el; use + `mime-entity-header-end-internal'. + (mime-entity-content-type): Moved from mime-def.el; use + `mime-entity-content-type-internal'. + (mime-entity-content-disposition): Moved from mime-def.el; use + `mime-entity-content-disposition-internal'. + (mime-entity-encoding): Moved from mime-def.el; use + `mime-entity-encoding-internal'. + (mime-fetch-field): Use `mime-entity-original-header-internal' and + `mime-entity-set-original-header-internal'. + (mime-read-field): Use `mime-entity-parsed-header-internal' and + `mime-entity-set-parsed-header-internal'. + (eword-visible-field-p): Moved from eword-decode.el. + (mime-insert-decoded-header): Moved from eword-decode.el. + (mime-entity-body-start): Moved from mime-def.el; use + `mime-entity-body-start-internal'. + (mime-entity-body-end): Moved from mime-def.el; use + `mime-entity-body-end-internal'. + (mime-entity-media-type): Moved from mime-def.el. + (mime-entity-media-subtype): Moved from mime-def.el. + (mime-entity-parameters): Moved from mime-def.el. + (mime-entity-type/subtype): Moved from mime-def.el. + + * mime-def.el (make-mime-entity-internal): Renamed from + `make-mime-entity'. + (mime-entity-buffer-internal): New function. + (mime-entity-header-start-internal): New function. + (mime-entity-header-end-internal): New function. + (mime-entity-body-start-internal): New function. + (mime-entity-body-end-internal): New function. + (mime-entity-node-id-internal): New function. + (mime-entity-content-type-internal): New function. + (mime-entity-content-disposition-internal): New function. + (mime-entity-encoding-internal): New function. + (mime-entity-original-header-internal): New function. + (mime-entity-children-internal): New function. + (mime-entity-parsed-header-internal): New function. + (mime-entity-set-original-header-internal): Renamed from + `mime-entity-set-original-header'. + (mime-entity-set-children-internal): Renamed from + `mime-entity-set-children'. + (mime-entity-set-parsed-header-internal): Renamed from + `mime-entity-set-parsed-header'. Move `mime-entity-SLOT' + functions to mime.el. + +1998-06-25 MORIOKA Tomohiko + + * mime-ja.sgml (CVS): Fix typo. + +1998-06-24 MORIOKA Tomohiko + + * mime-parse.el (mime-parse-encapsulated): New function. + (mime-parse-message): Use `mime-parse-encapsulated'. + +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. + + +1998-06-24 MORIOKA Tomohiko + + * FLIM: Version 1.6.0 (Ogura) was released. + + * mime-ja.sgml (Entity Attributes): New section. + + * mime-ja.sgml (Entity as node in message): Add description of + `mime-find-entity-from-number' and + `mime-find-entity-from-node-id'. + + * mime.el (mime-find-entity-from-number): New function. + (mime-find-entity-from-node-id): New function. + (mime-entity-parent): New function (moved from SEMI MIME-View). + (mime-entity-uu-filename): New function (moved from SEMI + MIME-View). + (mime-entity-filename): New function (moved from SEMI MIME-View). + + * mime-def.el (mime-uuencode-encoding-name-list): New variable. + +1998-06-24 MORIOKA Tomohiko + + * mime-ja.sgml: Modify for FLIM 1.6. + + * mime.el (mime-fetch-field): New function; abolish + `mime-entity-fetch-field'. + (mime-read-field): New function; abolish `mime-entity-read-field'. + +1998-06-23 MORIOKA Tomohiko + + * mime-ja.sgml, mime-ja.texi: New files. + +1998-06-22 Shuhei KOBAYASHI + + * mime-parse.el (mime-parse-message): Would error if empty body. + + +1998-06-22 MORIOKA Tomohiko + + * FLIM: Version 1.5.0 (Mukaijima) was released. + +1998-06-21 MORIOKA Tomohiko + + * README.en (What's FLIM): Modify for mime.el. + + * FLIM-ELS (flim-modules): Add `mime'. + + * mime-lib.el: Move every definitions to mime.el. + + * mime.el: New module (renamed from mime-lib.el). + +1998-06-21 MORIOKA Tomohiko + + * mime-lib.el: Add autoload setting for eword-encode.el. + + * mime-lib.el (mime-entity-content): New function. + +1998-06-20 MORIOKA Tomohiko + + * mel.el: Abolish constant `mel-version'. + + * mel.el (mime-string-decoding-method-alist): New variable. + (mime-decode-string): New function. + +1998-06-20 MORIOKA Tomohiko + + * mel-b.el (base64-external-decode-string): New function. + (base64-decode-string): New function. + +1998-06-20 MORIOKA Tomohiko + + * mel-q.el (quoted-printable-decode-string): New implementation. + +1998-06-20 MORIOKA Tomohiko + + * mel-q.el (quoted-printable-internal-decode-region): New + implementation. + +1998-06-20 MORIOKA Tomohiko + + * mel-q.el (q-encoding-decode-string): Use + `quoted-printable-hex-char-to-num'. + + * mel-q.el (quoted-printable-hex-char-to-num): New function. + (quoted-printable-decode-string): Use + `quoted-printable-hex-char-to-num'. + +1998-06-19 MORIOKA Tomohiko + + * mime-def.el, mime-parse.el: Move `mime-message-structure' from + mime-parse.el to mime-def.el. + +1998-06-19 MORIOKA Tomohiko + + * mime-lib.el, mime-parse.el: Move `mime-root-entity-p' from + mime-parse.el to mime-lib.el. + + * mime-lib.el: Add autoload setting for mime-parse.el. + +1998-06-19 MORIOKA Tomohiko + + * mime-parse.el, mime-def.el: Move `mime-entity-point-min', + `mime-entity-point-max', `mime-entity-media-type', + `mime-entity-media-subtype', `mime-entity-parameters' and + `mime-entity-type/subtype' from mime-parse.el to mime-def.el. + + * mime-parse.el, mime-def.el: Move `mime-content-disposition' + reference functions from mime-parse.el to mime-def.el. + + * mime-parse.el, mime-def.el: Move structure `mime-content-type' + from mime-parse.el to mime-def.el. + +1998-06-19 MORIOKA Tomohiko + + * mel-b.el (base64-internal-decode-string): Renamed from + `base64-decode-string'. + (base64-decode-string): New alias for + `base64-internal-decode-string'. + +1998-06-19 MORIOKA Tomohiko + + * mel-b.el (base64-decode-unit): New function; abolish + `base64-decode-1'. + (base64-decode-string): New implementation. + (base64-internal-decode-region): New implementation. + +1998-06-19 MORIOKA Tomohiko + + * mime-parse.el (mime-message-structure): New variable. + (mime-parse-buffer): New function. + +1998-06-19 Shuhei KOBAYASHI + + * mime-def.el: Require 'cl when it is compiled. + + * mime-lib.el (mime-entity-read-field): Fix typo. + Use `eword-decode-ignored-field-list'. + + * mime-parse.el (mime-parse-multipart): Fix typo. + (mime-parse-message): Parse message/external-body. + + +1998-06-19 MORIOKA Tomohiko + + * FLIM: Version 1.4.1 (Momoyama-Gory-Dòmae)-A was released. + +1998-06-18 MORIOKA Tomohiko + + * eword-decode.el (mime-insert-decoded-header): Fix typo. + + +1998-06-18 MORIOKA Tomohiko + + * FLIM: Version 1.4.0 (Kintetsu-Tanbabashi) was released. + +1998-06-18 MORIOKA Tomohiko + + * README.en (What's FLIM): Add description about mime-lib.el and + mime-parse.el. + +1998-06-17 MORIOKA Tomohiko + + * mime-parse.el: Require 'cl when it is compiled. + + * eword-decode.el (eword-visible-field-p): New function. + (mime-insert-decoded-header): Use `eword-visible-field-p'. + +1998-06-17 MORIOKA Tomohiko + + * mime-def.el (mime-library-version-string): Renamed from + `mime-spadework-module-version-string'. + + * mime-parse.el: New file; moved from SEMI layer. + + * FLIM-ELS (flim-modules): Add `mime-parse'. + +1998-06-17 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Add `mime-lib'. + + * mime-lib.el: New module. + + * mime-def.el (mime-entity): Add new slots for original-header and + parsed-header. + (mime-entity-set-original-header): New function. + (mime-entity-set-parsed-header): New function. + +1998-06-16 MORIOKA Tomohiko + + * mime-def.el (mime-entity-number): New function (moved from SEMI + layer). + +1998-06-16 MORIOKA Tomohiko + + * mime-def.el: Move definition of structure `mime-entity' from + SEMI layer. + +1998-06-16 MORIOKA Tomohiko + + * eword-decode.el (eword-decode-ignored-field-list): Capitalize + default value. + (eword-decode-structured-field-list): Capitalize default value. + (eword-decode-header): Regularize field name by `capitalize'. + (mime-insert-decoded-header): New function. + +1998-06-15 MORIOKA Tomohiko + + * mailcap.el (mailcap-file): Use `defcustom'. + + 1998-06-01 MORIOKA Tomohiko * FLIM: Version 1.3.0 (Fushimi) was released. diff --git a/FLIM-ELS b/FLIM-ELS index e388991..3e53c65 100644 --- a/FLIM-ELS +++ b/FLIM-ELS @@ -8,6 +8,8 @@ mime-def mel mel-dl mel-b mel-q mel-u mel-g eword-decode eword-encode + mime mime-parse mmbuffer mmcooked + ;; mime-lib mailcap)) (if (fboundp 'dynamic-link) diff --git a/FLIM-VERSION b/FLIM-VERSION index 7ad1299..a2838ed 100644 --- a/FLIM-VERSION +++ b/FLIM-VERSION @@ -3,25 +3,35 @@ 1.0.0 ----- ;;------------------------------------------------------------------------- -;; Kinki Nippon Railway -;; $(B6a5&F|K\E4F;(B http://www.kintetsu.co.jp/ -;; Ky-Dòto-A Line $(B5~ET@~(B +;; Kinki Nippon Railway $(B6a5&F|K\E4F;(B http://www.kintetsu.co.jp/ +;; Ky-Dòto-A Line $(B5~ET@~(B ;;------------------------------------------------------------------------- -1.0.1 Ky-Dòto-A $(B5~ET(B ; <=> JR -1.1.0 T-Dòji-A $(BEl;{(B -1.2.0 J-Dþjò-A $(B==>r(B -1.2.1 Kamitobaguchi $(B>eD;1)8}(B -1.2.2 Takeda $(BC]ED(B ; = $(B5~ET;T8rDL6I(B $(B1(4]@~(B -1.3.0 Fushimi $(BIz8+(B +1.0.1 Ky-Dòto-A $(B5~ET(B ; <=> JR, $(B5~ET;T8rDL6I(B +1.1.0 T-Dòji-A $(BEl;{(B +1.2.0 J-Dþjò-A $(B==>r(B +1.2.1 Kamitobaguchi $(B>eD;1)8}(B +1.2.2 Takeda $(BC]ED(B ; = $(B5~ET;T8rDL6I(B $(B1(4]@~(B +1.3.0 Fushimi $(BIz8+(B +1.4.0 Kintetsu-Tanbabashi $(B6aE4C0GH66(B ; <=> $(B5~:e(B $(BC0GH66(B +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.7.0 Iseda $(B0K@*ED(B +1.8.0 -DÒkubo-A $(BBg5WJ](B +1.8.1 Kutsukawa $(B5WDE@n(B [Chao Version names] ;;------------------------------------------------------------------------- ;; Kyoto Municipal Transfer Bureau -;; $(B5~ET;T8rDL6I(B -;; http://www.city.kyoto.jp/kotsu/main.htm -;; Karasuma Line $(B1(4]@~(B +;; $(B5~ET;T8rDL6I(B +;; http://www.city.kyoto.jp/kotsu/main.htm +;; Karasuma Line $(B1(4]@~(B ;;------------------------------------------------------------------------- -1.2.0 Takeda $(BC]ED(B ; = $(B6aE4(B $(B5~ET@~(B -1.3.0 Kuinabashi $(B$/$$$J66(B +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 +1.6.1 Ky-Dòto-A $(B5~ET(B ; <=> JR, $(B6aE4(B +1.7.0 Goj-Dò-A $(B8^>r(B diff --git a/Makefile b/Makefile index 00e3361..7ab5b51 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ # Makefile for FLIM. # -VERSION = 1.3.0 +PACKAGE = flim +VERSION = 1.8.1 TAR = tar RM = /bin/rm -f @@ -31,20 +32,20 @@ clean: tar: cvs commit - sh -c 'cvs tag -RF flim-`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 flim-$(VERSION) \ - -r flim-`echo $(VERSION) | sed s/\\\\./_/ | sed s/\\\\./_/` \ + export -d $(PACKAGE)-$(VERSION) \ + -r $(PACKAGE)-`echo $(VERSION) | sed s/\\\\./_/ | sed s/\\\\./_/` \ flim' - cd /tmp; $(RM) flim-$(VERSION)/ftp.in ; \ - $(TAR) cvzf flim-$(VERSION).tar.gz flim-$(VERSION) - cd /tmp; $(RM) -r flim-$(VERSION) + cd /tmp; $(RM) $(PACKAGE)-$(VERSION)/ftp.in ; \ + $(TAR) cvzf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) + cd /tmp; $(RM) -r $(PACKAGE)-$(VERSION) sed "s/VERSION/$(VERSION)/" < ftp.in > ftp release: - -$(RM) /pub/GNU/elisp/apel/flim-$(VERSION).tar.gz - mv /tmp/flim-$(VERSION).tar.gz /pub/GNU/elisp/flim/ + -$(RM) /pub/GNU/elisp/apel/$(PACKAGE)-$(VERSION).tar.gz + mv /tmp/$(PACKAGE)-$(VERSION).tar.gz /pub/GNU/elisp/flim/ cd /pub/GNU/elisp/semi/ ; \ - ln -s ../flim/flim-$(VERSION).tar.gz . + ln -s ../flim/$(PACKAGE)-$(VERSION).tar.gz . diff --git a/README.en b/README.en index d7c06e1..74bf582 100644 --- a/README.en +++ b/README.en @@ -9,19 +9,20 @@ What's FLIM std11.el --- STD 11 (RFC 822) parser and utility - mime-def.el --- Definitions about MIME format + mime.el --- MIME library - MEL: MIME encoder/decoder - mel.el --- main module - mel-dl.el --- base64 (b-encoding) encoder/decoder - (for Emacs 20 with dynamic loading support) - mel-b.el --- base64 (b-encoding) encoder/decoder - (for other emacsen) - mel-q.el --- quoted-printable and q-encoding encoder/decoder - mel-u.el --- unofficial module for uuencode - mel-g.el --- unofficial module for gzip64 + mime-def.el --- Definitions about MIME format - eword: encoded-word encoder/decoder + mime-parse.el --- MIME parser + + mel.el --- MIME encoder/decoder + mel-dl.el --- base64 (b-encoding) encoder/decoder + (for Emacs 20 with dynamic loading support) + mel-b.el --- base64 (b-encoding) encoder/decoder + (for other emacsen) + mel-q.el --- quoted-printable and q-encoding encoder/decoder + mel-u.el --- unofficial module for uuencode + mel-g.el --- unofficial module for gzip64 eword-decode.el --- encoded-word decoder eword-encode.el --- encoded-word encoder @@ -102,160 +103,6 @@ load-path (for Emacs or MULE) load-path. -How to use -========== - -Region ------- - -Command mime-encode-region (START END ENCODING) - - Encode region START to END of current buffer using ENCODING. - -Command mime-decode-region (start end encoding) - - Decode region START to END of current buffer using ENCODING. - -Command base64-encode-region (start end) - - Encode current region by base64. - START and END are buffer positions. - - This function calls internal base64 encoder if size of region is - smaller than `base64-internal-encoding-limit', otherwise it calls - external base64 encoder specified by `base64-external-encoder'. In - this case, you must install the program (maybe mmencode included in - metamail or XEmacs package). - -Command base64-decode-region (start end) - - Decode current region by base64. - START and END are buffer positions. - - This function calls internal base64 decoder if size of region is - smaller than `base64-internal-decoding-limit', otherwise it calls - external base64 decoder specified by `base64-external-decoder'. In - this case, you must install the program (maybe mmencode included in - metamail or XEmacs package). - -Command quoted-printable-encode-region (start end) - - Encode current region by quoted-printable. - START and END are buffer positions. - - This function calls internal quoted-printable encoder if size of - region is smaller than `quoted-printable-internal-encoding-limit', - otherwise it calls external quoted-printable encoder specified by - `quoted-printable-external-encoder'. In this case, you must install - the program (maybe mmencode included in metamail or XEmacs package). - -Command quoted-printable-decode-region (start end) - - Decode current region by quoted-printable. - START and END are buffer positions. - - This function calls internal quoted-printable decoder if size of - region is smaller than `quoted-printable-internal-decoding-limit', - otherwise it calls external quoted-printable decoder specified by - `quoted-printable-external-decoder'. In this case, you must install - the program (maybe mmencode included in metamail or XEmacs package). - -Command uuencode-encode-region (start end) - - Encode region START to END of current buffer using uuencode. - -Command uuencode-decode-region (start end) - - Decode region START to END of current buffer using uuencode. - -Command gzip64-encode-region (start end) - - Encode region START to END of current buffer using x-gzip64. - -Command gzip64-decode-region (start end) - - Decode region START to END of current buffer using x-gzip64. - -Variable mime-encoding-method-alist - - Alist of encoding vs. corresponding method to encode region. - Each element looks like (STRING . FUNCTION) or (STRING . nil). - STRING is content-transfer-encoding. - FUNCTION is region encoder and nil means not to encode. - -Variable mime-decoding-method-alist - - Alist of encoding vs. corresponding method to decode region. - Each element looks like (STRING . FUNCTION). - STRING is content-transfer-encoding. - FUNCTION is region decoder. - -File ----- - -Command mime-insert-encoded-file (FILENAME ENCODING) - - Insert file FILENAME encoded by ENCODING format. - -Command base64-insert-encoded-file (FILENAME) - - Encode contents of file FILENAME to base64, and insert the result. - - It calls external base64 encoder specified by - `base64-external-encoder'. So you must install the program (maybe - mmencode included in metamail or XEmacs package). - -Command quoted-printable-insert-encoded-file (FILENAME) - - Insert quoted-printable encoded file. - -Command uuencode-insert-encoded-file (FILENAME) - - Insert uuencode encoded file. - -Command gzip64-insert-encoded-file (FILENAME) - - Insert gzip64 encoded file. - -Variable mime-file-encoding-method-alist - - Alist of encoding vs. corresponding method to insert encoded file. - Each element looks like (STRING . FUNCTION). - STRING is content-transfer-encoding. - FUNCTION is function to insert encoded file. - -String ------- - -Function base64-encode-string (STRING) - - Encode STRING to base64, and return the result. - -Function base64-decode-string (STRING) - - Decode STRING which is encoded in base64, and return the result. - -Function q-encoding-encode-string (STRING &optional MODE) - - Encode STRING to Q-encoding of encoded-word, and return the result. - MODE allows `text', `comment', `phrase' or nil. Default value is - `phrase'. - -Function q-encoding-decode-string (STRING) - - Decode STRING which is encoded in Q-encoding and return the result. - -Function base64-encoded-length (STRING) - - Return length of base64 encoded STRING. - -Function q-encoded-length (STRING &optional MODE) - - Return length of Q-encoding encoded STRING. - MODE allows `text', `comment', `phrase' or nil. Default value is - `phrase'. - - Bug reports =========== diff --git a/eword-decode.el b/eword-decode.el index 46063ff..fa07ab1 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -369,17 +369,17 @@ default-mime-charset." ;;; (defcustom eword-decode-ignored-field-list - '(newsgroups path lines nntp-posting-host received message-id date) + '(Newsgroups Path Lines Nntp-Posting-Host Received Message-Id Date) "*List of field-names to be ignored when decoding. Each field name must be symbol." :group 'eword-decode :type '(repeat symbol)) (defcustom eword-decode-structured-field-list - '(reply-to resent-reply-to from resent-from sender resent-sender - to resent-to cc resent-cc bcc resent-bcc dcc - mime-version content-type content-transfer-encoding - content-disposition) + '(Reply-To Resent-Reply-To From Resent-From Sender Resent-Sender + To Resent-To Cc Resent-Cc Bcc Resent-Bcc Dcc + Mime-Version Content-Type Content-Transfer-Encoding + Content-Disposition) "*List of field-names to decode as structured field. Each field name must be symbol." :group 'eword-decode @@ -407,7 +407,7 @@ If SEPARATOR is not nil, it is used as header separator." p (match-end 0) field-name (buffer-substring beg (1- p)) len (string-width field-name) - field-name (intern (downcase field-name)) + field-name (intern (capitalize field-name)) end (std11-field-end)) (cond ((memq field-name eword-decode-ignored-field-list) ;; Don't decode @@ -527,21 +527,18 @@ as a version of Net$cape)." (error "Invalid encoding %s" encoding) ))) ) - (if dest - (progn - (setq dest (decode-coding-string dest cs)) - (if must-unfold - (mapconcat (function - (lambda (chr) - (cond - ((eq chr ?\n) "") - ((eq chr ?\t) " ") - (t (char-to-string chr))) - )) - (std11-unfold-string dest) - "") - dest) - )))))) + (when dest + (setq dest (decode-mime-charset-string dest charset)) + (if must-unfold + (mapconcat (function + (lambda (chr) + (cond ((eq chr ?\n) "") + ((eq chr ?\t) " ") + (t (char-to-string chr))) + )) + (std11-unfold-string dest) + "") + dest)))))) ;;; @ lexical analyze diff --git a/mailcap.el b/mailcap.el index 76b3812..12eee88 100644 --- a/mailcap.el +++ b/mailcap.el @@ -170,8 +170,11 @@ order. Otherwise result is not sorted." (t entries) )))) -(defvar mailcap-file "~/.mailcap" - "*File name of user's mailcap file.") + +(defcustom mailcap-file "~/.mailcap" + "*File name of user's mailcap file." + :group 'mime + :type 'file) (defun mailcap-parse-file (&optional filename order) "Parse FILENAME as a mailcap, and return the result. diff --git a/mel-b.el b/mel-b.el index 4c16f5e..e9a382a 100644 --- a/mel-b.el +++ b/mel-b.el @@ -103,18 +103,19 @@ external decoder is called.") (base64-num-to-char (ash (logand a 3) 4))) "==") )))) -(defun base64-decode-1 (pack) - (let ((a (base64-char-to-num (car pack))) - (b (base64-char-to-num (nth 1 pack))) - (c (nth 2 pack)) - (d (nth 3 pack))) - (concat (char-to-string (logior (ash a 2) (ash b -4))) - (if (and c (setq c (base64-char-to-num c))) - (concat (char-to-string - (logior (ash (logand b 15) 4) (ash c -2))) - (if (and d (setq d (base64-char-to-num d))) - (char-to-string (logior (ash (logand c 3) 6) d)) - )))))) +(defun base64-decode-unit (a b &optional c d) + (condition-case err + (concat + (char-to-string (logior (ash (base64-char-to-num a) 2) + (ash (setq b (base64-char-to-num b)) -4))) + (if (and c (setq c (base64-char-to-num c))) + (concat (char-to-string + (logior (ash (logand b 15) 4) (ash c -2))) + (if (and d (setq d (base64-char-to-num d))) + (char-to-string (logior (ash (logand c 3) 6) d)) + )))) + (error (message (nth 1 err)) + ""))) ;;; @@ base64 encoder/decoder for string @@ -148,11 +149,43 @@ external decoder is called.") )) ))) -(defun base64-decode-string (string) - "Decode STRING which is encoded in base64, and return the result." - (mapconcat (function base64-decode-1) - (pack-sequence string 4) - "")) +(defun base64-internal-decode-string (string) + (let ((len (length string)) + (i 0) + dest) + (while (< i len) + (let ((a (aref string i))) + (setq i (1+ i)) + (unless (eq a ?\n) + (let ((b (aref string i))) + (setq i (1+ i)) + (cond + ((eq b ?\n) + ;; invalid + ) + ((>= i len) + (setq dest (concat dest (base64-decode-unit a b) )) + ) + (t + (let ((c (aref string i))) + (setq i (1+ i)) + (cond + ((eq c ?\n) + (setq dest (concat dest (base64-decode-unit a b))) + ) + ((>= i len) + (setq dest (concat dest (base64-decode-unit a b c))) + ) + (t + (let ((d (aref string i))) + (setq i (1+ i)) + (setq dest + (concat dest + (if (eq c ?\n) + (base64-decode-unit a b c) + (base64-decode-unit a b c d)))) + )))))))))) + dest)) ;;; @ base64 encoder/decoder for region @@ -173,31 +206,10 @@ external decoder is called.") (defun base64-internal-decode-region (beg end) (save-excursion - (save-restriction - (narrow-to-region beg end) - (goto-char (point-min)) - (while (looking-at ".*\n") - (condition-case err - (replace-match - (base64-decode-string - (buffer-substring (match-beginning 0) (1- (match-end 0)))) - t t) - (error - (prog1 - (message (nth 1 err)) - (replace-match ""))))) - (if (looking-at ".*$") - (condition-case err - (replace-match - (base64-decode-string - (buffer-substring (match-beginning 0) (match-end 0))) - t t) - (error - (prog1 - (message (nth 1 err)) - (replace-match ""))) - )) - ))) + (let ((str (buffer-substring beg end))) + (delete-region beg end) + (goto-char beg) + (insert (base64-internal-decode-string str))))) (defun base64-external-encode-region (beg end) (save-excursion @@ -222,6 +234,17 @@ external decoder is called.") t t nil (cdr base64-external-decoder)) ))) +(defun base64-external-decode-string (string) + (with-temp-buffer + (insert string) + (as-binary-process (apply (function call-process-region) + (point-min) (point-max) + (car base64-external-decoder) + t t nil (cdr base64-external-decoder)) + ) + (buffer-string))) + + (defun base64-encode-region (start end) "Encode current region by base64. START and END are buffer positions. @@ -252,6 +275,20 @@ metamail or XEmacs package)." (base64-internal-decode-region start end) )) +(defun base64-decode-string (string) + "Decode STRING which is encoded in base64, and return the result. +This function calls internal base64 decoder if size of STRING is +smaller than `base64-internal-decoding-limit', otherwise it calls +external base64 decoder specified by `base64-external-decoder'. In +this case, you must install the program (maybe mmencode included in +metamail or XEmacs package)." + (interactive "r") + (if (and base64-internal-decoding-limit + (> (length string) base64-internal-decoding-limit)) + (base64-external-decode-string string) + (base64-internal-decode-string string) + )) + ;;; @ base64 encoder/decoder for file ;;; diff --git a/mel-q.el b/mel-q.el index 130865e..d2ddd25 100644 --- a/mel-q.el +++ b/mel-q.el @@ -158,33 +158,11 @@ It calls external quoted-printable encoder specified by ;;; @ Quoted-Printable decoder ;;; -(defun quoted-printable-decode-string (string) - "Decode STRING which is encoded in quoted-printable, and return the result." - (let (q h l) - (mapconcat (function - (lambda (chr) - (cond ((eq chr ?=) - (setq q t) - "") - (q (setq h - (cond ((<= ?a chr) (+ (- chr ?a) 10)) - ((<= ?A chr) (+ (- chr ?A) 10)) - ((<= ?0 chr) (- chr ?0)) - )) - (setq q nil) - "") - (h (setq l (cond ((<= ?a chr) (+ (- chr ?a) 10)) - ((<= ?A chr) (+ (- chr ?A) 10)) - ((<= ?0 chr) (- chr ?0)) - )) - (prog1 - (char-to-string (logior (ash h 4) l)) - (setq h nil) - ) - ) - (t (char-to-string chr)) - ))) - string ""))) +(defsubst quoted-printable-hex-char-to-num (chr) + (cond ((<= ?a chr) (+ (- chr ?a) 10)) + ((<= ?A chr) (+ (- chr ?A) 10)) + ((<= ?0 chr) (- chr ?0)) + )) (defun quoted-printable-internal-decode-region (start end) (save-excursion @@ -195,16 +173,26 @@ It calls external quoted-printable encoder specified by (replace-match "") ) (goto-char (point-min)) - (let (b e str) - (while (re-search-forward quoted-printable-octet-regexp nil t) - (setq b (match-beginning 0)) - (setq e (match-end 0)) - (setq str (buffer-substring b e)) - (delete-region b e) - (insert (string-as-multibyte (quoted-printable-decode-string str))) - )) - ))) - + (while (search-forward "=" nil t) + (let ((beg (match-beginning 0))) + (cond ((looking-at "\n") + (delete-region beg (match-end 0)) + ) + ((looking-at + `,(concat "[" quoted-printable-hex-chars + "][" quoted-printable-hex-chars "]")) + (let* ((end (match-end 0)) + (hex (buffer-substring (match-beginning 0) end))) + (delete-region beg end) + (insert + (logior + (ash (quoted-printable-hex-char-to-num (aref hex 0)) 4) + (quoted-printable-hex-char-to-num (aref hex 1)))) + )) + (t + ;; invalid + )) + ))))) (defvar quoted-printable-external-decoder '("mmencode" "-q" "-u") "*list of quoted-printable decoder program name and its arguments.") @@ -238,6 +226,13 @@ the program (maybe mmencode included in metamail or XEmacs package)." (quoted-printable-internal-decode-region start end) )) +(defun quoted-printable-decode-string (string) + "Decode STRING which is encoded in quoted-printable, and return the result." + (with-temp-buffer + (insert string) + (quoted-printable-decode-region (point-min)(point-max)) + (buffer-string))) + (defvar quoted-printable-external-decoder-option-to-specify-file '("-o") "*list of options of quoted-printable decoder program to specify file.") @@ -299,16 +294,10 @@ MODE allows `text', `comment', `phrase' or nil. Default value is ((eq chr ?=) (setq q t) "") - (q (setq h (cond ((<= ?a chr) (+ (- chr ?a) 10)) - ((<= ?A chr) (+ (- chr ?A) 10)) - ((<= ?0 chr) (- chr ?0)) - )) + (q (setq h (quoted-printable-hex-char-to-num chr)) (setq q nil) "") - (h (setq l (cond ((<= ?a chr) (+ (- chr ?a) 10)) - ((<= ?A chr) (+ (- chr ?A) 10)) - ((<= ?0 chr) (- chr ?0)) - )) + (h (setq l (quoted-printable-hex-char-to-num chr)) (prog1 (char-to-string (logior (ash h 4) l)) (setq h nil) diff --git a/mel.el b/mel.el index 01efaf2..2ed43a4 100644 --- a/mel.el +++ b/mel.el @@ -28,8 +28,6 @@ (require 'emu) -(defconst mel-version "7.5") - ;;; @ variable ;;; @@ -183,6 +181,38 @@ region by its value." ))) +;;; @ string +;;; + +;;;###autoload +(defvar mime-string-decoding-method-alist + '(("base64" . base64-decode-string) + ("quoted-printable" . quoted-printable-decode-string) + ("7bit" . identity) + ("8bit" . identity) + ("binary" . identity) + ) + "Alist of encoding vs. corresponding method to decode string. +Each element looks like (STRING . FUNCTION). +STRING is content-transfer-encoding. +FUNCTION is string decoder.") + +;;;###autoload +(defun mime-decode-string (string encoding) + "Decode STRING using ENCODING. +ENCODING must be string. If ENCODING is found in +`mime-string-decoding-method-alist' as its key, this function decodes +the STRING by its value." + (let ((f (cdr (assoc encoding mime-string-decoding-method-alist)))) + (if f + (funcall f string) + (with-temp-buffer + (insert string) + (mime-decode-region (point-min)(point-max) encoding) + (buffer-string) + )))) + + ;;; @ file ;;; diff --git a/mime-def.el b/mime-def.el index 521c165..90c8a9c 100644 --- a/mime-def.el +++ b/mime-def.el @@ -25,7 +25,7 @@ ;;; Code: (defconst mime-spadework-module-version-string - "FLIM-FLAM 1.3.0 - \"$BFy(B\" 2.5YR8.0/4.0") + "FLIM-FLAM 1.8.0 - \"$B@VAIK'(B\" 7.5R4.0/14.0") ;;; @ variables @@ -33,6 +33,8 @@ (require 'custom) +(eval-when-compile (require 'cl)) + (defgroup mime nil "Emacs MIME Interfaces" :group 'news @@ -51,6 +53,11 @@ :group 'mime :type 'directory) +(defcustom mime-uuencode-encoding-name-list '("x-uue" "x-uuencode") + "*List of encoding names for uuencode format." + :group 'mime + :type '(repeat string)) + ;;; @ required functions ;;; @@ -94,8 +101,7 @@ (defconst std11-quoted-string-regexp (concat "\"" (regexp-* - (regexp-or std11-qtext-regexp std11-quoted-pair-regexp) - ) + (regexp-or std11-qtext-regexp std11-quoted-pair-regexp)) "\"")) @@ -120,9 +126,32 @@ "][" quoted-printable-hex-chars "]")) -;;; @ utility +;;; @ Content-Type ;;; +(defsubst make-mime-content-type (type subtype &optional parameters) + (list* (cons 'type type) + (cons 'subtype subtype) + (nreverse parameters)) + ) + +(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)) + +(defsubst mime-content-type-parameter (content-type parameter) + "Return PARAMETER value of CONTENT-TYPE." + (cdr (assoc parameter (mime-content-type-parameters content-type)))) + + (defsubst mime-type/subtype-string (type &optional subtype) "Return type/subtype string from TYPE and SUBTYPE." (if type @@ -131,6 +160,102 @@ (format "%s" type)))) +;;; @ Content-Disposition +;;; + +(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)) + +(defsubst mime-content-disposition-parameter (content-disposition parameter) + "Return PARAMETER value of CONTENT-DISPOSITION." + (cdr (assoc parameter (cdr content-disposition)))) + +(defsubst mime-content-disposition-filename (content-disposition) + "Return filename of CONTENT-DISPOSITION." + (mime-content-disposition-parameter content-disposition "filename")) + + +;;; @ MIME entity +;;; + +(defsubst make-mime-entity-internal (representation-type + location + &optional content-type children + node-id + buffer + header-start header-end + body-start body-end) + (vector representation-type location + content-type children nil nil node-id + buffer header-start header-end body-start body-end + nil nil)) + +(defsubst mime-entity-representation-type-internal (entity) (aref entity 0)) +(defsubst mime-entity-location-internal (entity) (aref entity 1)) + +(defsubst mime-entity-content-type-internal (entity) (aref entity 2)) +(defsubst mime-entity-children-internal (entity) (aref entity 3)) +(defsubst mime-entity-content-disposition-internal (entity) (aref entity 4)) +(defsubst mime-entity-encoding-internal (entity) (aref entity 5)) +(defsubst mime-entity-node-id-internal (entity) (aref entity 6)) + +(defsubst mime-entity-buffer-internal (entity) (aref entity 7)) +(defsubst mime-entity-header-start-internal (entity) (aref entity 8)) +(defsubst mime-entity-header-end-internal (entity) (aref entity 9)) +(defsubst mime-entity-body-start-internal (entity) (aref entity 10)) +(defsubst mime-entity-body-end-internal (entity) (aref entity 11)) + +(defsubst mime-entity-original-header-internal (entity) (aref entity 12)) +(defsubst mime-entity-parsed-header-internal (entity) (aref entity 13)) + +(defsubst mime-entity-set-representation-type-internal (entity type) + (aset entity 0 type)) +(defsubst mime-entity-set-content-type-internal (entity type) + (aset entity 2 type)) +(defsubst mime-entity-set-children-internal (entity children) + (aset entity 3 children)) +(defsubst mime-entity-set-content-disposition-internal (entity disposition) + (aset entity 4 disposition)) +(defsubst mime-entity-set-encoding-internal (entity encoding) + (aset entity 5 encoding)) +(defsubst mime-entity-set-original-header-internal (entity header) + (aset entity 12 header)) +(defsubst mime-entity-set-parsed-header-internal (entity header) + (aset entity 13 header)) + + +;;; @ message structure +;;; + +(defvar mime-message-structure nil + "Information about structure of message. +Please use reference function `mime-entity-SLOT' to get value of SLOT. + +Following is a list of slots of the structure: + +buffer buffer includes this entity (buffer). +node-id node-id (list of integers) +header-start minimum point of header in raw-buffer +header-end maximum point of header in raw-buffer +body-start minimum point of body in raw-buffer +body-end maximum point of body in raw-buffer +content-type content-type (content-type) +content-disposition content-disposition (content-disposition) +encoding Content-Transfer-Encoding (string or nil) +children entities included in this entity (list of entity) + +If an entity includes other entities in its body, such as multipart or +message/rfc822, `mime-entity' structures of them are included in +`children', so the `mime-entity' structure become a tree.") + +(make-variable-buffer-local 'mime-message-structure) + + ;;; @ end ;;; -- 1.7.10.4