X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=semi-setup.el;h=9928d1e75471ca3cbe98073b3be05a8492a19031;hb=refs%2Fheads%2Fsemi-1_13;hp=1eecdbbbed700eaef318c22ac99e6ff108b831fb;hpb=2e3b817bc2bff4954f4297f1b4d3901ccd1e2537;p=elisp%2Fsemi.git diff --git a/semi-setup.el b/semi-setup.el index 1eecdbb..9928d1e 100644 --- a/semi-setup.el +++ b/semi-setup.el @@ -1,12 +1,11 @@ ;;; semi-setup.el --- setup file for MIME-View. -;; Copyright (C) 1994,1995,1996,1997 Free Software Foundation, Inc. +;; Copyright (C) 1994,1995,1996,1997,1998 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: $Id: semi-setup.el,v 0.16 1997-03-18 13:06:09 morioka Exp $ ;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word -;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). +;; This file is part of SEMI (Setting for 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 @@ -25,14 +24,27 @@ ;;; Code: -(require 'mime-def) -(require 'file-detect) +(require 'semi-def) +(require 'path-util) + +(defun call-after-loaded (module func &optional hook-name) + "If MODULE is provided, then FUNC is called. +Otherwise func is set to MODULE-load-hook. +If optional argument HOOK-NAME is specified, +it is used as hook to set." + (if (featurep module) + (funcall func) + (or hook-name + (setq hook-name (intern (concat (symbol-name module) "-load-hook"))) + ) + (add-hook hook-name func) + )) ;; for image/* and X-Face (defvar mime-setup-enable-inline-image (and window-system - (or running-xemacs + (or (featurep 'xemacs) (and (featurep 'mule)(module-installed-p 'bitmap)) )) "*If it is non-nil, semi-setup sets up to use mime-image.") @@ -46,17 +58,72 @@ ) +;; for text/html +(defvar mime-setup-enable-inline-html + (module-installed-p 'w3) + "*If it is non-nil, semi-setup sets up to use mime-w3.") + +(if mime-setup-enable-inline-html + (call-after-loaded + 'mime-view + (function + (lambda () + (autoload 'mime-preview-text/html "mime-w3") + + (ctree-set-calist-strictly + 'mime-preview-condition + '((type . text)(subtype . html) + (body . visible) + (body-presentation-method . mime-preview-text/html))) + + (set-alist 'mime-view-type-subtype-score-alist + '(text . html) 3) + ))) + ) + + +;; for PGP (defvar mime-setup-enable-pgp (module-installed-p 'mailcrypt) "*If it is non-nil, semi-setup sets uf to use mime-pgp.") -;; 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-view-application/pgp)) + 'strict "mime-pgp") + (mime-add-condition + 'action '((type . text)(subtype . x-pgp) + (method . mime-view-application/pgp))) + + (mime-add-condition + 'action '((type . multipart)(subtype . signed) + (method . mime-verify-multipart/signed)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pgp-signature) + (method . mime-verify-application/pgp-signature)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pgp-encrypted) + (method . mime-decrypt-application/pgp-encrypted)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pgp-keys) + (method . mime-add-application/pgp-keys)) + 'strict "mime-pgp") + )) ) @@ -75,7 +142,7 @@ (match-beginning 0) (point-max) )) - (eword-decode-header) + (mime-decode-header-in-buffer) (set-buffer-modified-p nil) ))) @@ -99,19 +166,19 @@ ;;; (defun mime-setup-set-signature-key () - (let ((key (or (cdr (assq major-mode mime-setup-signature-key-alist)) - mime-setup-default-signature-key))) - (define-key (current-local-map) 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) - )) + (let ((keymap (current-local-map))) + (if keymap + (let ((key + (or (cdr (assq major-mode mime-setup-signature-key-alist)) + mime-setup-default-signature-key))) + (define-key keymap key (function insert-signature)) + )))) + +(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