tm 7.27.1.
[elisp/tm.git] / gnus / tm-gnus.el
1 ;;;
2 ;;; tm-gnus.el --- MIME extension for GNUS
3 ;;;
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1993,1994,1995 MORIOKA Tomohiko
6 ;;;
7 ;;; Author: Morioka Tomohiko <morioka@jaist.ac.jp>
8 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; Created: 1993/11/20 (obsolete mol's gnus-mime.el)
10 ;;; Version:
11 ;;;     $Id: tm-gnus.el,v 7.9 1995/11/21 03:00:41 morioka Exp $
12 ;;; Keywords: news, MIME, multimedia, encoded-word, multilingual
13 ;;;
14 ;;; This file is part of tm (Tools for MIME).
15 ;;;
16 ;;; This program is free software; you can redistribute it and/or
17 ;;; modify it under the terms of the GNU General Public License as
18 ;;; published by the Free Software Foundation; either version 2, or
19 ;;; (at your option) any later version.
20 ;;;
21 ;;; This program is distributed in the hope that it will be useful,
22 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24 ;;; General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with This program.  If not, write to the Free Software
28 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
29
30 (require 'gnus)
31
32
33 ;;; @ variables
34 ;;;
35
36 (defvar tm-gnus/startup-hook nil)
37
38
39 ;;; @ set up
40 ;;;
41
42 (cond ((boundp 'gnus-original-article-buffer)
43        ;; for September Gnus and Gnus 5.2 ..
44        (require 'tm-sgnus)
45        )
46       ((or (string-match
47             "^\\((ding) Gnus\\|Gnus v5\\|September Gnus\\)" gnus-version)
48            (fboundp 'mail-header-from))
49        ;; for Gnus 5.0 .. 5.1.*
50        (require 'tm-gd5)
51        (require 'tm-gnus4)
52        )
53       ((fboundp 'gnus-article-prepare)
54        ;; for GNUS 3.15 .. 4.*
55        (require 'tm-gd3)
56        (require 'tm-gnus4)
57        (add-hook 'gnus-select-group-hook 'tm-gnus/decode-summary-subjects)
58        (fset 'gnus-article-set-mode-line
59              (function tm-gnus/article-set-mode-line))
60        )
61       ((string-match "^GNUS 3" gnus-version)
62        ;; for GNUS 3.14.*
63        (require 'tm-gnus3)
64        (defvar gnus-article-buffer gnus-Article-buffer)
65        ))
66
67
68 ;;; @ for tm-edit
69 ;;;
70 ;; suggested by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
71 ;;      1995/11/08 (c.f. [tm ML:1067])
72 (defun tm-gnus/insert-article (&optional message)
73   (interactive)
74   (let (;; for Emacs 19
75         (mail-citation-hook '(mime-editor/inserted-message-filter))
76         news-reply-header-hook
77         mail-yank-hooks
78         
79         ;; for Emacs 18
80         (mail-yank-ignored-headers mime-editor/yank-ignored-field-regexp)
81         (news-make-reply-yank-header (function
82                                       (lambda (message-id from) "")
83                                       ))
84         (news-yank-original-quoting-indicator "")
85         
86         ;; select raw article buffer
87         (mail-reply-buffer
88          (save-excursion
89            (set-buffer gnus-article-buffer)
90            (if (eq major-mode 'mime/viewer-mode)
91                mime::preview/article-buffer
92              gnus-article-buffer)))
93         )
94     (news-reply-yank-original 0)
95     ))
96
97 (call-after-loaded
98  'tm-edit
99  (function
100   (lambda ()
101     (set-alist
102      'mime-editor/message-inserter-alist
103      'news-reply-mode (function tm-gnus/insert-article))
104     )))
105
106
107 ;;; @ end
108 ;;;
109
110 (provide 'tm-gnus)
111
112 (run-hooks 'tm-gnus-load-hook)