annotate lisp/tm/gnus-sum-mime.el @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents c0c698873ce1
children fe104dbd9147
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:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 76
diff changeset
8 ;; $Id: gnus-sum-mime.el,v 1.3 1997/02/15 22:21:26 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)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60 (end-of-line)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 (point))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62 charset)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
63 (end-of-line)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 (forward-char)
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
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
68 ;;; @ command functions
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
69 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
70
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
71 (defun gnus-summary-preview-mime-message (arg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
72 "MIME decode and play this message."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
73 (interactive "P")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
74 (let ((gnus-break-pages nil))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
75 (gnus-summary-select-article t t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
76 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
77 (pop-to-buffer gnus-original-article-buffer t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
78 (let (buffer-read-only)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
79 (if (text-property-any (point-min) (point-max) 'invisible t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
80 (remove-text-properties (point-min) (point-max)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
81 gnus-hidden-properties)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
82 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
83 (mime/viewer-mode nil nil nil gnus-original-article-buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
84 gnus-article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
85 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
86
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
87 (defun gnus-summary-scroll-down ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
88 "Scroll down one line current article."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
89 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
90 (gnus-summary-scroll-up -1)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
91 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
92
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
93 (define-key gnus-summary-mode-map "v"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
94 (function gnus-summary-preview-mime-message))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
95 (define-key gnus-summary-mode-map "\e\r"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
96 (function gnus-summary-scroll-down))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
97
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
98
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
99 ;;; @ end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
100 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
101
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
102 (provide 'gnus-sum-mime)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
103
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
104 ;;; gnus-sum-mime.el ends here