This commit was generated by cvs2svn to compensate for changes in r542,
[elisp/tm.git] / gnus / tm-gd5.el
1 ;;;
2 ;;; tm-gd5.el --- tm-gnus shared module for Gnus 5.*.
3 ;;;
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
6 ;;;
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; Created: 1995/11/19
10 ;;; Version:
11 ;;;     $Id: tm-gd5.el,v 4.0 1996/01/25 02:37:43 morioka Exp $
12 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
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 ;;; Code:
31
32 (cond ((not (boundp 'nnheader-encoded-words-decoding))
33        (require 'tm-ew-d)
34        
35        (defun tm-gnus/decode-summary-from-and-subjects ()
36          (mapcar (lambda (header)
37                    (let ((from (mail-header-from header))
38                          (subj (mail-header-subject header))
39                          )
40                      (mail-header-set-from
41                       header
42                       (if from
43                           (mime-eword/decode-string from)
44                         ""))
45                      (mail-header-set-subject
46                       header
47                       (if subj
48                           (mime-eword/decode-string
49                            (code-convert-string
50                             subj mime/default-coding-system *internal*))
51                         ""))
52                      ))
53                  gnus-newsgroup-headers))
54        
55        (add-hook 'gnus-select-group-hook
56                  (function tm-gnus/decode-summary-from-and-subjects))
57        ))
58
59
60 (if (boundp 'MULE)
61     (progn
62       (define-service-coding-system gnus-nntp-service nil *noconv*)
63       (if (and (boundp 'nntp-server-process)
64                (processp nntp-server-process)
65                )
66           (set-process-coding-system nntp-server-process *noconv* *noconv*)
67         )
68       
69       (or (fboundp 'tm-gnus/original-request-article)
70           (fset 'tm-gnus/original-request-article
71                 (symbol-function 'gnus-request-article))
72           )
73       
74       (defun gnus-request-article (article group &optional buffer)
75         (let ((file-coding-system-for-read *noconv*))
76           (tm-gnus/original-request-article article group buffer)
77           ))
78       ))
79
80 (fset 'tm-gnus/code-convert-region-to-emacs
81       (symbol-function 'mime/code-convert-region-to-emacs))
82
83 (defun tm-gnus/content-header-filter ()
84   (goto-char (point-min))
85   (mime-preview/cut-header)
86   (tm-gnus/code-convert-region-to-emacs (point-min)(point-max)
87                                         mime/default-coding-system)
88   (mime/decode-message-header)
89   )
90
91
92 ;;; @ end
93 ;;;
94
95 (provide 'tm-gd5)
96
97 ;;; tm-gd5.el ends here