X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tm-setup.el;h=151047feb1bed66d59bae699dae2320dc43ea84d;hb=ce5017c15f724ff6eb7d906504d3a495dbe21f9a;hp=b39121b6eb13fa159bf56a1e20255ee06dea3a1e;hpb=917398c6359f48471a2fefa3217c5c9a2be76806;p=elisp%2Ftm.git diff --git a/tm-setup.el b/tm-setup.el index b39121b..151047f 100644 --- a/tm-setup.el +++ b/tm-setup.el @@ -1,95 +1,138 @@ ;;; -;;; $Id: tm-setup.el,v 5.0 1994/12/22 05:45:32 morioka Exp $ +;;; tm-setup.el --- setup file for tm viewer. ;;; - -(provide 'tm-setup) - -;;; @ for Emacs 18 +;;; Copyright (C) 1995 Free Software Foundation, Inc. +;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko ;;; -(if (< (string-to-int emacs-version) 19) - (progn - (require 'tl-18) - (defvar buffer-undo-list nil) - )) +;;; Author: MORIOKA Tomohiko +;;; Version: +;;; $Id: tm-setup.el,v 7.4 1996/08/06 12:12:53 morioka Exp $ +;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word +;;; +;;; This file is part of tm (Tools for MIME). +;;; +;;; This program is free software; you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 2, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with This program. If not, write to the Free Software +;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;;; +;;; Code: +(require 'tl-misc) -;;; @ for LaTeX -;;; -(add-hook 'tm-view-load-hook - (function - (lambda () - (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") - ))) - - -;;; @ for Anonymous FTP (need of ange-ftp) + +;;; @ for tm-view ;;; -(add-hook 'tm-view-load-hook - (function - (lambda () - (set-atype 'mime/content-decoding-condition - '((type . "message/external-body") - ("access-type" . "anon-ftp") - (method . mime/decode-message/external-ftp) - )) - (autoload 'mime/decode-message/external-ftp "tm-ftp") - ))) + +(call-after-loaded + 'tm-view + (function + (lambda () + ;; for message/partial + (require 'tm-partial) + + ;; for anonymous ftp + (set-atype 'mime/content-decoding-condition + '((type . "message/external-body") + ("access-type" . "anon-ftp") + (method . mime/decode-message/external-ftp) + )) + (autoload 'mime/decode-message/external-ftp "tm-ftp") + + ;; for image/* + (if running-xemacs + (require 'tm-image) + ) + + ;; 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") + ))) ;;; @ for RMAIL ;;; -(require 'tm-rmail) + +(call-after-loaded 'rmail + (function + (lambda () + (require 'tm-rmail) + )) + 'rmail-mode-hook) ;;; @ for mh-e ;;; -(add-hook 'mh-folder-mode-hook - (function - (lambda () - (require 'tm-mh-e) - ))) -(add-hook 'mh-letter-mode-hook - (function + +(let ((le (function (lambda () (require 'tm-mh-e) - ))) + )) + )) + (call-after-loaded 'mh-e le 'mh-folder-mode-hook) + (if (not (featurep 'mh-e)) + (add-hook 'mh-letter-mode-hook le) + )) ;;; @ for GNUS ;;; -(let ((le (function - (lambda () - (require 'tm-gnus) - ))) - ) - (if (boundp 'MULE) - (progn - (add-hook 'gnus-Group-mode-hook (function gnusutil-initialize)) - (add-hook 'gnus-group-mode-hook (function gnusutil-initialize)) - (autoload 'gnusutil-initialize "gnusutil") - (autoload 'gnusutil-add-group "gnusutil") - (add-hook 'gnusutil-initialize-hook le) - ) + +(defvar tm-setup/use-gnusutil nil) + +(defun tm-setup/load-GNUS () + (require 'tm-gnus) + ) + +(if (and (boundp 'MULE) tm-setup/use-gnusutil) (progn - (add-hook 'gnus-Startup-hook le) - (add-hook 'gnus-startup-hook le) - ))) - -;;; Local Variables: -;;; mode: emacs-lisp -;;; mode: outline-minor -;;; outline-regexp: ";;; @+\\|(......" -;;; End: + (add-hook 'gnus-Group-mode-hook (function gnusutil-initialize)) + (add-hook 'gnus-group-mode-hook (function gnusutil-initialize)) + (autoload 'gnusutil-initialize "gnusutil") + (autoload 'gnusutil-add-group "gnusutil") + (add-hook 'gnusutil-initialize-hook 'tm-setup/load-GNUS) + ) + (add-hook 'gnus-Startup-hook 'tm-setup/load-GNUS 'append) + (add-hook 'gnus-startup-hook 'tm-setup/load-GNUS 'append) + ) + + +;;; @ for Gnus +;;; + +(defun tm-setup/load-gnus () + (let (gnus-load-hook) + (remove-hook 'gnus-startup-hook 'tm-setup/load-GNUS) + (require 'gnus-mime) + )) + +(add-hook 'gnus-load-hook 'tm-setup/load-gnus) + + +;;; @ end +;;; + +(provide 'tm-setup) + +;;; tm-setup.el ends here