1 ;;; gnus-mime.el --- MIME extensions for Gnus
3 ;; Copyright (C) 1996 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
7 ;; Version: $Revision: 0.6 $
8 ;; Keywords: news, MIME, multimedia, multilingual, encoded-word
10 ;; This file is not part of GNU Emacs yet.
12 ;; This program is free software; you can redistribute it and/or
13 ;; modify it under the terms of the GNU General Public License as
14 ;; published by the Free Software Foundation; either version 2, or (at
15 ;; your option) any later version.
17 ;; This program is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with this program; see the file COPYING. If not, write to
24 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
35 (defconst gnus-mime-RCS-ID
36 "$Id: gnus-mime.el,v 0.6 1996/08/22 17:55:17 morioka Exp $")
38 (defconst gnus-mime-version
39 (get-version-string gnus-mime-RCS-ID))
45 (defvar gnus-show-mime t
46 "*If non-nil, do mime processing of articles.
47 The articles will simply be fed to the function given by
48 `gnus-show-mime-method'.")
50 (defvar gnus-show-mime-method 'gnus-article-preview-mime-message
51 "*Function to process a MIME message.
52 The function is called from the article buffer.")
54 (defvar gnus-decode-encoded-word-method 'gnus-article-decode-encoded-word
55 "*Function to decode a MIME encoded-words.
56 The function is called from the article buffer.")
58 (defvar gnus-parse-headers-hook
59 '(gnus-set-summary-default-charset gnus-decode-rfc1522)
60 "*A hook called before parsing the headers.")
67 (autoload 'gnus-decode-rfc1522 "gnus-art-mime")
68 (autoload 'gnus-article-preview-mime-message "gnus-art-mime")
69 (autoload 'gnus-article-decode-encoded-word "gnus-art-mime")
70 (autoload 'gnus-set-summary-default-charset "gnus-sum-mime")
71 (require 'gnus-charset)
77 (defun gnus-content-header-filter ()
78 (goto-char (point-min))
79 (mime-preview/cut-header)
80 (decode-mime-charset-region (point-min)(point-max) default-mime-charset)
81 (mime/decode-message-header)
84 (set-alist 'mime-viewer/content-header-filter-alist
85 'gnus-original-article-mode
86 (function gnus-content-header-filter))
89 (set-alist 'mime-viewer/code-converter-alist
90 'gnus-original-article-mode
91 (function mime-charset/decode-buffer))
94 (defun mime-viewer/quitting-method-for-gnus ()
95 (if (not gnus-show-mime)
96 (mime-viewer/kill-buffer))
97 (delete-other-windows)
98 (gnus-article-show-summary)
99 (if (or (not gnus-show-mime)
100 (null gnus-have-all-headers))
101 (gnus-summary-select-article nil t)
104 (set-alist 'mime-viewer/quitting-method-alist
105 'gnus-original-article-mode
106 (function mime-viewer/quitting-method-for-gnus))
107 (set-alist 'mime-viewer/show-summary-method
108 'gnus-original-article-mode
109 (function mime-viewer/quitting-method-for-gnus))
115 (defun gnus-mime-partial-preview-function ()
116 (gnus-summary-preview-mime-message (gnus-summary-article-number))
123 (set-atype 'mime/content-decoding-condition
124 '((type . "message/partial")
125 (method . mime-article/grab-message/partials)
126 (major-mode . gnus-original-article-mode)
127 (summary-buffer-exp . gnus-summary-buffer)
129 (set-alist 'tm-partial/preview-article-method-alist
130 'gnus-original-article-mode
131 'gnus-mime-partial-preview-function)
140 (or (featurep 'gnus-load)
142 ;; for Gnus 5.0 .. 5.3
146 (or (boundp 'gnus-original-article-buffer)
148 ;; for Gnus 5.0.* and 5.1
149 (defvar gnus-original-article-buffer " *Original Article*")
151 (defun gnus-article-setup-original-article-buffer ()
153 (set-buffer (get-buffer-create gnus-original-article-buffer))
155 (insert-buffer gnus-article-buffer)
156 (setq major-mode 'gnus-original-article-mode)
159 (add-hook 'gnus-article-prepare-hook
160 'gnus-article-setup-original-article-buffer)
162 (setq gnus-strict-mime nil)
167 ;; modified by Steven L. Baur <steve@miranova.com>
168 ;; 1995/12/6 (c.f. [tm-en:209])
169 (defun mime-editor/attach-to-news-reply-menu ()
170 "Arrange to attach MIME editor's popup menu to VM's"
171 (if (boundp 'news-reply-menu)
173 (setq news-reply-menu
174 (append news-reply-menu
176 mime-editor/popup-menu-for-xemacs))
177 (remove-hook 'news-setup-hook
178 'mime-editor/attach-to-news-reply-menu)
184 (add-hook 'news-setup-hook
185 'mime-editor/attach-to-news-reply-menu)
190 (run-hooks 'gnus-mime-load-hook)
192 ;;; gnus-mime.el ends here