# Makefile for WEMI.
#
-VERSION = 1.3.1
+VERSION = 1.4.0
SHELL = /bin/sh
MAKE = make
SEMI NEWS --- history of major-changes.
Copyright (C) 1998 Free Software Foundation, Inc.
+
+* Changes in SEMI 1.4
+
+** mailcap
+
+ mailcap was supported to set up 'mime-acting-condition.
+
+ tm-external-method scripts written by born shell were abolished.
+
+
+** mime-add-condition
+
+ New function to set up 'mime-preview-condition and/or
+'mime-acting-condition.
+
+
+** signature setting in semi-setup.el
+
+ Abolish MUA depended signature setting.
+
+ Setting for mail-mode were moved to mail-mime-setup.el.
+
+\f
+* Changes in SEMI 1.3
+
+** mime-acting-condition
+
+ Format of variable 'mime-acting-condition was changed from `atype'
+to `condition tree'. Its format is as same as
+'mime-preview-condition.
+
+ If there are two or more conditions are found when matching, menu
+pops up to select method to run. Selected situation will be added to
+example database. (cf. mime-acting-situation-examples-file)
+
+** New variables
+
+*** mime-view-find-every-acting-situation
+
+ Find every available acting-situation if non-nil.
+
+*** mime-acting-situation-examples-file
+
+ File name of example about acting-situation demonstrated by
+ user.
+
\f
* Changes in SEMI 1.2
nil. (Maybe non mule setting requires to modify emu. In addition,
it is better to use terminal-coding-system feature)
- SEMI requires APEL (8.7 or later) and FLIM package. Please install
- them before installing it. APEL package is available at:
+ SEMI requires APEL (8.7 or later) and FLIM (1.1.0 or later) package.
+ Please install them before installing it. APEL package is available
+ at:
ftp://ftp.jaist.ac.jp/pub/GNU/elisp/apel/
(or (module-installed-p 'calist)
(error "Please install APEL 8.7 or later."))
(or (module-installed-p 'mel)
- (error "Please install FLIM."))
+ (error "Please install FLIM 1.1.0 or later."))
(if (module-installed-p 'tm-view)
(error "Please remove tm from load-path."))
* MIME-View
-** Unify entity display specifications to 'mime-preview-condition
-
** Mother entity should modify preview-situation of children
** Better implementation for multipart/alternative
-** Change 'mime-acting-condition to condition-tree format
-
** dynamic configuration for 'mime-preview-condition
-** mailcap support
-
-** dynamic configuration for 'mime-acting-condition
+** Fix problem of dynamic configuration for 'mime-acting-condition
* MIME-Edit
** WYSIWYG editing support
** Use MIME-Preview like tag and display
-
-** keymap-prefix
)))
+;;; @ for signature
+;;;
+
+(if mime-setup-use-signature
+ (setq mail-signature nil)
+ )
+
+
;;; @ end
;;;
(set-window-buffer p-win mime-preview-buffer)
))
-(ctree-set-calist-strictly
- 'mime-preview-condition '((type . application)(subtype . pgp)
- (message-button . visible)))
+;; (ctree-set-calist-strictly
+;; 'mime-preview-condition '((type . application)(subtype . pgp)
+;; (message-button . visible)))
-(ctree-set-calist-strictly
- 'mime-acting-condition '((type . application)(subtype . pgp)
- (method . mime-method-for-application/pgp)))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition '((type . application)(subtype . pgp)
+;; (method . mime-method-for-application/pgp)))
-(ctree-set-calist-strictly
- 'mime-acting-condition '((type . text)(subtype . x-pgp)
- (method . mime-method-for-application/pgp)))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition '((type . text)(subtype . x-pgp)
+;; (method . mime-method-for-application/pgp)))
;;; @ Internal method for multipart/signed
(cdr (assq 'mode cal)) ; play-mode
))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . multipart)(subtype . signed)
- (method . mime-method-to-verify-multipart/signed)))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . multipart)(subtype . signed)
+;; (method . mime-method-to-verify-multipart/signed)))
;;; @ Internal method for application/pgp-signature
(delete-file sig-file)
))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . application)(subtype . pgp-signature)
- (method . mime-method-to-verify-application/pgp-signature)))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . application)(subtype . pgp-signature)
+;; (method . mime-method-to-verify-application/pgp-signature)))
;;; @ Internal method for application/pgp-encrypted
(mime-method-for-application/pgp obeg oend cal)
))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . application)(subtype . pgp-encrypted)
- (method . mime-method-to-decrypt-application/pgp-encrypted)))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . application)(subtype . pgp-encrypted)
+;; (method . mime-method-to-decrypt-application/pgp-encrypted)))
;;; @ Internal method for application/pgp-keys
(kill-buffer (current-buffer))
))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . application)(subtype . pgp-keys)
- (method . mime-method-to-add-application/pgp-keys)))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . application)(subtype . pgp-keys)
+;; (method . mime-method-to-add-application/pgp-keys)))
;;; @ end
(fboundp method))
(funcall method beg end ret)
)
+ ((stringp method)
+ (mime-activate-mailcap-method beg end ret)
+ )
((and (listp method)(stringp (car method)))
(mime-activate-external-method beg end ret)
)
;;; @ external decoder
;;;
+(defun mime-activate-mailcap-method (start end situation)
+ (save-excursion
+ (save-restriction
+ (narrow-to-region start end)
+ (goto-char start)
+ (let ((method (cdr (assoc 'method situation)))
+ (name (mime-raw-get-filename situation)))
+ (mime-write-decoded-region (if (re-search-forward "^$" end t)
+ (1+ (match-end 0))
+ (point-min))
+ end name
+ (cdr (assq 'encoding situation)))
+ (message "External method is starting...")
+ (let ((command (format method name)))
+ (start-process command mime-echo-buffer-name
+ shell-file-name shell-command-switch command)
+ )
+ (mime-show-echo-buffer)
+ ))))
+
(defun mime-activate-external-method (beg end cal)
(save-excursion
(save-restriction
(require 'mime-parse)
(require 'semi-def)
(require 'calist)
+(require 'mailcap)
;;; @ version
(defvar mime-acting-condition nil
"Condition-tree about how to process entity.")
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . t)(subtype . t)(mode . "play")
- (method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)
- ))
-(ctree-set-calist-strictly
+(if (file-readable-p mailcap-file)
+ (let ((entries (mailcap-parse-file)))
+ (while entries
+ (let ((entry (car entries))
+ view print shared)
+ (while entry
+ (let* ((field (car entry))
+ (field-type (car field)))
+ (cond ((eq field-type 'view) (setq view field))
+ ((eq field-type 'print) (setq print field))
+ ((memq field-type '(compose composetyped edit)))
+ (t (setq shared (cons field shared))))
+ )
+ (setq entry (cdr entry))
+ )
+ (setq shared (nreverse shared))
+ (ctree-set-calist-strictly
+ 'mime-acting-condition
+ (append shared (list '(mode . "play")(cons 'method (cdr view)))))
+ (if print
+ (ctree-set-calist-strictly
+ 'mime-acting-condition
+ (append shared
+ (list '(mode . "print")(cons 'method (cdr view))))
+ ))
+ )
+ (setq entries (cdr entries))
+ )))
+
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . t)(subtype . t)(mode . "extract")
+;; (method . mime-method-to-save)))
+(ctree-set-calist-with-default
'mime-acting-condition
- '((type . t)(subtype . t)(mode . "extract")
+ '((mode . "extract")
(method . mime-method-to-save)))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . text)(subtype . plain)(mode . "play")
- (method "tm-plain" nil 'file "" 'encoding 'mode 'name)
- ))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . text)(subtype . plain)(mode . "print")
- (method "tm-plain" nil 'file "" 'encoding 'mode 'name)
- ))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . text)(subtype . html)(mode . "play")
- (method "tm-html" nil 'file "" 'encoding 'mode 'name)
- ))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . text)(subtype . plain)(mode . "play")
+;; (method "tm-plain" nil 'file "" 'encoding 'mode 'name)
+;; ))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . text)(subtype . plain)(mode . "print")
+;; (method "tm-plain" nil 'file "" 'encoding 'mode 'name)
+;; ))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . text)(subtype . html)(mode . "play")
+;; (method "tm-html" nil 'file "" 'encoding 'mode 'name)
+;; ))
(ctree-set-calist-strictly
'mime-acting-condition
'((type . text)(subtype . x-rot13-47)(mode . "play")
(method . mime-method-to-display-caesar)
))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . audio)(subtype . basic)(mode . "play")
- (method "tm-au" nil 'file "" 'encoding 'mode 'name)
- ))
-
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . image)(mode . "play")
- (method "tm-image" nil 'file "" 'encoding 'mode 'name)
- ))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . image)(mode . "print")
- (method "tm-image" nil 'file "" 'encoding 'mode 'name)
- ))
-
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . video)(subtype . mpeg)(mode . "play")
- (method "tm-mpeg" nil 'file "" 'encoding 'mode 'name)
- ))
-
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . application)(subtype . postscript)(mode . "play")
- (method "tm-ps" nil 'file "" 'encoding 'mode 'name)
- ))
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . application)(subtype . postscript)(mode . "print")
- (method "tm-ps" nil 'file "" 'encoding 'mode 'name)
- ))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . audio)(subtype . basic)(mode . "play")
+;; (method "tm-au" nil 'file "" 'encoding 'mode 'name)
+;; ))
+
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . image)(mode . "play")
+;; (method "tm-image" nil 'file "" 'encoding 'mode 'name)
+;; ))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . image)(mode . "print")
+;; (method "tm-image" nil 'file "" 'encoding 'mode 'name)
+;; ))
+
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . video)(subtype . mpeg)(mode . "play")
+;; (method "tm-mpeg" nil 'file "" 'encoding 'mode 'name)
+;; ))
+
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . application)(subtype . postscript)(mode . "play")
+;; (method "tm-ps" nil 'file "" 'encoding 'mode 'name)
+;; ))
+;; (ctree-set-calist-strictly
+;; 'mime-acting-condition
+;; '((type . application)(subtype . postscript)(mode . "print")
+;; (method "tm-ps" nil 'file "" 'encoding 'mode 'name)
+;; ))
(ctree-set-calist-strictly
'mime-acting-condition
(eval-when-compile (require 'cl))
-(defconst mime-module-version '("WEMI" "\e.D\eNRfuna" 1 3 1)
+(defconst mime-module-version '("WEMI" "Fujisawa" 1 4 0)
"Implementation name, version name and numbers of MIME-kernel package.")
(autoload 'mule-caesar-region "mule-caesar"
(defvar mime/use-multi-frame
(and (>= emacs-major-version 19) window-system))
-(defvar mime/find-file-function
- (if mime/use-multi-frame
- (function find-file-other-frame)
- (function find-file)
- ))
-
;;; @ constants
;;;
))
+(defvar mime-condition-type-alist
+ '((preview . mime-preview-condition)
+ (action . mime-acting-condition)))
+
+(defvar mime-condition-mode-alist
+ '((with-default . ctree-set-calist-with-default)
+ (t . ctree-set-calist-strictly)))
+
+(defun mime-add-condition (target-type condition &optional mode file)
+ "Add CONDITION to database specified by TARGET-TYPE.
+TARGET-TYPE must be 'preview or 'action.
+If optional argument MODE is 'strict or nil (omitted), CONDITION is
+added strictly.
+If optional argument MODE is 'with-default, CONDITION is added with
+default rule.
+If optional argument FILE is specified, it is loaded when CONDITION is
+activate."
+ (let ((sym (cdr (assq target-type mime-condition-type-alist))))
+ (if sym
+ (let ((func (cdr (or (assq mode mime-condition-mode-alist)
+ (assq t mime-condition-mode-alist)))))
+ (if (fboundp func)
+ (progn
+ (funcall func sym condition)
+ (if file
+ (let ((method (cdr (assq 'method condition))))
+ (autoload method file)
+ ))
+ )
+ (error "Function for mode `%s' is not found." mode)
+ ))
+ (error "Variable for target-type `%s' is not found." target-type)
+ )))
+
+
;;; @ end
;;;
;; for PGP
(if mime-setup-enable-pgp
- (call-after-loaded 'mime-view
- (function
- (lambda ()
- (require 'mime-pgp)
- )))
+ (eval-after-load "mime-view"
+ '(progn
+ (mime-add-condition
+ 'preview '((type . application)(subtype . pgp)
+ (message-button . visible)))
+ (mime-add-condition
+ 'action '((type . application)(subtype . pgp)
+ (method . mime-method-for-application/pgp))
+ 'strict "mime-pgp")
+ (mime-add-condition
+ 'action '((type . text)(subtype . x-pgp)
+ (method . mime-method-for-application/pgp)))
+
+ (mime-add-condition
+ 'action '((type . multipart)(subtype . signed)
+ (method . mime-method-to-verify-multipart/signed))
+ 'strict "mime-pgp")
+
+ (mime-add-condition
+ 'action
+ '((type . application)(subtype . pgp-signature)
+ (method . mime-method-to-verify-application/pgp-signature))
+ 'strict "mime-pgp")
+
+ (mime-add-condition
+ 'action
+ '((type . application)(subtype . pgp-encrypted)
+ (method . mime-method-to-decrypt-application/pgp-encrypted))
+ 'strict "mime-pgp")
+
+ (mime-add-condition
+ 'action
+ '((type . application)(subtype . pgp-keys)
+ (method . mime-method-to-add-application/pgp-keys))
+ 'strict "mime-pgp")
+ ))
)
(define-key keymap key (function insert-signature))
))))
-(if mime-setup-use-signature
- (progn
- (autoload 'insert-signature "signature" "Insert signature" t)
- (add-hook 'mime-edit-mode-hook 'mime-setup-set-signature-key)
- (setq gnus-signature-file nil)
- (setq mail-signature nil)
- (setq message-signature nil)
- ))
+(when mime-setup-use-signature
+ (autoload 'insert-signature "signature" "Insert signature" t)
+ (add-hook 'mime-edit-mode-hook 'mime-setup-set-signature-key)
+ ;; (setq message-signature nil)
+ )
;;; @ for mu-cite