annotate lisp/tm/gnus-sum-mime.el @ 116:9f59509498e1 r20-1b10

Import from CVS: tag r20-1b10
author cvs
date Mon, 13 Aug 2007 09:23:06 +0200
parents fe104dbd9147
children cca96a509cfe
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 ;;; gnus-sum-mime.el --- MIME extension for summary mode of Gnus
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
3 ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
6 ;; Created: 1996/8/6
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
7 ;; Version:
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
8 ;; $Id: gnus-sum-mime.el,v 1.5 1997/03/28 02:29:05 steve Exp $
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9 ;; Keywords: news, MIME, multimedia, multilingual, encoded-word
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 ;; This file is not part of GNU Emacs yet.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 ;; This program is free software; you can redistribute it and/or
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 ;; modify it under the terms of the GNU General Public License as
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 ;; published by the Free Software Foundation; either version 2, or (at
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16 ;; your option) any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 ;; This program is distributed in the hope that it will be useful, but
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21 ;; General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26 ;; Boston, MA 02111-1307, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28 ;;; Code:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 (require 'gnus-mime)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
31 (require 'gnus-sum)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 ;;; @ summary filter
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 (defun gnus-set-summary-default-charset ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 (let ((charset
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 (if (buffer-live-p gnus-summary-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 (set-buffer gnus-summary-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 (let ((ret (assoc-if (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43 (lambda (key)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 (string-match key gnus-newsgroup-name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 gnus-newsgroup-default-charset-alist)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 (if ret
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 (make-local-variable 'default-mime-charset)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 (setq default-mime-charset (cdr ret))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 default-mime-charset)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 default-mime-charset)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57 (while (< (point)(point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58 (decode-mime-charset-region (point)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
59 (point-at-eol)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60 charset)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 (end-of-line)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
62 (let ((signal-error-on-buffer-boundary nil))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
63 (forward-char))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
65
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
66
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
67 ;;; @ command functions
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
68 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
69
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
70 (defun gnus-summary-preview-mime-message (arg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
71 "MIME decode and play this message."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
72 (interactive "P")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
73 (let ((gnus-break-pages nil))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
74 (gnus-summary-select-article t t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
75 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
76 (pop-to-buffer gnus-original-article-buffer t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
77 (let (buffer-read-only)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
78 (if (text-property-any (point-min) (point-max) 'invisible t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
79 (remove-text-properties (point-min) (point-max)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
80 gnus-hidden-properties)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
81 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
82 (mime/viewer-mode nil nil nil gnus-original-article-buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
83 gnus-article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
84 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
85
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
86 (defun gnus-summary-scroll-down ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
87 "Scroll down one line current article."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
88 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
89 (gnus-summary-scroll-up -1)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
90 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
91
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
92 (define-key gnus-summary-mode-map "v"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
93 (function gnus-summary-preview-mime-message))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
94 (define-key gnus-summary-mode-map "\e\r"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
95 (function gnus-summary-scroll-down))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
96
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
97
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
98 ;;; @ for tm-partial
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
99 ;;;
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
100
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
101 (defun gnus-mime-partial-preview-function ()
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
102 (gnus-summary-preview-mime-message (gnus-summary-article-number))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
103 )
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
104
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
105 (call-after-loaded
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
106 'tm-partial
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
107 (function
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
108 (lambda ()
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
109 (set-atype 'mime/content-decoding-condition
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
110 '((type . "message/partial")
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
111 (method . mime-article/grab-message/partials)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
112 (major-mode . gnus-original-article-mode)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
113 (summary-buffer-exp . gnus-summary-buffer)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
114 ))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
115 (set-alist 'tm-partial/preview-article-method-alist
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
116 'gnus-original-article-mode
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
117 'gnus-mime-partial-preview-function)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
118 )))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
119
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 98
diff changeset
120
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
121 ;;; @ end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
122 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
123
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
124 (provide 'gnus-sum-mime)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
125
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
126 ;;; gnus-sum-mime.el ends here