From: morioka Date: Tue, 5 May 1998 20:00:35 +0000 (+0000) Subject: Sync up with semi-1_4_0_9. X-Git-Tag: wemi-1_4_0~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=db55a59e0a52e3daa43fe1083177a15b6c3ff013;p=elisp%2Fsemi.git Sync up with semi-1_4_0_9. --- diff --git a/Makefile b/Makefile index b0208a6..7f94f4a 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Makefile for WEMI. # -VERSION = 1.3.1 +VERSION = 1.4.0 SHELL = /bin/sh MAKE = make diff --git a/NEWS b/NEWS index d082a90..460a94f 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,51 @@ 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. + + +* 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. + * Changes in SEMI 1.2 diff --git a/README.en b/README.en index b328503..c04bc91 100644 --- a/README.en +++ b/README.en @@ -49,8 +49,9 @@ Required environment 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/ diff --git a/SEMI-CFG b/SEMI-CFG index 8011f53..ba11bc6 100644 --- a/SEMI-CFG +++ b/SEMI-CFG @@ -30,7 +30,7 @@ (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.")) diff --git a/TODO b/TODO index 133b8c7..d048726 100644 --- a/TODO +++ b/TODO @@ -1,18 +1,12 @@ * 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 @@ -20,5 +14,3 @@ ** WYSIWYG editing support ** Use MIME-Preview like tag and display - -** keymap-prefix diff --git a/mail-mime-setup.el b/mail-mime-setup.el index c95b304..710d15b 100644 --- a/mail-mime-setup.el +++ b/mail-mime-setup.el @@ -49,6 +49,14 @@ ))) +;;; @ for signature +;;; + +(if mime-setup-use-signature + (setq mail-signature nil) + ) + + ;;; @ end ;;; diff --git a/mime-pgp.el b/mime-pgp.el index 498cbf7..c2c3f24 100644 --- a/mime-pgp.el +++ b/mime-pgp.el @@ -104,17 +104,17 @@ (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 @@ -131,10 +131,10 @@ (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 @@ -235,10 +235,10 @@ It should be ISO 639 2 letter language code such as en, ja, ...") (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 @@ -260,10 +260,10 @@ It should be ISO 639 2 letter language code such as en, ja, ...") (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 @@ -289,10 +289,10 @@ It should be ISO 639 2 letter language code such as en, ja, ...") (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 diff --git a/mime-play.el b/mime-play.el index 17bc7b1..c64c4d1 100644 --- a/mime-play.el +++ b/mime-play.el @@ -176,6 +176,9 @@ specified, play as it. Default MODE is \"play\"." (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) ) @@ -191,6 +194,26 @@ specified, play as it. Default MODE is \"play\"." ;;; @ 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 diff --git a/mime-view.el b/mime-view.el index c8ac741..d414b4f 100644 --- a/mime-view.el +++ b/mime-view.el @@ -33,6 +33,7 @@ (require 'mime-parse) (require 'semi-def) (require 'calist) +(require 'mailcap) ;;; @ version @@ -508,31 +509,59 @@ Please press `v' key in this buffer." (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") @@ -544,39 +573,39 @@ Please press `v' key in this buffer." (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 diff --git a/semi-def.el b/semi-def.el index bb14d37..030e136 100644 --- a/semi-def.el +++ b/semi-def.el @@ -29,7 +29,7 @@ (eval-when-compile (require 'cl)) -(defconst mime-module-version '("WEMI" ".DNRfuna" 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" @@ -42,12 +42,6 @@ (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 ;;; @@ -295,6 +289,41 @@ it is used as hook to set." )) +(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 ;;; diff --git a/semi-setup.el b/semi-setup.el index b3811c2..33ec99c 100644 --- a/semi-setup.el +++ b/semi-setup.el @@ -51,11 +51,42 @@ ;; 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") + )) ) @@ -106,14 +137,11 @@ (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