annotate lisp/tm/tm-gnus4.el @ 4:b82b59fe008d r19-15b3

Import from CVS: tag r19-15b3
author cvs
date Mon, 13 Aug 2007 08:46:56 +0200
parents
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-gnus4.el --- tm-gnus module for GNUS 4, 5.0.* and 5.1.*.
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) 1995,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 OKABE Yasuo <okabe@kudpc.kyoto-u.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 ;;; and KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 ;;; Created: 1993/11/20 (merged tm-gnus5.el)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 ;;; Version: $Revision: 1.1.1.1 $
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
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 'tl-str)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 (require 'tl-misc)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 ;;; @ version
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 (defconst tm-gnus/RCS-ID
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 "$Id: tm-gnus4.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
42
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43 (defconst tm-gnus/version
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 (concat (get-version-string tm-gnus/RCS-ID) " for 3.15 .. 5.1.*"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 ;;; @ variable
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 (defvar tm-gnus/automatic-mime-preview t
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 "*If non-nil, show MIME processed article.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 This variable is set to `gnus-show-mime'.")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 (defvar tm-gnus/original-article-buffer " *Original Article*")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 (defvar gnus-original-article-buffer nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58 ;;; @ for tm-view
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 (autoload 'mime/viewer-mode "tm-view" "View MIME message." t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
63 (defun tm-gnus/view-message (arg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 "MIME decode and play this message."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
65 (interactive "P")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
66 (let ((gnus-break-pages nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
67 (gnus-show-mime nil))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
68 (gnus-summary-select-article t t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
69 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
70 (pop-to-buffer gnus-article-buffer t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
71 (let ((str (buffer-string))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
72 (obuf (get-buffer tm-gnus/original-article-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
73 (pbuf (current-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
74 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
75 (if obuf
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
76 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
77 (set-buffer obuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
78 (setq buffer-read-only nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
79 (erase-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
80 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
81 (setq obuf (get-buffer-create tm-gnus/original-article-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
82 (set-buffer obuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
83 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
84 (insert str)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
85 (gnus-article-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
86 (set-buffer pbuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
87 (make-local-variable 'tm:mother-button-dispatcher)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
88 (setq tm:mother-button-dispatcher
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
89 (function gnus-article-push-button))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
90 (mime/viewer-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
91 nil nil nil tm-gnus/original-article-buffer gnus-article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
92 (let (buffer-read-only)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
93 (run-hooks 'tm-gnus/article-prepare-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
94 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
95 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
96
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
97 (defun tm-gnus/summary-scroll-down ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
98 "Scroll down one line current article."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
99 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
100 (gnus-summary-scroll-up -1)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
101 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
102
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
103 (defun mime-viewer/quitting-method-for-gnus4 ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
104 (if (not gnus-show-mime)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
105 (mime-viewer/kill-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
106 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
107 (delete-other-windows)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
108 (gnus-article-show-summary)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
109 (if (or (not gnus-show-mime)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
110 (null gnus-have-all-headers))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
111 (gnus-summary-select-article nil t)
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 (call-after-loaded
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
115 'tm-view
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
116 (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
117 (lambda ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
118 (set-alist 'mime-viewer/quitting-method-alist
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
119 'gnus-article-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
120 (function mime-viewer/quitting-method-for-gnus4))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
121 (set-alist 'mime-viewer/show-summary-method
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
122 'gnus-article-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
123 (function mime-viewer/quitting-method-for-gnus4))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
124 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
125
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
126
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
127 ;;; @ for tm-edit
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
128 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
129
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
130 ;; suggested by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
131 ;; 1995/11/08 (c.f. [tm ML:1067])
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
132 (defun tm-gnus/insert-article (&optional message)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
133 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
134 (let (;; for Emacs 19
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
135 (mail-citation-hook '(mime-editor/inserted-message-filter))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
136 news-reply-header-hook
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
137 mail-yank-hooks
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
138
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
139 ;; for Emacs 18
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
140 (mail-yank-ignored-headers mime-editor/yank-ignored-field-regexp)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
141 (news-make-reply-yank-header (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
142 (lambda (message-id from) "")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
143 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
144 (news-yank-original-quoting-indicator "")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
145
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
146 ;; select raw article buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
147 (mail-reply-buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
148 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
149 (set-buffer gnus-article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
150 (if (eq major-mode 'mime/viewer-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
151 mime::preview/article-buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
152 gnus-article-buffer)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
153 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
154 (news-reply-yank-original 0)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
155 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
156
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
157 ;;; modified by Steven L. Baur <steve@miranova.com>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
158 ;;; 1995/12/6 (c.f. [tm-en:209])
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
159 (defun mime-editor/attach-to-news-reply-menu ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
160 "Arrange to attach MIME editor's popup menu to VM's"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
161 (if (boundp 'news-reply-menu)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
162 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
163 (setq news-reply-menu (append news-reply-menu
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
164 '("---")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
165 mime-editor/popup-menu-for-xemacs))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
166 (remove-hook 'news-setup-hook
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
167 'mime-editor/attach-to-news-reply-menu)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
168 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
169
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
170 (call-after-loaded
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
171 'tm-edit
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
172 (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
173 (lambda ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
174 (set-alist 'mime-editor/message-inserter-alist
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
175 'news-reply-mode (function tm-gnus/insert-article))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
176
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
177 (autoload 'tm-mail/insert-message "tm-mail")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
178 (set-alist 'mime-editor/message-inserter-alist
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
179 'mail-mode (function tm-mail/insert-message))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
180 (if (string-match "XEmacs\\|Lucid" emacs-version)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
181 (add-hook 'news-setup-hook 'mime-editor/attach-to-news-reply-menu)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
182 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
183
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
184 (set-alist 'mime-editor/split-message-sender-alist
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
185 'news-reply-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
186 (function gnus-inews-news))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
187 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
188
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
189
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
190 ;;; @ for tm-partial
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
191 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
192
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
193 (call-after-loaded
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
194 'tm-partial
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
195 (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
196 (lambda ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
197 (set-atype 'mime/content-decoding-condition
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
198 '((type . "message/partial")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
199 (method . mime-article/grab-message/partials)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
200 (major-mode . gnus-article-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
201 (summary-buffer-exp . gnus-summary-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
202 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
203
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
204 (set-alist 'tm-partial/preview-article-method-alist
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
205 'gnus-article-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
206 (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
207 (lambda ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
208 (tm-gnus/view-message (gnus-summary-article-number))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
209 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
210 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
211
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
212
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
213 ;;; @ set up
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
214 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
215
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
216 (define-key gnus-summary-mode-map "v" (function tm-gnus/view-message))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
217 (define-key gnus-summary-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
218 "\e\r" (function tm-gnus/summary-scroll-down))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
219
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
220 (defun tm-gnus/article-reset-variable ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
221 (setq gnus-original-article-buffer nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
222 (setq tm-gnus/automatic-mime-preview nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
223 (gnus-article-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
224 (setq buffer-read-only nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
225 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
226
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
227 (add-hook 'gnus-article-prepare-hook 'tm-gnus/article-reset-variable)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
228
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
229 (defun tm-gnus/decode-encoded-word-if-you-need ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
230 (if (not gnus-have-all-headers)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
231 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
232 (mime/decode-message-header)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
233 (run-hooks 'tm-gnus/article-prepare-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
234 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
235
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
236 (defun tm-gnus/preview-article-if-you-need ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
237 (if (not gnus-have-all-headers)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
238 (let ((str (buffer-string))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
239 (obuf (get-buffer tm-gnus/original-article-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
240 (pbuf (current-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
241 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
242 (if obuf
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
243 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
244 (set-buffer obuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
245 (setq buffer-read-only nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
246 (erase-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
247 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
248 (setq obuf (get-buffer-create tm-gnus/original-article-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
249 (set-buffer obuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
250 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
251 (insert str)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
252 (gnus-article-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
253 (set-buffer pbuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
254 (make-local-variable 'tm:mother-button-dispatcher)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
255 (setq tm:mother-button-dispatcher
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
256 (function gnus-article-push-button))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
257 (save-window-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
258 (mime/viewer-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
259 nil nil nil tm-gnus/original-article-buffer gnus-article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
260 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
261 (setq tm-gnus/automatic-mime-preview t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
262 (setq gnus-original-article-buffer tm-gnus/original-article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
263 (let (buffer-read-only)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
264 (run-hooks 'tm-gnus/article-prepare-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
265 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
266 (if (featurep 'tm-gd3)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
267 (setq buffer-read-only nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
268 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
269 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
270
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
271 (setq gnus-show-mime-method
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
272 (if tm-gnus/automatic-mime-preview
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
273 (function tm-gnus/preview-article-if-you-need)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
274 (function tm-gnus/decode-encoded-word-if-you-need)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
275 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
276
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
277 (setq gnus-show-mime t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
278
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
279
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
280 ;;; @ for BBDB
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
281 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
282
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
283 (call-after-loaded
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
284 'bbdb
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
285 (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
286 (lambda ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
287 (require 'tm-bbdb)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
288 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
289
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
290 (autoload 'tm-bbdb/update-record "tm-bbdb")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
291
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
292 (defun tm-gnus/bbdb-setup ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
293 (if (memq 'bbdb/gnus-update-record gnus-article-prepare-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
294 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
295 (remove-hook 'gnus-article-prepare-hook 'bbdb/gnus-update-record)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
296 ;;(add-hook 'tm-gnus/article-prepare-hook 'bbdb/gnus-update-record)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
297 (add-hook 'gnus-article-display-hook 'tm-bbdb/update-record)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
298 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
299
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
300 (add-hook 'gnus-startup-hook 'tm-gnus/bbdb-setup t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
301
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
302 (tm-gnus/bbdb-setup)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
303
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
304
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
305 ;;; @ end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
306 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
307
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
308 (provide 'tm-gnus4)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
309
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
310 ;;; tm-gnus4.el ends here