4
|
1 ;;; gnus-sum-mime.el --- MIME extension for summary mode of Gnus
|
|
2
|
98
|
3 ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
|
4
|
4
|
|
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
|
|
6 ;; Created: 1996/8/6
|
|
7 ;; Version:
|
116
|
8 ;; $Id: gnus-sum-mime.el,v 1.5 1997/03/28 02:29:05 steve Exp $
|
4
|
9 ;; Keywords: news, MIME, multimedia, multilingual, encoded-word
|
|
10
|
|
11 ;; This file is not part of GNU Emacs yet.
|
|
12
|
|
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.
|
|
17
|
|
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.
|
|
22
|
|
23 ;; You should have received a copy of the GNU General Public License
|
98
|
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
4
|
26 ;; Boston, MA 02111-1307, USA.
|
|
27
|
|
28 ;;; Code:
|
|
29
|
|
30 (require 'gnus-mime)
|
98
|
31 (require 'gnus-sum)
|
4
|
32
|
|
33
|
|
34 ;;; @ summary filter
|
|
35 ;;;
|
|
36
|
|
37 (defun gnus-set-summary-default-charset ()
|
|
38 (let ((charset
|
|
39 (if (buffer-live-p gnus-summary-buffer)
|
|
40 (save-excursion
|
|
41 (set-buffer gnus-summary-buffer)
|
|
42 (let ((ret (assoc-if (function
|
|
43 (lambda (key)
|
|
44 (string-match key gnus-newsgroup-name)
|
|
45 ))
|
|
46 gnus-newsgroup-default-charset-alist)
|
|
47 ))
|
|
48 (if ret
|
|
49 (progn
|
|
50 (make-local-variable 'default-mime-charset)
|
|
51 (setq default-mime-charset (cdr ret))
|
|
52 ))
|
|
53 )
|
|
54 default-mime-charset)
|
|
55 default-mime-charset)))
|
|
56 (goto-char (point-min))
|
|
57 (while (< (point)(point-max))
|
|
58 (decode-mime-charset-region (point)
|
116
|
59 (point-at-eol)
|
4
|
60 charset)
|
|
61 (end-of-line)
|
116
|
62 (let ((signal-error-on-buffer-boundary nil))
|
|
63 (forward-char))
|
4
|
64 )))
|
|
65
|
|
66
|
|
67 ;;; @ command functions
|
|
68 ;;;
|
|
69
|
|
70 (defun gnus-summary-preview-mime-message (arg)
|
|
71 "MIME decode and play this message."
|
|
72 (interactive "P")
|
|
73 (let ((gnus-break-pages nil))
|
|
74 (gnus-summary-select-article t t)
|
|
75 )
|
|
76 (pop-to-buffer gnus-original-article-buffer t)
|
|
77 (let (buffer-read-only)
|
|
78 (if (text-property-any (point-min) (point-max) 'invisible t)
|
|
79 (remove-text-properties (point-min) (point-max)
|
|
80 gnus-hidden-properties)
|
|
81 ))
|
|
82 (mime/viewer-mode nil nil nil gnus-original-article-buffer
|
|
83 gnus-article-buffer)
|
|
84 )
|
|
85
|
|
86 (defun gnus-summary-scroll-down ()
|
|
87 "Scroll down one line current article."
|
|
88 (interactive)
|
|
89 (gnus-summary-scroll-up -1)
|
|
90 )
|
|
91
|
|
92 (define-key gnus-summary-mode-map "v"
|
|
93 (function gnus-summary-preview-mime-message))
|
|
94 (define-key gnus-summary-mode-map "\e\r"
|
|
95 (function gnus-summary-scroll-down))
|
|
96
|
|
97
|
110
|
98 ;;; @ for tm-partial
|
|
99 ;;;
|
|
100
|
|
101 (defun gnus-mime-partial-preview-function ()
|
|
102 (gnus-summary-preview-mime-message (gnus-summary-article-number))
|
|
103 )
|
|
104
|
|
105 (call-after-loaded
|
|
106 'tm-partial
|
|
107 (function
|
|
108 (lambda ()
|
|
109 (set-atype 'mime/content-decoding-condition
|
|
110 '((type . "message/partial")
|
|
111 (method . mime-article/grab-message/partials)
|
|
112 (major-mode . gnus-original-article-mode)
|
|
113 (summary-buffer-exp . gnus-summary-buffer)
|
|
114 ))
|
|
115 (set-alist 'tm-partial/preview-article-method-alist
|
|
116 'gnus-original-article-mode
|
|
117 'gnus-mime-partial-preview-function)
|
|
118 )))
|
|
119
|
|
120
|
4
|
121 ;;; @ end
|
|
122 ;;;
|
|
123
|
|
124 (provide 'gnus-sum-mime)
|
|
125
|
|
126 ;;; gnus-sum-mime.el ends here
|