X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=semi-setup.el;h=9137f02ac3a12a0349cff46d28370cf1eea456ea;hb=cc0a722ec13e11cd7aa00db6929cb2505d1c9556;hp=33ec99c0c305aa33095eb74fe96c261df828f4a2;hpb=593ef21e075b718ee667195c078c456ce1bce52a;p=elisp%2Fsemi.git diff --git a/semi-setup.el b/semi-setup.el index 33ec99c..9137f02 100644 --- a/semi-setup.el +++ b/semi-setup.el @@ -27,11 +27,24 @@ (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.") @@ -45,11 +58,35 @@ ) +;; 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 (eval-after-load "mime-view" '(progn @@ -58,33 +95,33 @@ (message-button . visible))) (mime-add-condition 'action '((type . application)(subtype . pgp) - (method . mime-method-for-application/pgp)) + (method . mime-view-application/pgp)) 'strict "mime-pgp") (mime-add-condition 'action '((type . text)(subtype . x-pgp) - (method . mime-method-for-application/pgp))) + (method . mime-view-application/pgp))) (mime-add-condition 'action '((type . multipart)(subtype . signed) - (method . mime-method-to-verify-multipart/signed)) + (method . mime-verify-multipart/signed)) 'strict "mime-pgp") (mime-add-condition 'action '((type . application)(subtype . pgp-signature) - (method . mime-method-to-verify-application/pgp-signature)) + (method . mime-verify-application/pgp-signature)) 'strict "mime-pgp") (mime-add-condition 'action '((type . application)(subtype . pgp-encrypted) - (method . mime-method-to-decrypt-application/pgp-encrypted)) + (method . mime-decrypt-application/pgp-encrypted)) 'strict "mime-pgp") (mime-add-condition 'action '((type . application)(subtype . pgp-keys) - (method . mime-method-to-add-application/pgp-keys)) + (method . mime-add-application/pgp-keys)) 'strict "mime-pgp") )) )