1 ;;; gnus-art-mime.el --- MIME extension for article mode of Gnus
3 ;; Copyright (C) 1995,1996 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;; $Id: gnus-art-mime.el,v 0.5 1996/08/17 02:45:14 morioka Exp $
9 ;; Keywords: news, MIME, multimedia, multilingual, encoded-word
11 ;; This file is not part of GNU Emacs yet.
13 ;; This program is free software; you can redistribute it and/or
14 ;; modify it under the terms of the GNU General Public License as
15 ;; published by the Free Software Foundation; either version 2, or (at
16 ;; your option) any later version.
18 ;; This program is distributed in the hope that it will be useful, but
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 ;; General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with this program; see the file COPYING. If not, write to
25 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
33 (autoload 'mime-eword/decode-region "tm-ew-d"
34 "Decode MIME encoded-words in region." t)
35 (autoload 'mime/decode-message-header "tm-ew-d"
36 "Decode MIME encoded-words in message header." t)
37 (autoload 'mime/viewer-mode "tm-view"
38 "Major mode for viewing MIME message." t)
41 (defun gnus-decode-rfc1522 ()
42 (goto-char (point-min))
43 (if (re-search-forward "^[0-9]+\t" nil t)
45 (goto-char (point-min))
47 (while (re-search-forward "^[0-9]+\t\\([^\t]+\\)\t" nil t)
48 (mime-eword/decode-region (match-beginning 1) (match-end 1)
49 'unfolding 'must-unfold)
50 (if (re-search-forward "[^\t]+" nil t)
51 (mime-eword/decode-region (match-beginning 0)(match-end 0)
52 'unfolding 'must-unfold)
55 (mime-eword/decode-region (point-min)(point-max) t)
62 (defun gnus-article-preview-mime-message ()
63 (make-local-variable 'tm:mother-button-dispatcher)
64 (setq tm:mother-button-dispatcher
65 (function gnus-article-push-button))
66 (let ((mime-viewer/ignored-field-regexp "^:$")
69 (set-buffer gnus-summary-buffer)
70 default-mime-charset))
72 (save-window-excursion
73 (mime/viewer-mode nil nil nil gnus-original-article-buffer
75 gnus-article-mode-map)
77 (run-hooks 'tm-gnus/article-prepare-hook)
80 (defun gnus-article-decode-encoded-word ()
81 (decode-mime-charset-region (point-min)(point-max)
83 (set-buffer gnus-summary-buffer)
84 default-mime-charset))
85 (mime/decode-message-header)
86 (run-hooks 'tm-gnus/article-prepare-hook)
100 (autoload 'tm-bbdb/update-record "tm-bbdb")
102 (defun tm-gnus/bbdb-setup ()
103 (if (memq 'bbdb/gnus-update-record gnus-article-prepare-hook)
105 (remove-hook 'gnus-article-prepare-hook 'bbdb/gnus-update-record)
106 (add-hook 'gnus-article-display-hook 'tm-bbdb/update-record)
109 (add-hook 'gnus-startup-hook 'tm-gnus/bbdb-setup t)
117 (provide 'gnus-art-mime)
119 ;;; gnus-art-mime.el ends here