annotate lisp/tm/tm-gnus.el @ 29:7976500f47f9

Added tag r19-15b97 for changeset 1917ad0d78d7
author cvs
date Mon, 13 Aug 2007 08:51:58 +0200
parents b82b59fe008d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2 ;;; tm-gnus.el --- MIME extension for GNUS
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
3 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 ;;; Copyright (C) 1993 .. 1996 MORIOKA Tomohiko
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
6 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
8 ;;; modified by KOBAYASHI Shuhei <shuhei@cmpt01.phys.tohoku.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10 ;;; Created: 1993/11/20 (obsolete mol's gnus-mime.el)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 ;;; Version:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 ;;; $Id: tm-gnus.el,v 1.1.1.1 1996/12/18 03:55:31 steve Exp $
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 ;;; Keywords: news, MIME, multimedia, encoded-word, multilingual
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 ;;; This file is part of tm (Tools for MIME).
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 ;;; This program is free software; you can redistribute it and/or
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 ;;; modify it under the terms of the GNU General Public License as
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 ;;; published by the Free Software Foundation; either version 2, or
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 ;;; (at your option) any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22 ;;; This program is distributed in the hope that it will be useful,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25 ;;; General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 ;;; You should have received a copy of the GNU General Public License
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28 ;;; along with This program. If not, write to the Free Software
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 ;;; Code:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33 (require 'gnus)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 ;;; @ variables
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 (defvar tm-gnus/startup-hook nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 ;;; @ set up
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45 (cond ((boundp 'gnus-original-article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 ;; for Gnus 5.2 or later
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 (require 'tm-gnus5)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49 ((or (string-match
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 "^\\((ding) Gnus\\|Gnus v5\\|September Gnus\\)" gnus-version)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 (fboundp 'mail-header-from))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 ;; for Gnus 5.0 .. 5.1.*
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53 (require 'tm-gnus4)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 (cond ((not (boundp 'nnheader-encoded-words-decoding))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 (require 'tm-ew-d)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56 (defun tm-gnus/decode-summary-from-and-subjects ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57 (mapcar (lambda (header)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58 (let ((from (mail-header-from header))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 (subj (mail-header-subject header))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 (mail-header-set-from
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62 header
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
63 (if from
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 (mime-eword/decode-string from)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
65 ""))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
66 (mail-header-set-subject
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
67 header
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
68 (if subj
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
69 (mime-eword/decode-string subj)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
70 ""))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
71 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
72 gnus-newsgroup-headers))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
73 (add-hook 'gnus-select-group-hook
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
74 (function tm-gnus/decode-summary-from-and-subjects))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
75 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
76 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
77 ((fboundp 'gnus-article-prepare)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
78 ;; for GNUS 3.15 .. 4.*
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
79 (require 'tm-gd3)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
80 (require 'tm-gnus4)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
81 (add-hook 'gnus-select-group-hook 'tm-gnus/decode-summary-subjects)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
82 (fset 'gnus-article-set-mode-line
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
83 (function tm-gnus/article-set-mode-line))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
84
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
85 (or (fboundp 'tm:gnus-article-delete-headers)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
86 (fset 'tm:gnus-article-delete-headers
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
87 (symbol-function 'gnus-article-delete-headers))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
88 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
89 (defun gnus-article-delete-headers ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
90 (or tm-gnus/automatic-mime-preview
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
91 (tm:gnus-article-delete-headers)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
92 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
93
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
94 (require 'gnuspost)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
95 (or (fboundp 'tm-gnus/original-news-reply)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
96 (fset 'tm-gnus/original-news-reply
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
97 (symbol-function 'gnus-news-reply))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
98 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
99 (defun gnus-news-reply (&optional yank)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
100 (if (eq major-mode 'mime/viewer-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
101 (let ((major-mode 'gnus-article-mode))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
102 (tm-gnus/original-news-reply yank)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
103 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
104 (tm-gnus/original-news-reply yank)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
105 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
106 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
107 ((string-match "^GNUS 3" gnus-version)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
108 ;; for GNUS 3.14.*
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
109 (require 'tm-gnus3)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
110 (defvar gnus-article-buffer gnus-Article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
111 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
112
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
113
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
114 ;;; @ end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
115 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
116
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
117 (provide 'tm-gnus)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
118
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
119 (run-hooks 'tm-gnus-load-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
120
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
121 ;;; tm-gnus.el ends here