X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=semi-setup.el;h=620b8fe9842e1489bd61610883cc464763072d8f;hb=013c2ef27a0a896e207575df5ef5fe9a198d0352;hp=9928d1e75471ca3cbe98073b3be05a8492a19031;hpb=d8d8ac12939199251a948289e342cd691f83e7bd;p=elisp%2Fsemi.git diff --git a/semi-setup.el b/semi-setup.el index 9928d1e..620b8fe 100644 --- a/semi-setup.el +++ b/semi-setup.el @@ -1,8 +1,8 @@ ;;; semi-setup.el --- setup file for MIME-View. -;; Copyright (C) 1994,1995,1996,1997,1998 Free Software Foundation, Inc. +;; Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc. -;; Author: MORIOKA Tomohiko +;; Author: MORIOKA Tomohiko ;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word ;; This file is part of SEMI (Setting for Emacs MIME Interfaces). @@ -25,128 +25,139 @@ ;;; Code: (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 + +;; for image/* (defvar mime-setup-enable-inline-image - (and window-system - (or (featurep 'xemacs) - (and (featurep 'mule)(module-installed-p 'bitmap)) - )) + (if (featurep 'xemacs) + (console-on-window-system-p) + window-system) "*If it is non-nil, semi-setup sets up to use mime-image.") -(if mime-setup-enable-inline-image - (call-after-loaded 'mime-view - (function - (lambda () - (require 'mime-image) - ))) - ) - +(eval-after-load "mime-view" + '(if mime-setup-enable-inline-image + (require 'mime-image))) ;; for text/html (defvar mime-setup-enable-inline-html - (module-installed-p 'w3) + (locate-library "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) - ))) - ) +(eval-after-load "mime-view" + '(when mime-setup-enable-inline-html + (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 text/x-vcard +(defvar mime-setup-enable-vcard + (locate-library "vcard") + "*If it is non-nil, semi-setup sets uf to use mime-vcard.") + +(eval-after-load "mime-view" + '(when mime-setup-enable-vcard + (autoload 'mime-display-text/x-vcard "mime-vcard") + + (mime-add-condition + 'preview + '((type . text)(subtype . x-vcard) + (body . visible) + (body-presentation-method . mime-display-text/x-vcard)) + 'strict) + + (set-alist 'mime-view-type-subtype-score-alist + '(text . x-vcard) 3))) ;; for PGP -(defvar mime-setup-enable-pgp - (module-installed-p 'mailcrypt) +(defvar mime-setup-enable-pgp t "*If it is non-nil, semi-setup sets uf to use mime-pgp.") -(if mime-setup-enable-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))) +(eval-after-load "mime-view" + '(when mime-setup-enable-pgp + (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 . 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-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-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") - )) - ) + (mime-add-condition + 'action + '((type . application)(subtype . pgp-keys) + (method . mime-add-application/pgp-keys)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pkcs7-signature) + (method . mime-verify-application/pkcs7-signature)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . x-pkcs7-signature) + (method . mime-verify-application/pkcs7-signature)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . pkcs7-mime) + (method . mime-view-application/pkcs7-mime)) + 'strict "mime-pgp") + + (mime-add-condition + 'action + '((type . application)(subtype . x-pkcs7-mime) + (method . mime-view-application/pkcs7-mime)) + 'strict "mime-pgp"))) ;;; @ for mime-edit ;;; -(defun mime-setup-decode-message-header () - (save-excursion - (save-restriction - (goto-char (point-min)) - (narrow-to-region - (point-min) - (if (re-search-forward - (concat "^" (regexp-quote mail-header-separator) "$") - nil t) - (match-beginning 0) - (point-max) - )) - (mime-decode-header-in-buffer) - (set-buffer-modified-p nil) - ))) - -(add-hook 'mime-edit-mode-hook 'mime-setup-decode-message-header) +;; (defun mime-setup-decode-message-header () +;; (save-excursion +;; (save-restriction +;; (goto-char (point-min)) +;; (narrow-to-region +;; (point-min) +;; (if (re-search-forward +;; (concat "^" (regexp-quote mail-header-separator) "$") +;; nil t) +;; (match-beginning 0) +;; (point-max) +;; )) +;; (mime-decode-header-in-buffer) +;; (set-buffer-modified-p nil) +;; ))) + +;; (add-hook 'mime-edit-mode-hook 'mime-setup-decode-message-header) ;;; @@ variables @@ -171,8 +182,7 @@ it is used as hook to set." (let ((key (or (cdr (assq major-mode mime-setup-signature-key-alist)) mime-setup-default-signature-key))) - (define-key keymap key (function insert-signature)) - )))) + (define-key keymap key (function insert-signature)))))) (when mime-setup-use-signature (autoload 'insert-signature "signature" "Insert signature" t) @@ -184,7 +194,7 @@ it is used as hook to set." ;;; @ for mu-cite ;;; -(add-hook 'mu-cite/pre-cite-hook 'eword-decode-header) +;; (add-hook 'mu-cite/pre-cite-hook 'eword-decode-header) ;;; @ end