From: yamaoka Date: Fri, 5 Jun 1998 10:34:49 +0000 (+0000) Subject: Sync up with SEMI 1.5.1. X-Git-Tag: wemi-1_5_1~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1ab7d7ca2b06d2c87caf97e7b1cd0a70a647cab2;p=elisp%2Fsemi.git Sync up with SEMI 1.5.1. --- diff --git a/ChangeLog b/ChangeLog index 20c7342..c1083bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,32 @@ 1998-06-05 MORIOKA Tomohiko + * mime-view.el (mime-raw-message-info): Fix typo. + (mime-view-type-subtype-score-alist): New variable. + (mime-preview-multipart/alternative): New function; set up for + `mime-preview-condition'. + (mime-view-display-entity): Add optional argument `situation'. + +1998-06-05 MORIOKA Tomohiko + + * mime-view.el (mime-view-display-entity): Call + body-presentation-method to display multipart if it is function. + + * NEWS: Add news about SEMI 1.5. + +1998-06-05 MORIOKA Tomohiko + + * mime-view.el (mime-preview-multipart/mixed): New function. + (mime-view-display-entity): Use `mime-preview-multipart/mixed'. + +1998-06-05 MORIOKA Tomohiko + + * mime-view.el (mime-view-display-entity): Display entity-button + in body if button is invisible and body-presentation-method is not + found. + + +1998-06-05 MORIOKA Tomohiko + * WEMI: Version 1.5.0 (Kamonomiya) released. 1998-06-04 MORIOKA Tomohiko diff --git a/Makefile b/Makefile index 437d693..b30b0ee 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Makefile for WEMI. # -VERSION = 1.5.0 +VERSION = 1.5.1 PACKAGE = wemi SHELL = /bin/sh diff --git a/NEWS b/NEWS index 460a94f..8e7ba4a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,42 @@ SEMI NEWS --- history of major-changes. Copyright (C) 1998 Free Software Foundation, Inc. +* Changes in SEMI 1.5 + +** text presentation + + Change text presentation mechanism. In anything older than SEMI +1.4, text presentation mechanism is based on filter model. However it +has design problem about conversion between byte representation and +text presentation. So SEMI was changed to use +body-presentation-method to display text entity. In this purpose, old +text decoding features were abolished and introduces news features +(cf. next section). + +** mime-raw-representation-type and mime-raw-representation-type-alist + + Abolish `mime-text-decoder' and `mime-text-decoder-alist' because of +text presentation mechanism change (cf. previous section). Instead of +it, SEMI introduces variable about representation-type of +mime-raw-buffer. If it is `binary', mime-raw-buffer is as same as +network representation. If it is `cooked', mime-raw-buffer is +code-converted. + + `mime-raw-representation-type-alist' is an alist of major-mode +vs. representation-type. Each element looks like + + (SYMBOL . REPRESENTATION-TYPE). + +SYMBOL is major-mode or t. t means default. + + `mime-raw-representation-type' is a buffer local variable of +mime-raw-buffer. If it is non-nil, it overrides +`mime-raw-representation-type-alist'. + + In addition, `mime-raw-buffer-coding-system-alist' was abolished. +Because representation-type has enough information. + + * Changes in SEMI 1.4 ** mailcap diff --git a/VERSION b/VERSION index fa006b1..2105df5 100644 --- a/VERSION +++ b/VERSION @@ -18,13 +18,13 @@ 0.115 Hinomiko $(BF|8f;R(B 0.115.1 Oyanagi $(B>.Lx(B 0.115.2 Inokuchi $(B0f8}(B -0.116 D-Dòhòji-A $(BF;K!;{(B +0.116 D-Dòhòji $(BF;K!;{(B-A 0.118 Sodani $(BA>C+(B 0.118.1 Shijima $(B;M==K|(B 0.118.2 Otomaru $(B254](B -1.0.0 Nukaj-Dþtaku-mae-A $(B3[=;BpA0(B +1.0.0 Nukaj-Dþtaku-mae $(B3[=;BpA0(B-A 1.0.1 Magae $(BGOBX(B -1.0.2 Nonoichi-K-Dòdaimae-A $(BLn!9;T9)BgA0(B +1.0.2 Nonoichi-K-Dòdaimae $(BLn!9;T9)BgA0(B-A 1.1.0 Nonoichi $(BLn!9;T(B 1.1.1 Oshino $(B2!Ln(B 1.1.2 Shin-Nishikanazawa $(B?7@>6bBt(B ; <=> JR $(B@>6bBt(B @@ -40,18 +40,18 @@ 1.2.4 Arimagawa $(BM-4V@n(B 1.3.0 Nadachi $(BL>N)(B 1.3.1 Tsutsuishi $(BE{@P(B -1.3.2 N-Dò-A $(BG=@8(B +1.3.2 N-Dò $(BG=@8(B-A 1.3.3 Uramoto $(B1:K\(B 1.3.4 Kajiyashiki $(B3a20I_(B 1.4.0 Itoigawa $(B;e5{@n(B ; = JR $(BBg;e@~(B -1.4.1 -DÒmi-A $(B@D3$(B +1.4.1 -DÒmi $(B@D3$(B-A 1.4.2 Oyashirazu $(B?FITCN(B 1.4.3 Ichiburi $(B;T?6(B -1.4.4 Ecch-Dþ-Miyazaki-A $(B1[Cf5\:j(B +1.4.4 Ecch-Dþ-Miyazaki $(B1[Cf5\:j(B-A 1.4.5 Tomari $(BGq(B -1.4.6 Ny-Dþzen-A $(BF~A1(B -1.5.0 Nishi-Ny-Dþzen-A $(B@>F~A1(B ------ Ikuji $(B@8CO(B +1.4.6 Ny-Dþzen $(BF~A1(B-A +1.5.0 Nishi-Ny-Dþzen $(B@>F~A1(B-A +1.5.1 Ikuji $(B@8CO(B ----- Kurobe $(B9uIt(B ----- Uozu $(B5{DE(B ; <=> $(BIY;3COJ}E4F;(B : : : @@ -68,7 +68,7 @@ : : : ------- Tsuruga $(BFX2l(B ; = JR $(B>.IM@~(B ------- Shin-Hikida $(B?7I%ED(B -------- -DÒmi-Shiotsu-A $(B6a9>1vDE(B ; = JR $(B8P@>@~(B +------- -DÒmi-Shiotsu $(B6a9>1vDE(B ; = JR $(B8P@>@~(B-A ------- Yogo $(BM>8b(B ------- Kinomoto $(BLZ%NK\(B ------- Takatsuki $(B9b7n(B @@ -101,8 +101,11 @@ 1.4.5 Ninomiya $BFs5\(B 1.4.6 K-Dòzu-A $(B9qI\DE(B ; = JR $(B8fEB>l@~(B 1.5.0 Kamonomiya $B3{5\(B ------ Odawara $(B>.ED86(B ; <=> $(B>.ED5^!"H":,EP;3E4F;!"0KF&H":,E4F;(B -: : : +1.5.1 Odawara $(B>.ED86(B ; <=> $(B>.ED5^!"H":,EP;3E4F;!"0KF&H":,E4F;(B +----- Hayakawa $BAa@n(B +----- Nebukawa $B:,I\@n(B +----- Manazuru $B??Da(B +----- Yugawara $BEr2O86(B ----- Atami $(BG.3$(B ; = JR $(B0KEl@~(B ;;------------------------------------------------------------------------- ;; Central Japan Railway $(BEl3$N95RE4F;(B @@ -110,7 +113,7 @@ ----- Kan'nami $(BH!Fn(B : : : ----- Kanayama $(B6b;3(B ; =$(B!J(BJR $(BCf1{K\@~!K(B ------ Ot-Dòbashi-A $(BHxF,66(B +----- Ot-Dòbashi $(BHxF,66(B-A ----- Nagoya $(BL>8E20(B ; = JR $(B4X@>K\@~!J!&Cf1{K\@~!K(B : : : ----- Gifu $(B4tIl(B ; = JR $(B9b;3K\@~(B @@ -124,13 +127,13 @@ ----- Kusatsu $(BApDE(B ; = JR $(BApDE@~(B : : : ----- Yamashina $(B;32J(B ; = JR $(B8P@>@~(B ------ Ky-Dòto-A $(B5~ET(B ; = JR $(BF`NI@~!&;31"K\@~(B +----- Ky-Dòto $(B5~ET(B ; = JR $(BF`NI@~!&;31"K\@~(B-A ; <=> $(B6aE4(B $(B5~ET@~!"5~ET;T8rDL6I(B $(B1(4]@~(B : : : ------ -DÒsaka-A $(BBg:e(B ; = JR $(BBg:e4D>u@~(B <=> JR $(BEl@>@~(B $(BKL?7CO(B +----- -DÒsaka $(BBg:e(B ; = JR $(BBg:e4D>u@~(B <=> JR $(BEl@>@~(B $(BKL?7CO(B-A ; <=> $(BBg:e;T8rDL6I!":e?@!":e5^(B $(BG_ED(B : : : ------ K-Dòbe-A $(B?@8M(B ; = JR $(B;3M[K\@~(B +----- K-Dòbe $(B?@8M(B ; = JR $(B;3M[K\@~(B-A [REMI version names] @@ -142,10 +145,10 @@ 1.4.0 Himi $(BI98+(B 1.5.0 Shimao $(BEgHx(B 1.5.1 Amaharashi $(B1+@2(B -------- Ecch-Dþ-Kokubu-A $(B1[Cf9qJ,(B +------- Ecch-Dþ-Kokubu $(B1[Cf9qJ,(B-A ------- Fushiki $(BIzLZ(B ------- Noumachi $(BG=D.(B -------- Ecch-Dþ-Nakagawa-A $(B1[CfCf@n(B +------- Ecch-Dþ-Nakagawa $(B1[CfCf@n(B-A (Takaoka) ($(B9b2,(B) ; = JR $(BKLN&K\@~!">kC<@~(B @@ -155,7 +158,7 @@ ;; West Japan Railway $(B@>F|K\N95RE4F;(B http://www.westjr.co.jp/ ;; Kosei Line $(B8P@>@~(B ;;------------------------------------------------------------------------- -------- (-DÒmi-Shiotsu)-A ($(B6a9>1vDE(B) ; = JR $(BKLN&K\@~(B +------- (-DÒmi-Shiotsu) ($(B6a9>1vDE(B) ; = JR $(BKLN&K\@~(B-A : : : -------- Nishi--DÒtsu-A $(B@>BgDE(B +------- Nishi--DÒtsu $(B@>BgDE(B-A (Yamashina) ($(B;32J(B) ; = JR $(BEl3$F;K\@~(B diff --git a/mime-view.el b/mime-view.el index 637b148..c23ca8b 100644 --- a/mime-view.el +++ b/mime-view.el @@ -33,6 +33,7 @@ (require 'mime-parse) (require 'semi-def) (require 'calist) +(require 'alist) (require 'mailcap) @@ -69,7 +70,7 @@ ;;; @@ in raw-buffer ;;; -(defvar mime-raw-message-info +(defvar mime-raw-message-info nil "Information about structure of message. Please use reference function `mime-entity-SLOT' to get value of SLOT. @@ -94,6 +95,18 @@ message/rfc822, `mime-entity' structures of them are included in "MIME-preview buffer corresponding with the (raw) buffer.") (make-variable-buffer-local 'mime-preview-buffer) +(defvar mime-raw-representation-type-alist + '((mime-show-message-mode . binary) + (mime-temp-message-mode . binary) + (t . cooked) + ) + "Alist of major-mode vs. representation-type of mime-raw-buffer. +Each element looks like (SYMBOL . REPRESENTATION-TYPE). SYMBOL is +major-mode or t. t means default. REPRESENTATION-TYPE must be +`binary' or `cooked'. +This value is overridden by buffer local variable +`mime-raw-representation-type' if it is not nil.") + ;;; @@ in preview-buffer ;;; @@ -280,21 +293,6 @@ Please redefine this function if you want to change default setting." ;;; @@ entity-header ;;; -;;; @@@ predicate function -;;; - -;; (defvar mime-view-childrens-header-showing-Content-Type-list -;; '("message/rfc822" "message/news")) - -;; (defun mime-view-header-visible-p (entity message-info) -;; "Return non-nil if header of ENTITY is visible." -;; (let ((entity-node-id (mime-entity-node-id entity))) -;; (member (mime-entity-type/subtype -;; (mime-raw-find-entity-from-node-id -;; (cdr entity-node-id) message-info)) -;; mime-view-childrens-header-showing-Content-Type-list) -;; )) - ;;; @@@ entity header filter ;;; @@ -435,6 +433,12 @@ Each elements are regexp of field-name.") (body-presentation-method . mime-preview-text/plain))) (ctree-set-calist-strictly + 'mime-preview-condition + '((type . multipart)(subtype . alternative) + (body . visible) + (body-presentation-method . mime-preview-multipart/alternative))) + +(ctree-set-calist-strictly 'mime-preview-condition '((type . message)(subtype . partial) (body-presentation-method . mime-preview-message/partial-button))) @@ -452,26 +456,13 @@ Each elements are regexp of field-name.") (entity-button . invisible)))) -;;; @@@ entity filter +;;; @@@ entity presentation ;;; (autoload 'mime-preview-text/plain "mime-text") (autoload 'mime-preview-text/enriched "mime-text") (autoload 'mime-preview-text/richtext "mime-text") -(defvar mime-raw-representation-type-alist - '((mime-show-message-mode . binary) - (mime-temp-message-mode . binary) - (t . cooked) - ) - "Alist of major-mode vs. representation-type of mime-raw-buffer. -Each element looks like (SYMBOL . REPRESENTATION-TYPE). SYMBOL is -major-mode or t. t means default. REPRESENTATION-TYPE must be -`binary' or `cooked'. -This value is overridden by buffer local variable -`mime-raw-representation-type' if it is not nil.") - - (defvar mime-view-announcement-for-message/partial (if (and (>= emacs-major-version 19) window-system) "\ @@ -497,6 +488,98 @@ Please press `v' key in this buffer." #'mime-preview-play-current-entity) )) +(defun mime-preview-multipart/mixed (entity situation) + (let ((children (mime-entity-children entity)) + (default-situation + (cdr (assq 'childrens-situation situation)))) + (while children + (mime-view-display-entity (car children) + (save-excursion + (set-buffer mime-raw-buffer) + mime-raw-message-info) + mime-raw-buffer (current-buffer) + default-situation) + (setq children (cdr children)) + ))) + +(defcustom mime-view-type-subtype-score-alist + '(((text . enriched) . 3) + ((text . richtext) . 2) + ((text . plain) . 1) + (t . 0)) + "Alist MEDIA-TYPE vs corresponding score. +MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." + :group 'mime-view + :type '(repeat (cons (choice :tag "Media-Type" + (item :tag "Type/Subtype" + (cons symbol symbol)) + (item :tag "Type" symbol) + (item :tag "Default" t)) + integer))) + +(defun mime-preview-multipart/alternative (entity situation) + (let* ((children (mime-entity-children entity)) + (default-situation + (cdr (assq 'childrens-situation situation))) + (i 0) + (p 0) + (max-score 0) + (situations + (mapcar (function + (lambda (child) + (let ((situation + (or (ctree-match-calist + mime-preview-condition + (append + (or (mime-entity-content-type child) + (make-mime-content-type 'text 'plain)) + (list* (cons 'encoding + (mime-entity-encoding child)) + (cons 'major-mode major-mode) + default-situation))) + default-situation))) + (if (cdr (assq 'body-presentation-method situation)) + (let ((score + (cdr + (or (assoc + (cons + (cdr (assq 'type situation)) + (cdr (assq 'subtype situation))) + mime-view-type-subtype-score-alist) + (assq + (cdr (assq 'type situation)) + mime-view-type-subtype-score-alist) + (assq + t + mime-view-type-subtype-score-alist) + )))) + (if (> score max-score) + (setq p i + max-score score) + ))) + (setq i (1+ i)) + situation) + )) + children))) + (setq i 0) + (while children + (let ((situation (car situations))) + (mime-view-display-entity (car children) + (save-excursion + (set-buffer mime-raw-buffer) + mime-raw-message-info) + mime-raw-buffer (current-buffer) + default-situation + (if (= i p) + situation + (del-alist 'body-presentation-method + (copy-alist situation)))) + ) + (setq children (cdr children) + situation (cdr situations) + i (1+ i)) + ))) + ;;; @ acting-condition ;;; @@ -732,7 +815,8 @@ The compressed face will be piped to this command.") ) (defun mime-view-display-entity (entity message-info ibuf obuf - default-situation) + default-situation + &optional situation) (let* ((start (mime-entity-point-min entity)) (end (mime-entity-point-max entity)) (content-type (mime-entity-content-type entity)) @@ -750,22 +834,24 @@ The compressed face will be piped to this command.") (narrow-to-region start end) (setq subj (eword-decode-string (mime-raw-get-subject entity))) ) - (let* ((situation - (or - (ctree-match-calist mime-preview-condition - (append - (or content-type - (make-mime-content-type 'text 'plain)) - (list* (cons 'encoding encoding) - (cons 'major-mode major-mode) - default-situation))) - default-situation)) - (button-is-invisible - (eq (cdr (assq 'entity-button situation)) 'invisible)) - (header-is-visible - (eq (cdr (assq 'header situation)) 'visible)) - (body-presentation-method - (cdr (assq 'body-presentation-method situation)))) + (or situation + (setq situation + (or (ctree-match-calist mime-preview-condition + (append + (or content-type + (make-mime-content-type + 'text 'plain)) + (list* (cons 'encoding encoding) + (cons 'major-mode major-mode) + default-situation))) + default-situation))) + (let ((button-is-invisible + (eq (cdr (assq 'entity-button situation)) 'invisible)) + (header-is-visible + (eq (cdr (assq 'header situation)) 'visible)) + (body-presentation-method + (cdr (assq 'body-presentation-method situation))) + (children (mime-entity-children entity))) (set-buffer obuf) (setq nb (point)) (narrow-to-region nb nb) @@ -792,28 +878,32 @@ The compressed face will be piped to this command.") (insert-buffer-substring mime-raw-buffer end-of-header end) (funcall body-filter situation) ))) + (children) ((functionp body-presentation-method) (funcall body-presentation-method entity situation) + ) + (t + (when button-is-invisible + (goto-char (point-max)) + (mime-view-insert-entity-button entity message-info subj) + ) + (or header-is-visible + (progn + (goto-char (point-max)) + (insert "\n") + )) )) - (or header-is-visible - body-presentation-method - (progn - (goto-char (point-max)) - (insert "\n") - )) (setq ne (point-max)) (widen) (put-text-property nb ne 'mime-view-raw-buffer ibuf) (put-text-property nb ne 'mime-view-entity entity) (goto-char ne) - (let ((children (mime-entity-children entity)) - (default-situation - (cdr (assq 'childrens-situation situation)))) - (while children - (mime-view-display-entity (car children) message-info ibuf obuf - default-situation) - (setq children (cdr children)) - ))))) + (if children + (if (functionp body-presentation-method) + (funcall body-presentation-method entity situation) + (mime-preview-multipart/mixed entity situation) + )) + ))) (defun mime-raw-get-uu-filename () (save-excursion diff --git a/semi-def.el b/semi-def.el index 8e5c412..882d4b0 100644 --- a/semi-def.el +++ b/semi-def.el @@ -29,7 +29,7 @@ (eval-when-compile (require 'cl)) -(defconst mime-module-version '("WEMI" "Kamonomiya" 1 5 0) +(defconst mime-module-version '("WEMI" "Odawara" 1 5 1) "Implementation name, version name and numbers of MIME-kernel package.") (autoload 'mule-caesar-region "mule-caesar"