2 ;;; tm-gnus4.el --- tm-gnus module for GNUS 4, 5.0.* and 5.1.*.
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; Created: 1993/11/20 (merged tm-gnus5.el)
10 ;;; Version: $Revision: 7.4 $
11 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
13 ;;; This file is part of tm (Tools for MIME).
15 ;;; This program is free software; you can redistribute it and/or
16 ;;; modify it under the terms of the GNU General Public License as
17 ;;; published by the Free Software Foundation; either version 2, or
18 ;;; (at your option) any later version.
20 ;;; This program is distributed in the hope that it will be useful,
21 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 ;;; General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with This program. If not, write to the Free Software
27 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
36 (defconst tm-gnus/RCS-ID
37 "$Id: tm-gnus4.el,v 7.4 1995/11/21 03:02:27 morioka Exp $")
39 (defconst tm-gnus/version
40 (concat (get-version-string tm-gnus/RCS-ID) " for 4 .. 5.1"))
46 (defvar tm-gnus/automatic-mime-preview t
47 "*If non-nil, show MIME processed article.
48 This variable is set to `gnus-show-mime'.")
54 (autoload 'mime/viewer-mode "tm-view" "View MIME message." t)
56 (defun tm-gnus/view-message (arg)
57 "MIME decode and play this message."
59 (let ((gnus-break-pages nil))
60 (gnus-summary-select-article t t)
62 (pop-to-buffer gnus-article-buffer t)
66 (defun tm-gnus/summary-scroll-down ()
67 "Scroll down one line current article."
69 (gnus-summary-scroll-up -1)
72 (defun mime-viewer/quitting-method-for-gnus4 ()
73 (mime-viewer/kill-buffer)
74 (delete-other-windows)
75 (gnus-article-show-summary)
76 (if (null gnus-have-all-headers)
77 (gnus-summary-select-article nil t)
84 (set-alist 'mime-viewer/quitting-method-alist
86 (function mime-viewer/quitting-method-for-gnus4))
97 (set-atype 'mime/content-decoding-condition
98 '((type . "message/partial")
99 (method . mime-article/grab-message/partials)
100 (major-mode . gnus-article-mode)
101 (summary-buffer-exp . gnus-summary-buffer)
104 (set-alist 'tm-partial/preview-article-method-alist
108 (tm-gnus/view-message (gnus-summary-article-number))
116 (define-key gnus-summary-mode-map "v" (function tm-gnus/view-message))
117 (define-key gnus-summary-mode-map
118 "\e\r" (function tm-gnus/summary-scroll-down))
120 (defun tm-gnus/decode-encoded-word-if-you-need ()
121 (if (not gnus-have-all-headers)
123 (mime/decode-message-header)
124 (run-hooks 'tm-gnus/article-prepare-hook)
127 (defvar tm-gnus/original-article-buffer " *Original Article*")
129 (defun tm-gnus/preview-article-if-you-need ()
130 (if (not gnus-have-all-headers)
131 (let ((str (buffer-string))
132 (obuf (get-buffer tm-gnus/original-article-buffer))
133 (pbuf (current-buffer))
138 (setq buffer-read-only nil)
141 (setq obuf (get-buffer-create tm-gnus/original-article-buffer))
147 (make-local-variable 'tm:mother-button-dispatcher)
148 (setq tm:mother-button-dispatcher
149 (function gnus-article-push-button))
151 nil nil nil tm-gnus/original-article-buffer gnus-article-buffer)
152 (setq buffer-read-only nil)
153 (gnus-article-show-summary)
154 (run-hooks 'tm-gnus/article-prepare-hook)
157 (setq gnus-show-mime-method
158 (if tm-gnus/automatic-mime-preview
159 (function tm-gnus/preview-article-if-you-need)
160 (function tm-gnus/decode-encoded-word-if-you-need)
163 (setq gnus-show-mime t)
169 (defun tm-gnus/bbdb-setup ()
170 (if (memq 'bbdb/gnus-update-record gnus-article-prepare-hook)
172 (remove-hook 'gnus-article-prepare-hook 'bbdb/gnus-update-record)
173 (add-hook 'tm-gnus/article-prepare-hook 'bbdb/gnus-update-record)
176 (add-hook 'gnus-startup-hook 'tm-gnus/bbdb-setup t)