From: yamaoka Date: Mon, 8 Jun 1998 04:02:03 +0000 (+0000) Subject: Sync up with SEMI 1.5.2. X-Git-Tag: wemi-1_5_2~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=ab25c567c00baf62e9f76ccc163b390aad3dfe82;p=elisp%2Fsemi.git Sync up with SEMI 1.5.2. --- diff --git a/ChangeLog b/ChangeLog index f6b41b6..ac43366 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,58 @@ +1998-06-08 MORIOKA Tomohiko + + * mime-play.el (mime-delq-null-situation): New function. + (mime-raw-play-entity): Use `mime-delq-null-situation'. + +1998-06-08 MORIOKA Tomohiko + + * TODO (Better implementation for multipart/alternative): done. + + * NEWS (type-subtype-score): New section. + +1998-06-07 MORIOKA Tomohiko + + * mime-view.el (mime-raw-message-info): Modify DOC-string. + + * MIME-View-API-ja.ol: Modify for SEMI 1.5. + +1998-06-07 MORIOKA Tomohiko + + * mime-edit.el (mime-edit-touched-flag): Define by `defvar'. + (mime-edit-mode): Don't check `mime-edit-touched-flag' is bound or + not. + + * mime-edit.el (mime-edit-find-inmost): Abolish unused local + variables. + +1998-06-07 MORIOKA Tomohiko + + * mime-text.el (mime-text-insert-decoded-body): Don't refer + `mime-raw-buffer'. + + * mime-parse.el: Change format of `mime-entity' to add `buffer'. + +1998-06-07 MORIOKA Tomohiko + + * mime-play.el: When it is compiled, require 'bbdb or define + `bbdb-buffer-name' to avoid compiler warning. + + (mime-method-to-display-caesar): Abolish unused local variable. + + Use `eval-buffer' to eval contents of + `mime-acting-situation-examples-file'. + +1998-06-07 MORIOKA Tomohiko + + * mime-text.el: Move definition of variable + `mime-raw-representation-type' to mime-view.el. + + * mime-view.el: Move definition of variable + `mime-raw-representation-type' from mime-text.el. + (mime-raw-message-info): Modify DOC-string. + + * MIME-View-API-ja.ol: New file. + + 1998-06-05 MORIOKA Tomohiko * WEMI: Version 1.5.1 (Odawara) released. diff --git a/Makefile b/Makefile index b30b0ee..844009f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Makefile for WEMI. # -VERSION = 1.5.1 +VERSION = 1.5.2 PACKAGE = wemi SHELL = /bin/sh diff --git a/NEWS b/NEWS index 8e7ba4a..7ae1700 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,19 @@ Copyright (C) 1998 Free Software Foundation, Inc. * Changes in SEMI 1.5 +** type-subtype-score + + Now MIME-View chooses one entity to display body in +multipart/alternative. In this mechanism, +`mime-view-type-subtype-score-alist' is used to specify priority of +each entity. + + Variable `mime-view-type-subtype-score-alist' is alist of +TYPE-SUBTYPE vs. SCORE. TYPE-SUBTYPE is cons pair (TYPE . SUBTYPE), +symbol TYPE or t. TYPE and SUBTYPE are symbol. `t' means default. +SCORE is integer. Larger number is larger priority. + + ** text presentation Change text presentation mechanism. In anything older than SEMI diff --git a/TODO b/TODO index c3cd0b1..cb2a11c 100644 --- a/TODO +++ b/TODO @@ -3,8 +3,6 @@ * MIME-View -** Better implementation for multipart/alternative - ** dynamic configuration for 'mime-preview-condition ** Don't use filter-model diff --git a/VERSION b/VERSION index 2105df5..a1aaa40 100644 --- a/VERSION +++ b/VERSION @@ -52,7 +52,7 @@ 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 +1.5.2 Kurobe $(B9uIt(B ----- Uozu $(B5{DE(B ; <=> $(BIY;3COJ}E4F;(B : : : ----- Namerikawa $(B3j@n(B ; <=> $(BIY;3COJ}E4F;(B @@ -102,7 +102,7 @@ 1.4.6 K-Dòzu-A $(B9qI\DE(B ; = JR $(B8fEB>l@~(B 1.5.0 Kamonomiya $B3{5\(B 1.5.1 Odawara $(B>.ED86(B ; <=> $(B>.ED5^!"H":,EP;3E4F;!"0KF&H":,E4F;(B ------ Hayakawa $BAa@n(B +1.5.2 Hayakawa $BAa@n(B ----- Nebukawa $B:,I\@n(B ----- Manazuru $B??Da(B ----- Yugawara $BEr2O86(B diff --git a/mime-edit.el b/mime-edit.el index 4209551..9ad6408 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -767,6 +767,8 @@ Tspecials means any character that matches with it in header must be quoted.") ;;; @ functions ;;; +(defvar mime-edit-touched-flag nil) + ;;;###autoload (defun mime-edit-mode () "MIME minor mode for editing the tagged MIME message. @@ -902,8 +904,7 @@ User customizable variables (not documented all of them): (interactive) (if mime-edit-mode-flag (mime-edit-exit) - (if (and (boundp 'mime-edit-touched-flag) - mime-edit-touched-flag) + (if mime-edit-touched-flag (mime-edit-again) (make-local-variable 'mime-edit-touched-flag) (setq mime-edit-touched-flag t) @@ -1574,21 +1575,17 @@ Parameter must be '(PROMPT CHOICE1 (CHOISE2 ...))." (let ((bb (match-beginning 0)) (be (match-end 0)) (type (buffer-substring (match-beginning 1)(match-end 1))) - end-exp eb ee) + end-exp eb) (setq end-exp (format "--}-<<%s>>\n" type)) (widen) (if (re-search-forward end-exp nil t) - (progn - (setq eb (match-beginning 0)) - (setq ee (match-end 0)) - ) + (setq eb (match-beginning 0)) (setq eb (point-max)) - (setq ee (point-max)) ) (narrow-to-region be eb) (goto-char be) (if (re-search-forward mime-edit-multipart-beginning-regexp nil t) - (let (ret) + (progn (narrow-to-region (match-beginning 0)(point-max)) (mime-edit-find-inmost) ) diff --git a/mime-parse.el b/mime-parse.el index 7f9e4da..67c03b7 100644 --- a/mime-parse.el +++ b/mime-parse.el @@ -180,23 +180,25 @@ If is is not found, return DEFAULT-ENCODING." ;;; @ message parser ;;; -(defsubst make-mime-entity (node-id header-start header-end - body-start body-end - content-type content-disposition - encoding children) - (vector node-id - header-start header-end body-start body-end +(defsubst make-mime-entity (buffer + node-id + header-start header-end body-start body-end + content-type content-disposition + encoding children) + (vector buffer + node-id header-start header-end body-start body-end content-type content-disposition encoding children)) -(defsubst mime-entity-node-id (entity) (aref entity 0)) -(defsubst mime-entity-header-start (entity) (aref entity 1)) -(defsubst mime-entity-header-end (entity) (aref entity 2)) -(defsubst mime-entity-body-start (entity) (aref entity 3)) -(defsubst mime-entity-body-end (entity) (aref entity 4)) -(defsubst mime-entity-content-type (entity) (aref entity 5)) -(defsubst mime-entity-content-disposition (entity) (aref entity 6)) -(defsubst mime-entity-encoding (entity) (aref entity 7)) -(defsubst mime-entity-children (entity) (aref entity 8)) +(defsubst mime-entity-buffer (entity) (aref entity 0)) +(defsubst mime-entity-node-id (entity) (aref entity 1)) +(defsubst mime-entity-header-start (entity) (aref entity 2)) +(defsubst mime-entity-header-end (entity) (aref entity 3)) +(defsubst mime-entity-body-start (entity) (aref entity 4)) +(defsubst mime-entity-body-end (entity) (aref entity 5)) +(defsubst mime-entity-content-type (entity) (aref entity 6)) +(defsubst mime-entity-content-disposition (entity) (aref entity 7)) +(defsubst mime-entity-encoding (entity) (aref entity 8)) +(defsubst mime-entity-children (entity) (aref entity 9)) (defalias 'mime-entity-point-min 'mime-entity-header-start) (defalias 'mime-entity-point-max 'mime-entity-body-end) @@ -255,9 +257,8 @@ If is is not found, return DEFAULT-ENCODING." ) (setq children (cons ret children)) ) - (make-mime-entity node-id - header-start header-end - body-start body-end + (make-mime-entity (current-buffer) node-id + header-start header-end body-start body-end content-type content-disposition encoding (nreverse children)) )) @@ -309,9 +310,8 @@ mime-{parse|read}-Content-Type." (memq (mime-content-type-subtype content-type) '(rfc822 news) )) - (make-mime-entity node-id - header-start header-end - body-start body-end + (make-mime-entity (current-buffer) node-id + header-start header-end body-start body-end content-type content-disposition encoding (save-restriction (narrow-to-region body-start body-end) @@ -320,9 +320,8 @@ mime-{parse|read}-Content-Type." )) ) (t - (make-mime-entity node-id - header-start header-end - body-start body-end + (make-mime-entity (current-buffer) node-id + header-start header-end body-start body-end content-type content-disposition encoding nil) )) )) diff --git a/mime-play.el b/mime-play.el index cbcf623..af845c1 100644 --- a/mime-play.el +++ b/mime-play.el @@ -30,8 +30,12 @@ (require 'alist) (require 'filename) -(eval-when-compile (require 'mime-text)) - +(eval-when-compile + (require 'mime-text) + (condition-case nil + (require 'bbdb) + (error (defvar bbdb-buffer-name nil)) + )) (defvar mime-acting-situation-examples nil) @@ -116,6 +120,16 @@ If MODE is specified, play as it. Default MODE is \"play\"." ))) ) +(defsubst mime-delq-null-situation (situations field) + (let (dest) + (while situations + (let ((situation (car situations))) + (if (assq field situation) + (setq dest (cons situation dest)) + )) + (setq situations (cdr situations))) + dest)) + (defun mime-raw-play-entity (entity-info &optional mode) "Play entity specified by ENTITY-INFO. It decodes the entity to call internal or external method. The method @@ -140,10 +154,14 @@ specified, play as it. Default MODE is \"play\"." cal) cal)) (setq ret - (or (ctree-find-calist mime-acting-condition ret - mime-view-find-every-acting-situation) - (ctree-find-calist mime-acting-condition cal - mime-view-find-every-acting-situation) + (or (mime-delq-null-situation + (ctree-find-calist mime-acting-condition ret + mime-view-find-every-acting-situation) + 'method) + (mime-delq-null-situation + (ctree-find-calist mime-acting-condition cal + mime-view-find-every-acting-situation) + 'method) )) (cond ((cdr ret) (setq ret (select-menu-alist @@ -609,17 +627,12 @@ saved as binary. Otherwise the region is saved by `write-region'." (defun mime-method-to-display-caesar (start end cal) "Internal method for mime-view to display ROT13-47-48 message." (let* ((entity (mime-raw-find-entity-from-point start)) - (cnum (reverse (mime-entity-node-id entity))) - (new-name (format "%s-%s" (buffer-name) cnum)) - (the-buf (current-buffer)) - (mother mime-preview-buffer) - (charset (cdr (assoc "charset" cal))) - (encoding (cdr (assq 'encoding cal))) - (mode major-mode)) + (new-name (format "%s-%s" (buffer-name) + (reverse (mime-entity-node-id entity)))) + (mother mime-preview-buffer)) (let ((pwin (or (get-buffer-window mother) (get-largest-window))) - (buf (get-buffer-create new-name)) - ) + (buf (get-buffer-create new-name))) (set-window-buffer pwin buf) (set-buffer buf) (select-window pwin) @@ -647,7 +660,7 @@ saved as binary. Otherwise the region is saved by `write-region'." (set-buffer buffer) (erase-buffer) (insert-file-contents file) - (eval-current-buffer) + (eval-buffer) ;; format check (or (eq (car mime-acting-situation-examples) 'type) (setq mime-acting-situation-examples nil)) diff --git a/mime-text.el b/mime-text.el index a7aed39..c7022f7 100644 --- a/mime-text.el +++ b/mime-text.el @@ -28,20 +28,6 @@ (autoload 'widget-convert-text "wid-edit") -;;; @ buffer local variables in raw-buffer -;;; - -(defvar mime-raw-representation-type nil - "Representation-type of mime-raw-buffer. -It must be nil, `binary' or `cooked'. -If it is nil, `mime-raw-representation-type-alist' is used as default -value. -Notice that this variable is usually used as buffer local variable in -raw-buffer.") - -(make-variable-buffer-local 'mime-raw-representation-type) - - ;;; @ code conversion ;;; @@ -51,15 +37,16 @@ It decodes MIME-encoding then code-converts as MIME-charset. MIME-encoding is value of field 'encoding of SITUATION. It must be 'nil or string. MIME-charset is value of field \"charset\" of SITUATION. It must be symbol." - (let ((presentation-type + (let* ((buffer (mime-entity-buffer entity)) + (presentation-type (save-excursion - (set-buffer mime-raw-buffer) + (set-buffer buffer) (or mime-raw-representation-type (cdr (or (assq major-mode mime-raw-representation-type-alist) (assq t mime-raw-representation-type-alist))) )))) (save-restriction - (insert-buffer-substring mime-raw-buffer + (insert-buffer-substring buffer (mime-entity-body-start entity) (mime-entity-body-end entity)) (let ((encoding (mime-entity-encoding entity))) diff --git a/mime-view.el b/mime-view.el index c23ca8b..8dd621c 100644 --- a/mime-view.el +++ b/mime-view.el @@ -76,25 +76,38 @@ Please use reference function `mime-entity-SLOT' to get value of SLOT. Following is a list of slots of the structure: -node-id reversed entity-number (list of integers) -point-min beginning point of region in raw-buffer -point-max end point of region in raw-buffer -type media-type (symbol) -subtype media-subtype (symbol) -type/subtype media-type/subtype (string or nil) -parameters parameter of Content-Type field (association list) -encoding Content-Transfer-Encoding (string or nil) -children entities included in this entity (list of content-infos) +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-raw-message-info) + (defvar mime-preview-buffer nil "MIME-preview buffer corresponding with the (raw) buffer.") (make-variable-buffer-local 'mime-preview-buffer) + +(defvar mime-raw-representation-type nil + "Representation-type of mime-raw-buffer. +It must be nil, `binary' or `cooked'. +If it is nil, `mime-raw-representation-type-alist' is used as default +value. +Notice that this variable is usually used as buffer local variable in +raw-buffer.") + +(make-variable-buffer-local 'mime-raw-representation-type) + (defvar mime-raw-representation-type-alist '((mime-show-message-mode . binary) (mime-temp-message-mode . binary) diff --git a/semi-def.el b/semi-def.el index 882d4b0..41032db 100644 --- a/semi-def.el +++ b/semi-def.el @@ -29,7 +29,7 @@ (eval-when-compile (require 'cl)) -(defconst mime-module-version '("WEMI" "Odawara" 1 5 1) +(defconst mime-module-version '("WEMI" "Hayakawa" 1 5 2) "Implementation name, version name and numbers of MIME-kernel package.") (autoload 'mule-caesar-region "mule-caesar"