+1998-05-19 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-play.el (mime-raw-dired-function): Don't refer
+ 'mime/use-multi-frame.
+
+ * semi-def.el: Abolish variable 'mime/use-multi-frame.
+
+ * semi-def.el (mime-insert-button): Merge arguments of two
+ 'insert.
+
+ * semi-def.el: Abolish function 'get-version-string because it is
+ not used.
+
+ * TODO (Don't use filter-model): New item.
+
+ * TODO (Fix problem of dynamic configuration for
+ 'mime-acting-condition): Done.
+
+ * TODO (Mother entity should modify preview-situation of
+ children): Done.
+
+1998-05-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-view.el (mime-view-setup-buffers): Use
+ 'mime-view-display-entity; abolish 'mime-view-display-message.
+ (mime-view-display-entity): fixed.
+
+1998-05-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-view.el (mime-view-display-message): fixed.
+
+1998-05-16 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-view.el (mime-raw-get-subject): Use
+ 'mime-content-disposition-filename.
+
+ * mime-parse.el (mime-content-type-parameter): New function.
+
+ * mime-parse.el (mime-content-disposition-parameter): New
+ function.
+ (mime-content-disposition-filename): New function.
+
+1998-05-16 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-play.el (mime-raw-get-original-filename): Abolish optional
+ argument 'encoding; modify for 'mime-raw-get-uu-filename.
+
+ * mime-view.el (mime-raw-get-uu-filename): Change interface; don't
+ check encoding.
+ (mime-raw-get-subject): Change interface; new implementation.
+
+1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-view.el (mime-view-display-entity): fixed.
+
+ * mime-parse.el (mime-parse-multipart): Change interface.
+
+1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-parse.el (make-mime-entity): Add 'content-disposition.
+ (mime-entity-content-disposition): New function.
+ (mime-parse-multipart): Modify for 'make-mime-entity.
+ (mime-parse-message): Modify for 'make-mime-entity.
+
+1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-play.el (mime-raw-play-entity): Don't use
+ 'mime-entity-media-type, 'mime-entity-media-subtype and
+ 'mime-entity-parameters.
+
+1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-view.el (mime-view-display-entity): Don't use
+ 'mime-entity-media-type, 'mime-entity-media-subtype and
+ 'mime-entity-parameters.
+
+1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-view.el (mime-view-display-message): Don't use
+ 'mime-entity-media-type, 'mime-entity-media-subtype and
+ 'mime-entity-parameters.
+
1998-05-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* mime-setup.el: Avoid warning message of byte-compiler.
# Makefile for SEMI kernel.
#
-VERSION = 1.4.4
+VERSION = 1.4.5
PACKAGE = semi
SHELL = /bin/sh
* MIME-View
-** Mother entity should modify preview-situation of children
-
** Better implementation for multipart/alternative
** dynamic configuration for 'mime-preview-condition
-** Fix problem of dynamic configuration for 'mime-acting-condition
+** Don't use filter-model
+
+ tomo (major developer of SEMI) and akr (major developer of
+FLIM-FLAM) discussed about Emacs 20.3 problem related with SEMI and
+FLIM. They found essential problem with Emacs 20.3 are:
+
+ - Emacs 20.3 separates string-type to unibyte-string and
+ multibyte-string. Emacs 20.3 has enough APIs to treat them.
+
+ - Buffer has mode about interpretation of contents. Each mode is
+ designed to save semantics as characters. Namely buffer contains
+ unibyte-characters or multibyte-characters. One buffer can not
+ contain both representations.
+
+ - {decode|encode}-coding-{region|string} run in byte world. So it
+ is not harmonized with other API.
+
+ - It seems easy to write code in one mode or one world
+ (unibyte-string or multibyte-string). However it seems not easy
+ to write inter-mode program, such as SEMI.
+
+ - Byte <-> byte conversion, such as base64, quoted-printable, must
+ be run only with unibyte-mode.
+
+ - Byte <-> character conversion, such as
+ {decode|encode}-coding-region, should not be defined in single
+ buffer. Instead of them, decoder should read from unibyte buffer
+ and output to multibyte buffer. Similarly, encoder should read
+ from multibyte buffer and output to unibyte buffer.
+ `insert-buffer-substring' like API may be suitable. Anyway Emacs
+ introduces multiple representations, so it should be redesigned
+ based on multiple representation world model.
+
+ Anyway FLIM should introduce new APIs based on inter-representation
+world model. Conventional APIs should be implemented based on new
+APIs.
+
+ SEMI should abolish filter model and introduce new methods to
+display inline data. These methods should use new FLIM APIs based on
+inter-representation world model.
* MIME-Edit
"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))))
+
;;; @ 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"))
+
;;; @ Content-Transfer-Encoding
;;;
(defsubst make-mime-entity (node-id
point-min point-max
- content-type encoding children)
+ content-type content-disposition encoding
+ children)
(vector node-id point-min point-max
- content-type encoding children))
+ content-type content-disposition encoding children))
-(defsubst mime-entity-node-id (entity-info) (aref entity-info 0))
-(defsubst mime-entity-point-min (entity-info) (aref entity-info 1))
-(defsubst mime-entity-point-max (entity-info) (aref entity-info 2))
-(defsubst mime-entity-content-type (entity-info) (aref entity-info 3))
-(defsubst mime-entity-encoding (entity-info) (aref entity-info 4))
-(defsubst mime-entity-children (entity-info) (aref entity-info 5))
+(defsubst mime-entity-node-id (entity) (aref entity 0))
+(defsubst mime-entity-point-min (entity) (aref entity 1))
+(defsubst mime-entity-point-max (entity) (aref entity 2))
+(defsubst mime-entity-content-type (entity) (aref entity 3))
+(defsubst mime-entity-content-disposition (entity) (aref entity 4))
+(defsubst mime-entity-encoding (entity) (aref entity 5))
+(defsubst mime-entity-children (entity) (aref entity 6))
(defsubst mime-entity-media-type (entity)
(mime-content-type-primary-type (mime-entity-content-type entity)))
(mime-type/subtype-string (mime-entity-media-type entity-info)
(mime-entity-media-subtype entity-info)))
-(defun mime-parse-multipart (boundary content-type encoding node-id)
+(defun mime-parse-multipart (content-type content-disposition encoding node-id)
(goto-char (point-min))
- (let* ((dash-boundary (concat "--" boundary))
+ (let* ((dash-boundary
+ (concat "--"
+ (std11-strip-quoted-string
+ (cdr (assoc "boundary"
+ (mime-content-type-parameters content-type))))))
(delimiter (concat "\n" (regexp-quote dash-boundary)))
(close-delimiter (concat delimiter "--[ \t]*$"))
(beg (point-min))
(setq children (cons ret children))
)
(make-mime-entity node-id beg (point-max)
- content-type encoding (nreverse children))
+ content-type content-disposition encoding
+ (nreverse children))
))
(defun mime-parse-message (&optional default-ctl default-encoding node-id)
field. Its format must be as same as return value of
mime-{parse|read}-Content-Type."
(let* ((content-type (or (mime-read-Content-Type) default-ctl))
- (encoding (mime-read-Content-Transfer-Encoding default-encoding))
- (boundary (assoc "boundary"
- (mime-content-type-parameters content-type))))
- (cond (boundary
- (setq boundary (std11-strip-quoted-string (cdr boundary)))
- (mime-parse-multipart boundary content-type encoding node-id)
+ (content-disposition (mime-read-Content-Disposition))
+ (primary-type (mime-content-type-primary-type content-type))
+ (encoding (mime-read-Content-Transfer-Encoding default-encoding)))
+ (cond ((eq primary-type 'multipart)
+ (mime-parse-multipart content-type content-disposition encoding
+ node-id)
)
- ((and (eq (mime-content-type-primary-type content-type)
- 'message)
+ ((and (eq primary-type 'message)
(memq (mime-content-type-subtype content-type)
- '(rfc822 news))
- )
+ '(rfc822 news)
+ ))
(goto-char (point-min))
(make-mime-entity node-id (point-min) (point-max)
- content-type encoding
+ content-type content-disposition encoding
(save-restriction
(narrow-to-region
(if (re-search-forward "^$" nil t)
)
(t
(make-mime-entity node-id (point-min) (point-max)
- content-type encoding nil)
+ content-type content-disposition encoding nil)
))
))
specified, play as it. Default MODE is \"play\"."
(let ((beg (mime-entity-point-min entity-info))
(end (mime-entity-point-max entity-info))
- (c-type (mime-entity-media-type entity-info))
- (c-subtype (mime-entity-media-subtype entity-info))
- (params (mime-entity-parameters entity-info))
- (encoding (mime-entity-encoding entity-info))
- )
- (or c-type
- (setq c-type 'text
- c-subtype 'plain))
+ (content-type (mime-entity-content-type entity-info))
+ (encoding (mime-entity-encoding entity-info)))
+ (or content-type
+ (setq content-type (make-mime-content-type 'text 'plain)))
;; Check for VM
(if (< beg (point-min))
(setq beg (point-min))
(setq end (point-max))
)
(let (method cal ret)
- (setq cal (list* (cons 'type c-type)
- (cons 'subtype c-subtype)
+ (setq cal (list* (cons 'major-mode major-mode)
(cons 'encoding encoding)
- (cons 'major-mode major-mode)
- params))
+ content-type))
(if mode
(setq cal (cons (cons 'mode mode) cal))
)
(t
(mime-show-echo-buffer
"No method are specified for %s\n"
- (mime-type/subtype-string c-type c-subtype))
- ))
- )
- ))
+ (mime-type/subtype-string
+ (mime-content-type-primary-type content-type)
+ (mime-content-type-subtype content-type))
+ )))
+ )))
;;; @ external decoder
(concat (regexp-* mime-view-file-name-char-regexp)
"\\(\\." mime-view-file-name-char-regexp "+\\)*"))
-(defun mime-raw-get-original-filename (param &optional encoding)
- (or (mime-raw-get-uu-filename param encoding)
+(defun mime-raw-get-original-filename (param)
+ (or (if (member (cdr (assq 'encoding param))
+ mime-view-uuencode-encoding-name-list)
+ (mime-raw-get-uu-filename))
(let (ret)
(or (if (or (and (setq ret (mime-read-Content-Disposition))
(setq ret
;;;
(defvar mime-raw-dired-function
- (if mime/use-multi-frame
+ (if (and (>= emacs-major-version 19) window-system)
(function dired-other-frame)
(function mime-raw-dired-function-for-one-frame)
))
(setq mime-preview-original-major-mode mode)
(setq major-mode 'mime-view-mode)
(setq mode-name "MIME-View")
- (mime-view-display-message message-info the-buf obuf)
+ (mime-view-display-entity message-info message-info
+ the-buf obuf
+ '((entity-button . invisible)
+ (header . visible)
+ ))
(set-buffer-modified-p nil)
)
(setq buffer-read-only t)
(setq mime-preview-buffer obuf)
)
-(defun mime-view-display-message (message-info ibuf obuf)
- (let* ((start (mime-entity-point-min message-info))
- (end (mime-entity-point-max message-info))
- (media-type (mime-entity-media-type message-info))
- (media-subtype (mime-entity-media-subtype message-info))
- (params (mime-entity-parameters message-info))
- (encoding (mime-entity-encoding message-info))
- end-of-header e nb ne subj)
- (set-buffer ibuf)
- (goto-char start)
- (setq end-of-header (if (re-search-forward "^$" nil t)
- (1+ (match-end 0))
- end))
- (if (> end-of-header end)
- (setq end-of-header end)
- )
- (save-restriction
- (narrow-to-region start end)
- (setq subj
- (eword-decode-string
- (mime-raw-get-subject params encoding)))
- )
- (set-buffer obuf)
- (setq nb (point))
- (narrow-to-region nb nb)
- ;; Insert message-header
- (save-restriction
- (narrow-to-region (point)(point))
- (insert-buffer-substring mime-raw-buffer start end-of-header)
- (let ((f (cdr (assq mime-preview-original-major-mode
- mime-view-content-header-filter-alist))))
- (if (functionp f)
- (funcall f)
- (mime-view-default-content-header-filter)
- ))
- (run-hooks 'mime-view-content-header-filter-hook)
- )
- (let* ((situation
- (ctree-match-calist mime-preview-condition
- (list* (cons 'type media-type)
- (cons 'subtype media-subtype)
- (cons 'encoding encoding)
- (cons 'major-mode major-mode)
- params)))
- (message-button
- (cdr (assq 'message-button situation)))
- (body-presentation-method
- (cdr (assq 'body-presentation-method situation))))
- (when (eq message-button 'visible)
- (goto-char (point-max))
- (mime-view-insert-entity-button message-info message-info subj)
- )
- (cond ((eq body-presentation-method 'with-filter)
- (let ((body-filter (cdr (assq 'body-filter situation))))
- (save-restriction
- (narrow-to-region (point-max)(point-max))
- (insert-buffer-substring mime-raw-buffer end-of-header end)
- (funcall body-filter situation)
- )))
- ((functionp body-presentation-method)
- (funcall body-presentation-method situation)
- )
- ((null (mime-entity-children message-info))
- (goto-char (point-max))
- (mime-view-insert-entity-button message-info message-info subj)
- ))
- (setq ne (point-max))
- (widen)
- (put-text-property nb ne 'mime-view-raw-buffer ibuf)
- (put-text-property nb ne 'mime-view-entity message-info)
- (goto-char ne)
- (let ((children (mime-entity-children message-info))
- (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))
- )))))
-
(defun mime-view-display-entity (entity message-info ibuf obuf
default-situation)
(let* ((start (mime-entity-point-min entity))
(end (mime-entity-point-max entity))
- (media-type (mime-entity-media-type entity))
- (media-subtype (mime-entity-media-subtype entity))
- (params (mime-entity-parameters entity))
- (encoding (mime-entity-encoding entity))
+ (content-type (mime-entity-content-type entity))
+ (encoding (mime-entity-encoding entity))
end-of-header e nb ne subj)
(set-buffer ibuf)
(goto-char start)
)
(save-restriction
(narrow-to-region start end)
- (setq subj
- (eword-decode-string
- (mime-raw-get-subject params encoding)))
+ (setq subj (eword-decode-string (mime-raw-get-subject entity)))
)
(let* ((situation
- (ctree-match-calist mime-preview-condition
- (list* (cons 'type media-type)
- (cons 'subtype media-subtype)
- (cons 'encoding encoding)
- (cons 'major-mode major-mode)
- (append params
- default-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
(setq children (cdr children))
)))))
-(defun mime-raw-get-uu-filename (param &optional encoding)
- (if (member (or encoding
- (cdr (assq 'encoding param))
- )
- mime-view-uuencode-encoding-name-list)
- (save-excursion
- (or (if (re-search-forward "^begin [0-9]+ " nil t)
- (if (looking-at ".+$")
- (buffer-substring (match-beginning 0)(match-end 0))
- ))
- ""))
- ))
+(defun mime-raw-get-uu-filename ()
+ (save-excursion
+ (if (re-search-forward "^begin [0-9]+ " nil t)
+ (if (looking-at ".+$")
+ (buffer-substring (match-beginning 0)(match-end 0))
+ ))))
-(defun mime-raw-get-subject (param &optional encoding)
+(defun mime-raw-get-subject (entity)
(or (std11-find-field-body '("Content-Description" "Subject"))
- (let (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))
- )
- (std11-strip-quoted-string (cdr ret))
- ))
- (mime-raw-get-uu-filename param encoding)
+ (let ((ret (mime-entity-content-disposition entity)))
+ (and ret
+ (setq ret (mime-content-disposition-filename ret))
+ (std11-strip-quoted-string ret)
+ ))
+ (let ((ret (mime-entity-content-type entity)))
+ (and ret
+ (setq ret
+ (cdr
+ (let ((param (mime-content-type-parameters ret)))
+ (or (assoc "name" param)
+ (assoc "x-name" param))
+ )))
+ (std11-strip-quoted-string ret)
+ ))
+ (if (member (mime-entity-encoding entity)
+ mime-view-uuencode-encoding-name-list)
+ (mime-raw-get-uu-filename))
""))
-;;; semi-def.el --- definition module for SEMI
+;;; semi-def.el --- definition module for REMI
;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Keywords: definition, MIME, multimedia, mail, news
-;; This file is part of SEMI (Spadework for Emacs MIME Interfaces).
+;; This file is part of REMI (Radical Emacs MIME Interfaces).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
"Caesar rotation of current region." t)
-;;; @ variables
-;;;
-
-(defvar mime/use-multi-frame
- (and (>= emacs-major-version 19) window-system))
-
-
;;; @ constants
;;;
(add-text-properties from to (list 'mime-button-callback function))
(and data
(add-text-properties from to (list 'mime-button-data data)))
- ;;(add-text-properties from to (list 'keymap widget-keymap))
))
(defsubst mime-insert-button (string function &optional data)
"Insert STRING as button with callback FUNCTION and DATA."
(save-restriction
(narrow-to-region (point)(point))
- (insert (concat "[" string "]"))
- ;; (widget-push-button-value-create
- ;; (widget-convert 'push-button
- ;; :notify (lambda (&rest ignore)
- ;; (mime-preview-play-current-entity)
- ;; )
- ;; string))
- (insert "\n")
+ (insert (concat "[" string "]\n"))
(mime-add-button (point-min)(point-max) function data)
))
point (point)
func (get-text-property (point) 'mime-button-callback)
data (get-text-property (point) 'mime-button-data)
- )
- )
+ ))
(save-excursion
(set-buffer buf)
(goto-char point)
(defmacro pgp-function (method)
"Return function to do service METHOD."
- `(cadr (assq ,method (symbol-value 'pgp-function-alist)))
- )
+ `(cadr (assq ,method (symbol-value 'pgp-function-alist))))
(mapcar (function
(lambda (method)
))
-;;; @ RCS version
-;;;
-
-(defsubst get-version-string (id)
- "Return a version-string from RCS ID."
- (and (string-match ",v \\([0-9][0-9.][0-9.]+\\)" id)
- (substring id (match-beginning 1)(match-end 1))
- ))
-
-
;;; @ Other Utility
;;;