X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=semi-setup.el;h=1eecdbbbed700eaef318c22ac99e6ff108b831fb;hb=961f8bf51eb8a0ad4875013680afbdbe724518c4;hp=66309d31031eeb36236c30e0606f79d91d7f2382;hpb=7046c969605aa85691c69a536cf88108302a960c;p=elisp%2Fsemi.git diff --git a/semi-setup.el b/semi-setup.el index 66309d3..1eecdbb 100644 --- a/semi-setup.el +++ b/semi-setup.el @@ -1,9 +1,9 @@ -;;; mime-setup.el --- setup file for MIME-View. +;;; semi-setup.el --- setup file for MIME-View. ;; Copyright (C) 1994,1995,1996,1997 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: $Id: semi-setup.el,v 0.2 1997-02-21 06:44:40 tmorioka Exp $ +;; 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). @@ -25,43 +25,8 @@ ;;; Code: -(require 'tl-misc) - - -;;; @ for mime-view -;;; - -(call-after-loaded - 'mime-view - (function - (lambda () - ;; for message/partial - (require 'mime-partial) - - ;; for anonymous ftp - (set-atype 'mime/content-decoding-condition - '((type . "message/external-body") - ("access-type" . "anon-ftp") - (method . mime-article/decode-message/external-ftp) - )) - (autoload 'mime-article/decode-message/external-ftp "tm-ftp") - - ;; for LaTeX - (set-atype 'mime/content-decoding-condition - '((type . "text/x-latex") - (method . mime/decode-text/latex) - )) - (set-atype 'mime/content-decoding-condition - '((type . "application/x-latex") - (method . mime/decode-text/latex) - )) - ;;(set-atype 'mime/content-decoding-condition - ;; '((type . "application/octet-stream") - ;; ("type" . "latex") - ;; (method . mime/decode-text/latex) - ;; )) - (autoload 'mime/decode-text/latex "tm-latex") - ))) +(require 'mime-def) +(require 'file-detect) ;; for image/* and X-Face @@ -83,40 +48,76 @@ (defvar mime-setup-enable-pgp (module-installed-p 'mailcrypt) - "*If it is non-nil, semi-setup sets uf to use tm-pgp.") + "*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 'tm-pgp) + (require 'mime-pgp) ))) ) -;;; @ for mh-e +;;; @ for mime-edit ;;; -(defun semi-setup-load-emh () - (require 'emh) - ) +(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) + )) + (eword-decode-header) + (set-buffer-modified-p nil) + ))) + +(add-hook 'mime-edit-mode-hook 'mime-setup-decode-message-header) + + +;;; @@ variables +;;; + +(defvar mime-setup-use-signature t + "If it is not nil, mime-setup sets up to use signature.el.") -(call-after-loaded 'mh-e 'semi-setup-load-emh 'mh-folder-mode-hook) -(or (featurep 'mh-e) - (add-hook 'mh-letter-mode-hook 'semi-setup-load-emh) - ) +(defvar mime-setup-default-signature-key "\C-c\C-s" + "*Key to insert signature.") +(defvar mime-setup-signature-key-alist '((mail-mode . "\C-c\C-w")) + "Alist of major-mode vs. key to insert signature.") -;;; @ for Gnus + +;;; @@ for signature ;;; - -(defun semi-setup-load-gnus () - (let (gnus-load-hook) - (require 'gnus-mime) + +(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)) )) -(add-hook 'gnus-load-hook 'semi-setup-load-gnus) +(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) + )) + + +;;; @ for mu-cite +;;; + +(add-hook 'mu-cite/pre-cite-hook 'eword-decode-header) ;;; @ end