annotate lisp/tm/tm-view.el @ 136:b980b6286996 r20-2b2

Import from CVS: tag r20-2b2
author cvs
date Mon, 13 Aug 2007 09:31:12 +0200
parents 360340f9fd5f
children 25f70ba0133c
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 ;;; tm-view.el --- interactive MIME viewer for GNU Emacs
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
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: 1994/7/13 (1994/8/31 obsolete tm-body.el)
136
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
7 ;; Version: $Revision: 1.4 $
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
8 ;; Keywords: mail, news, MIME, multimedia
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10 ;; This file is part of tm (Tools for MIME).
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 ;; This program is free software; you can redistribute it and/or
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 ;; modify it under the terms of the GNU General Public License as
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 ;; published by the Free Software Foundation; either version 2, or (at
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 ;; your option) any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 ;; This program is distributed in the hope that it will be useful, but
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 ;; General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25 ;; Boston, MA 02111-1307, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 ;;; Code:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 (require 'tl-str)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 (require 'tl-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 (require 'tl-atype)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32 (require 'tl-misc)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33 (require 'std11)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 (require 'mel)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35 (require 'tm-ew-d)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 (require 'tm-def)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 (require 'tm-parse)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 (require 'tm-text)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 ;;; @ version
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 (defconst mime-viewer/RCS-ID
136
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
45 "$Id: tm-view.el,v 1.4 1997/04/24 04:00:14 steve Exp $")
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 (defconst mime/viewer-version mime-viewer/version)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 ;;; @ variables
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 (defvar mime/content-decoding-condition
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 '(((type . "text/plain")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56 (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 ((type . "text/html")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60 (method "tm-html" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 (mode . "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
63 ((type . "text/x-rot13-47")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 (method . mime-article/decode-caesar)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
65 (mode . "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
66 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
67 ((type . "audio/basic")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
68 (method "tm-au" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
69 (mode . "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
70 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
71
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
72 ((type . "image/jpeg")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
73 (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
74 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
75 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
76 ((type . "image/gif")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
77 (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
78 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
79 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
80 ((type . "image/tiff")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
81 (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
82 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
83 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
84 ((type . "image/x-tiff")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
85 (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
86 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
87 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
88 ((type . "image/x-xbm")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
89 (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
90 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
91 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
92 ((type . "image/x-pic")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
93 (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
94 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
95 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
96 ((type . "image/x-mag")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
97 (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
98 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
99 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
100
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
101 ((type . "video/mpeg")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
102 (method "tm-mpeg" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
103 (mode . "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
104 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
105
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
106 ((type . "application/postscript")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
107 (method "tm-ps" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
108 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
109 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
110 ((type . "application/octet-stream")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
111 (method "tm-file" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
112 (mode "play" "print")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
113 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
114
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
115 ;;((type . "message/external-body")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
116 ;; (method "xterm" nil
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
117 ;; "-e" "showexternal"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
118 ;; 'file '"access-type" '"name" '"site" '"directory"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
119 ((type . "message/rfc822")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
120 (method . mime-article/view-message/rfc822)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
121 (mode . "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
122 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
123 ((type . "message/partial")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
124 (method . mime-article/decode-message/partial)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
125 (mode . "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
126 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
127
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
128 ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
129 (mode . "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
130 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
131 ((method "tm-file" nil 'file 'type 'encoding 'mode 'name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
132 (mode . "extract")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
133 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
134 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
135
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
136 (defvar mime-viewer/childrens-header-showing-Content-Type-list
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
137 '("message/rfc822" "message/news"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
138
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
139 (defvar mime-viewer/default-showing-Content-Type-list
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
140 '("text/plain" nil "text/richtext" "text/enriched"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
141 "text/x-latex" "application/x-latex"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
142 "message/delivery-status"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
143 "application/pgp" "text/x-pgp"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
144 "application/octet-stream"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
145 "application/x-selection" "application/x-comment"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
146
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
147 (defvar mime-viewer/content-button-ignored-ctype-list
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
148 '("application/x-selection"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
149
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
150 (defvar mime-viewer/content-button-visible-ctype-list
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
151 '("application/pgp"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
152
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
153 (defvar mime-viewer/uuencode-encoding-name-list '("x-uue" "x-uuencode"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
154
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
155 (defvar mime-viewer/ignored-field-list
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
156 '(".*Received" ".*Path" ".*Id" "References"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
157 "Replied" "Errors-To"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
158 "Lines" "Sender" ".*Host" "Xref"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
159 "Content-Type" "Precedence"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
160 "Status" "X-VM-.*")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
161 "All fields that match this list will be hidden in MIME preview buffer.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
162 Each elements are regexp of field-name. [tm-view.el]")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
163
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
164 (defvar mime-viewer/ignored-field-regexp
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
165 (concat "^"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
166 (apply (function regexp-or) mime-viewer/ignored-field-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
167 ":"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
168
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
169 (defvar mime-viewer/visible-field-list
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
170 '("Dnas.*" "Message-Id")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
171 "All fields that match this list will be displayed in MIME preview buffer.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
172 Each elements are regexp of field-name. [tm-view.el]")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
173
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
174 (defvar mime-viewer/visible-field-regexp
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
175 (concat "^"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
176 (apply (function regexp-or) mime-viewer/visible-field-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
177 ":"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
178
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
179 (defvar mime-viewer/redisplay nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
180
136
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
181 (defun mime-viewer/get-key-for-fun (symb)
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
182 (let ((key (where-is-internal symb))
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
183 )
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
184 (if key
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
185 (key-description (car key))
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
186 "v")))
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
187
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
188 (defun mime-viewer/announcement-for-message/partial ()
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
189 (let ((key (mime-viewer/get-key-for-fun 'mime-viewer/play-content)))
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
190 (if (and (>= emacs-major-version 19) window-system)
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
191 (concat
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
192 "\
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
193 \[[ This is message/partial style split message. ]]
136
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
194 \[[ Please press `"
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
195 key
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
196 "' in this buffer ]]
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
197 \[[ or click here by mouse button-2. ]]")
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
198 (concat
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
199 "\
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
200 \[[ This is message/partial style split message. ]]
136
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
201 \[[ Please press `"
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
202 key
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
203 "' in this buffer. ]]")
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
204 )))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
205
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
206 ;;; @@ predicate functions
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
207 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
208
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
209 (defun mime-viewer/header-visible-p (rcnum cinfo &optional ctype)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
210 (or (null rcnum)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
211 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
212 (setq ctype
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
213 (mime::content-info/type
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
214 (mime-article/rcnum-to-cinfo (cdr rcnum) cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
215 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
216 (member ctype mime-viewer/childrens-header-showing-Content-Type-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
217 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
218
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
219 (defun mime-viewer/body-visible-p (rcnum cinfo &optional ctype)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
220 (let (ccinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
221 (or ctype
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
222 (setq ctype
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
223 (mime::content-info/type
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
224 (setq ccinfo (mime-article/rcnum-to-cinfo rcnum cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
225 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
226 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
227 (and (member ctype mime-viewer/default-showing-Content-Type-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
228 (if (string-equal ctype "application/octet-stream")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
229 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
230 (or ccinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
231 (setq ccinfo (mime-article/rcnum-to-cinfo rcnum cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
232 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
233 (member (mime::content-info/encoding ccinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
234 '(nil "7bit" "8bit"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
235 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
236 t))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
237 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
238
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
239
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
240 ;;; @@ content button
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
241 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
242
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
243 (defun mime-preview/insert-content-button
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
244 (rcnum cinfo ctype params subj encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
245 (save-restriction
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
246 (narrow-to-region (point)(point))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
247 (let ((access-type (assoc "access-type" params))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
248 (charset (assoc "charset" params))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
249 (num (or (assoc-value "x-part-number" params)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
250 (if (consp rcnum)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
251 (mapconcat (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
252 (lambda (num)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
253 (format "%s" (1+ num))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
254 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
255 (reverse rcnum) ".")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
256 "0"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
257 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
258 (cond (access-type
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
259 (let ((server (assoc "server" params)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
260 (setq access-type (cdr access-type))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
261 (if server
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
262 (insert (format "[%s %s ([%s] %s)]\n" num subj
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
263 access-type (cdr server)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
264 (let ((site (assoc-value "site" params))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
265 (dir (assoc-value "directory" params))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
266 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
267 (insert (format "[%s %s ([%s] %s:%s)]\n" num subj
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
268 access-type site dir))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
269 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
270 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
271 (t
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
272 (insert (concat "[" num " " subj))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
273 (let ((rest
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
274 (if (setq charset (cdr charset))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
275 (if encoding
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
276 (format " <%s; %s (%s)>]\n"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
277 ctype charset encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
278 (format " <%s; %s>]\n" ctype charset)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
279 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
280 (format " <%s>]\n" ctype)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
281 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
282 (if (>= (+ (current-column)(length rest))(window-width))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
283 (setq rest (concat "\n\t" rest))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
284 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
285 (insert rest)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
286 ))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
287 (tm:add-button (point-min)(1- (point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
288 (function mime-viewer/play-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
289 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
290
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
291 (defun mime-preview/default-content-button-function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
292 (rcnum cinfo ctype params subj encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
293 (if (and (consp rcnum)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
294 (not (member
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
295 ctype
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
296 mime-viewer/content-button-ignored-ctype-list)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
297 (mime-preview/insert-content-button
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
298 rcnum cinfo ctype params subj encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
299 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
300
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
301 (defvar mime-preview/content-button-function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
302 (function mime-preview/default-content-button-function))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
303
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
304
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
305 ;;; @@ content header filter
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
306 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
307
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
308 (defun mime-preview/cut-header ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
309 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
310 (while (and
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
311 (re-search-forward mime-viewer/ignored-field-regexp nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
312 (let* ((beg (match-beginning 0))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
313 (end (match-end 0))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
314 (name (buffer-substring beg end))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
315 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
316 (if (not (string-match mime-viewer/visible-field-regexp name))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
317 (delete-region
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
318 beg
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
319 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
320 (and
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
321 (re-search-forward "^\\([^ \t]\\|$\\)" nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
322 (match-beginning 0)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
323 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
324 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
325 t)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
326 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
327
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
328 (defun mime-viewer/default-content-header-filter ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
329 (mime-preview/cut-header)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
330 (mime/decode-message-header)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
331 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
332
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
333 (defvar mime-viewer/content-header-filter-alist nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
334
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
335
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
336 ;;; @@ content filter
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
337 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
338
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
339 (defvar mime-viewer/content-filter-alist
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
340 '(("text/enriched" . mime-preview/filter-for-text/enriched)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
341 ("text/richtext" . mime-preview/filter-for-text/richtext)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
342 (t . mime-preview/filter-for-text/plain)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
343 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
344
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
345
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
346 ;;; @@ content separator
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
347 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
348
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
349 (defun mime-preview/default-content-separator (rcnum cinfo ctype params subj)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
350 (if (and (not (mime-viewer/header-visible-p rcnum cinfo ctype))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
351 (not (mime-viewer/body-visible-p rcnum cinfo ctype))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
352 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
353 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
354 (goto-char (point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
355 (insert "\n")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
356 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
357
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
358
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
359 ;;; @@ buffer local variables
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
360 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
361
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
362 ;; for XEmacs
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
363 (defvar mime::article/preview-buffer nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
364 (defvar mime::article/code-converter nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
365 (defvar mime::preview/article-buffer nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
366
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
367 (make-variable-buffer-local 'mime::article/content-info)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
368 (make-variable-buffer-local 'mime::article/preview-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
369 (make-variable-buffer-local 'mime::article/code-converter)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
370
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
371 (make-variable-buffer-local 'mime::preview/mother-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
372 (make-variable-buffer-local 'mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
373 (make-variable-buffer-local 'mime::preview/article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
374 (make-variable-buffer-local 'mime::preview/original-major-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
375 (make-variable-buffer-local 'mime::preview/original-window-configuration)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
376
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
377
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
378 ;;; @@ quitting method
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
379 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
380
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
381 (defvar mime-viewer/quitting-method-alist
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
382 '((mime/show-message-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
383 . mime-viewer/quitting-method-for-mime/show-message-mode)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
384
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
385 (defvar mime-viewer/over-to-previous-method-alist nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
386 (defvar mime-viewer/over-to-next-method-alist nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
387
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
388 (defvar mime-viewer/show-summary-method nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
389
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
390
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
391 ;;; @@ following method
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
392 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
393
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
394 (defvar mime-viewer/following-method-alist nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
395
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
396 (defvar mime-viewer/following-required-fields-list
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
397 '("From"))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
398
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
399
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
400 ;;; @@ X-Face
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
401 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
402
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
403 ;; hack from Gnus 5.0.4.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
404
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
405 (defvar mime-viewer/x-face-to-pbm-command
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
406 "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
407
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
408 (defvar mime-viewer/x-face-command
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
409 (concat mime-viewer/x-face-to-pbm-command
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
410 " | xv -quit -")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
411 "String to be executed to display an X-Face field.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
412 The command will be executed in a sub-shell asynchronously.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
413 The compressed face will be piped to this command.")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
414
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
415 (defun mime-viewer/x-face-function ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
416 "Function to display X-Face field. You can redefine to customize."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
417 ;; 1995/10/12 (c.f. tm-eng:130)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
418 ;; fixed by Eric Ding <ericding@San-Jose.ate.slb.com>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
419 (save-restriction
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
420 (narrow-to-region (point-min) (re-search-forward "^$" nil t))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
421 ;; end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
422 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
423 (if (re-search-forward "^X-Face:[ \t]*" nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
424 (let ((beg (match-end 0))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
425 (end (std11-field-end))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
426 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
427 (call-process-region beg end "sh" nil 0 nil
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
428 "-c" mime-viewer/x-face-command)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
429 ))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
430
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
431
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
432 ;;; @@ utility
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
433 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
434
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
435 (defun mime-preview/get-original-major-mode ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
436 (if mime::preview/mother-buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
437 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
438 (set-buffer mime::preview/mother-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
439 (mime-preview/get-original-major-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
440 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
441 mime::preview/original-major-mode))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
442
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
443
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
444 ;;; @ data structures
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
445 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
446
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
447 ;;; @@ preview-content-info
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
448 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
449
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
450 (define-structure mime::preview-content-info
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
451 point-min point-max buffer content-info)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
452
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
453
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
454 ;;; @ buffer setup
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
455 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
456
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
457 (defun mime-viewer/setup-buffer (&optional ctl encoding ibuf obuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
458 (if ibuf
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
459 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
460 (get-buffer ibuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
461 (set-buffer ibuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
462 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
463 (or mime-viewer/redisplay
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
464 (setq mime::article/content-info (mime/parse-message ctl encoding))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
465 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
466 (let ((ret (mime-viewer/make-preview-buffer obuf)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
467 (setq mime::article/preview-buffer (car ret))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
468 ret))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
469
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
470 (defun mime-viewer/make-preview-buffer (&optional obuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
471 (let* ((cinfo mime::article/content-info)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
472 (pcl (mime/flatten-content-info cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
473 (dest (make-list (length pcl) nil))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
474 (the-buf (current-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
475 (mode major-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
476 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
477 (or obuf
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
478 (setq obuf (concat "*Preview-" (buffer-name the-buf) "*")))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
479 (set-buffer (get-buffer-create obuf))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
480 (setq buffer-read-only nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
481 (widen)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
482 (erase-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
483 (setq mime::preview/article-buffer the-buf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
484 (setq mime::preview/original-major-mode mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
485 (setq major-mode 'mime/viewer-mode)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
486 (setq mode-name "MIME-View")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
487 (let ((drest dest))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
488 (while pcl
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
489 (setcar drest
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
490 (mime-preview/display-content (car pcl) cinfo the-buf obuf))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
491 (setq pcl (cdr pcl)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
492 drest (cdr drest))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
493 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
494 (set-buffer-modified-p nil)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
495 (setq buffer-read-only t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
496 (set-buffer the-buf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
497 (list obuf dest)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
498 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
499
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
500 (defun mime-preview/display-content (content cinfo ibuf obuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
501 (let* ((beg (mime::content-info/point-min content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
502 (end (mime::content-info/point-max content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
503 (ctype (mime::content-info/type content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
504 (params (mime::content-info/parameters content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
505 (encoding (mime::content-info/encoding content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
506 (rcnum (mime::content-info/rcnum content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
507 he e nb ne subj)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
508 (set-buffer ibuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
509 (goto-char beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
510 (setq he (if (re-search-forward "^$" nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
511 (1+ (match-end 0))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
512 end))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
513 (if (> he end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
514 (setq he end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
515 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
516 (save-restriction
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
517 (narrow-to-region beg end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
518 (setq subj
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
519 (mime-eword/decode-string
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
520 (mime-article/get-subject params encoding)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
521 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
522 (set-buffer obuf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
523 (setq nb (point))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
524 (narrow-to-region nb nb)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
525 (funcall mime-preview/content-button-function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
526 rcnum cinfo ctype params subj encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
527 (if (mime-viewer/header-visible-p rcnum cinfo ctype)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
528 (mime-preview/display-header beg he)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
529 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
530 (if (and (null rcnum)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
531 (member
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
532 ctype mime-viewer/content-button-visible-ctype-list))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
533 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
534 (goto-char (point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
535 (mime-preview/insert-content-button
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
536 rcnum cinfo ctype params subj encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
537 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
538 (cond ((mime-viewer/body-visible-p rcnum cinfo ctype)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
539 (mime-preview/display-body he end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
540 rcnum cinfo ctype params subj encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
541 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
542 ((equal ctype "message/partial")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
543 (mime-preview/display-message/partial)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
544 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
545 ((and (null rcnum)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
546 (null (mime::content-info/children cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
547 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
548 (goto-char (point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
549 (mime-preview/insert-content-button
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
550 rcnum cinfo ctype params subj encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
551 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
552 (mime-preview/default-content-separator rcnum cinfo ctype params subj)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
553 (prog1
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
554 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
555 (setq ne (point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
556 (widen)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
557 (mime::preview-content-info/create nb (1- ne) ibuf content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
558 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
559 (goto-char ne)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
560 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
561
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
562 (defun mime-preview/display-header (beg end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
563 (save-restriction
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
564 (narrow-to-region (point)(point))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
565 (insert-buffer-substring mime::preview/article-buffer beg end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
566 (let ((f (cdr (assq mime::preview/original-major-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
567 mime-viewer/content-header-filter-alist))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
568 (if (functionp f)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
569 (funcall f)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
570 (mime-viewer/default-content-header-filter)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
571 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
572 (run-hooks 'mime-viewer/content-header-filter-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
573 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
574
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
575 (defun mime-preview/display-body (beg end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
576 rcnum cinfo ctype params subj encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
577 (save-restriction
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
578 (narrow-to-region (point-max)(point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
579 (insert-buffer-substring mime::preview/article-buffer beg end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
580 (let ((f (cdr (or (assoc ctype mime-viewer/content-filter-alist)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
581 (assq t mime-viewer/content-filter-alist)))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
582 (and (functionp f)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
583 (funcall f ctype params encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
584 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
585 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
586
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
587 (defun mime-preview/display-message/partial ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
588 (save-restriction
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
589 (goto-char (point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
590 (if (not (search-backward "\n\n" nil t))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
591 (insert "\n")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
592 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
593 (let ((be (point-max)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
594 (narrow-to-region be be)
136
b980b6286996 Import from CVS: tag r20-2b2
cvs
parents: 108
diff changeset
595 (insert (mime-viewer/announcement-for-message/partial))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
596 (tm:add-button (point-min)(point-max)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
597 (function mime-viewer/play-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
598 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
599
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
600 (defun mime-article/get-uu-filename (param &optional encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
601 (if (member (or encoding
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
602 (cdr (assq 'encoding param))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
603 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
604 mime-viewer/uuencode-encoding-name-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
605 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
606 (or (if (re-search-forward "^begin [0-9]+ " nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
607 (if (looking-at ".+$")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
608 (buffer-substring (match-beginning 0)(match-end 0))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
609 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
610 ""))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
611 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
612
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
613 (defun mime-article/get-subject (param &optional encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
614 (or (std11-find-field-body '("Content-Description" "Subject"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
615 (let (ret)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
616 (if (or (and (setq ret (mime/Content-Disposition))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
617 (setq ret (assoc "filename" (cdr ret)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
618 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
619 (setq ret (assoc "name" param))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
620 (setq ret (assoc "x-name" param))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
621 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
622 (std11-strip-quoted-string (cdr ret))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
623 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
624 (mime-article/get-uu-filename param encoding)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
625 ""))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
626
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
627
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
628 ;;; @ content information
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
629 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
630
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
631 (defun mime-article/point-content-number (p &optional cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
632 (or cinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
633 (setq cinfo mime::article/content-info)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
634 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
635 (let ((b (mime::content-info/point-min cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
636 (e (mime::content-info/point-max cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
637 (c (mime::content-info/children cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
638 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
639 (if (and (<= b p)(<= p e))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
640 (or (let (co ret (sn 0))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
641 (catch 'tag
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
642 (while c
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
643 (setq co (car c))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
644 (setq ret (mime-article/point-content-number p co))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
645 (cond ((eq ret t) (throw 'tag (list sn)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
646 (ret (throw 'tag (cons sn ret)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
647 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
648 (setq c (cdr c))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
649 (setq sn (1+ sn))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
650 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
651 t))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
652
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
653 (defun mime-article/rcnum-to-cinfo (rcnum &optional cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
654 (or cinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
655 (setq cinfo mime::article/content-info)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
656 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
657 (find-if (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
658 (lambda (ci)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
659 (equal (mime::content-info/rcnum ci) rcnum)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
660 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
661 (mime/flatten-content-info cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
662 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
663
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
664 (defun mime-article/cnum-to-cinfo (cn &optional cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
665 (or cinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
666 (setq cinfo mime::article/content-info)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
667 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
668 (if (eq cn t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
669 cinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
670 (let ((sn (car cn)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
671 (if (null sn)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
672 cinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
673 (let ((rc (nth sn (mime::content-info/children cinfo))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
674 (if rc
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
675 (mime-article/cnum-to-cinfo (cdr cn) rc)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
676 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
677 ))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
678
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
679 (defun mime/flatten-content-info (&optional cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
680 (or cinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
681 (setq cinfo mime::article/content-info)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
682 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
683 (let ((dest (list cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
684 (rcl (mime::content-info/children cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
685 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
686 (while rcl
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
687 (setq dest (nconc dest (mime/flatten-content-info (car rcl))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
688 (setq rcl (cdr rcl))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
689 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
690 dest))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
691
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
692 (defun mime-preview/point-pcinfo (p &optional pcl)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
693 (or pcl
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
694 (setq pcl mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
695 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
696 (catch 'tag
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
697 (let ((r pcl) cell)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
698 (while r
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
699 (setq cell (car r))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
700 (if (and (<= (mime::preview-content-info/point-min cell) p)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
701 (<= p (mime::preview-content-info/point-max cell))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
702 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
703 (throw 'tag cell)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
704 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
705 (setq r (cdr r))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
706 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
707 (car (last pcl))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
708 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
709
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
710
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
711 ;;; @ MIME viewer mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
712 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
713
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
714 (defconst mime-viewer/menu-title "MIME-View")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
715 (defconst mime-viewer/menu-list
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
716 '((up "Move to upper content" mime-viewer/up-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
717 (previous "Move to previous content" mime-viewer/previous-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
718 (next "Move to next content" mime-viewer/next-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
719 (scroll-down "Scroll to previous content" mime-viewer/scroll-down-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
720 (scroll-up "Scroll to next content" mime-viewer/scroll-up-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
721 (play "Play Content" mime-viewer/play-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
722 (extract "Extract Content" mime-viewer/extract-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
723 (print "Print" mime-viewer/print-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
724 (x-face "Show X Face" mime-viewer/display-x-face)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
725 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
726 "Menu for MIME Viewer")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
727
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
728 (if running-xemacs
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
729 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
730 (defvar mime-viewer/xemacs-popup-menu
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
731 (cons mime-viewer/menu-title
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
732 (mapcar (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
733 (lambda (item)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
734 (vector (nth 1 item)(nth 2 item) t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
735 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
736 mime-viewer/menu-list)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
737 (defun mime-viewer/xemacs-popup-menu (event)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
738 "Popup the menu in the MIME Viewer buffer"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
739 (interactive "e")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
740 (select-window (event-window event))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
741 (set-buffer (event-buffer event))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
742 (popup-menu 'mime-viewer/xemacs-popup-menu))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
743 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
744
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
745 (defun mime-viewer/define-keymap (&optional mother)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
746 (let ((mime/viewer-mode-map (if mother
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
747 (copy-keymap mother)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
748 (make-keymap)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
749 )))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
750 (or mother
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
751 (suppress-keymap mime/viewer-mode-map))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
752 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
753 "u" (function mime-viewer/up-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
754 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
755 "p" (function mime-viewer/previous-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
756 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
757 "n" (function mime-viewer/next-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
758 (define-key mime/viewer-mode-map
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
759 "\e\t" (function mime-viewer/previous-content))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
760 (define-key mime/viewer-mode-map
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
761 "\t" (function mime-viewer/next-content))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
762 (define-key mime/viewer-mode-map
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
763 " " (function mime-viewer/scroll-up-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
764 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
765 "\M- " (function mime-viewer/scroll-down-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
766 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
767 "\177" (function mime-viewer/scroll-down-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
768 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
769 "\C-m" (function mime-viewer/next-line-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
770 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
771 "\C-\M-m" (function mime-viewer/previous-line-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
772 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
773 "v" (function mime-viewer/play-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
774 (define-key mime/viewer-mode-map
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
775 "e" (function mime-viewer/extract-content))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
776 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
777 "\C-c\C-p" (function mime-viewer/print-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
778 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
779 "x" (function mime-viewer/display-x-face))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
780 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
781 "a" (function mime-viewer/follow-content))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
782 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
783 "q" (function mime-viewer/quit))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
784 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
785 "h" (function mime-viewer/show-summary))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
786 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
787 "\C-c\C-x" (function mime-viewer/kill-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
788 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
789 "<" (function beginning-of-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
790 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
791 ">" (function end-of-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
792 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
793 "?" (function describe-mode))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
794 (if mouse-button-2
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
795 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
796 mouse-button-2 (function tm:button-dispatcher))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
797 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
798 (cond (running-xemacs
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
799 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
800 mouse-button-3 (function mime-viewer/xemacs-popup-menu))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
801 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
802 ((>= emacs-major-version 19)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
803 (define-key mime/viewer-mode-map [menu-bar mime-view]
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
804 (cons mime-viewer/menu-title
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
805 (make-sparse-keymap mime-viewer/menu-title)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
806 (mapcar (function
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
807 (lambda (item)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
808 (define-key mime/viewer-mode-map
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
809 (vector 'menu-bar 'mime-view (car item))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
810 (cons (nth 1 item)(nth 2 item))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
811 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
812 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
813 (reverse mime-viewer/menu-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
814 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
815 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
816 (use-local-map mime/viewer-mode-map)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
817 (run-hooks 'mime-viewer/define-keymap-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
818 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
819
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
820 (defun mime/viewer-mode (&optional mother ctl encoding ibuf obuf
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
821 mother-keymap)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
822 "Major mode for viewing MIME message.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
823
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
824 Here is a list of the standard keys for mime/viewer-mode.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
825
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
826 key feature
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
827 --- -------
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
828
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
829 u Move to upper content
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
830 p or M-TAB Move to previous content
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
831 n or TAB Move to next content
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
832 SPC Scroll up or move to next content
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
833 M-SPC or DEL Scroll down or move to previous content
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
834 RET Move to next line
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
835 M-RET Move to previous line
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
836 v Decode current content as `play mode'
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
837 e Decode current content as `extract mode'
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
838 C-c C-p Decode current content as `print mode'
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
839 a Followup to current content.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
840 x Display X-Face
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
841 q Quit
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
842 button-2 Move to point under the mouse cursor
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
843 and decode current content as `play mode'
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
844 "
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
845 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
846 (let ((buf (get-buffer mime/output-buffer-name)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
847 (if buf
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
848 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
849 (set-buffer buf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
850 (erase-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
851 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
852 (let ((ret (mime-viewer/setup-buffer ctl encoding ibuf obuf))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
853 (win-conf (current-window-configuration))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
854 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
855 (prog1
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
856 (switch-to-buffer (car ret))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
857 (setq mime::preview/original-window-configuration win-conf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
858 (if mother
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
859 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
860 (setq mime::preview/mother-buffer mother)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
861 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
862 (mime-viewer/define-keymap mother-keymap)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
863 (setq mime::preview/content-list (nth 1 ret))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
864 (goto-char
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
865 (let ((ce (mime::preview-content-info/point-max
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
866 (car mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
867 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
868 e)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
869 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
870 (search-forward "\n\n" nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
871 (setq e (match-end 0))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
872 (if (<= e ce)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
873 e
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
874 ce)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
875 (run-hooks 'mime/viewer-mode-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
876 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
877
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
878 (defun mime-preview/point-content-number (point)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
879 (save-window-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
880 (let ((pc (mime-preview/point-pcinfo (point)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
881 cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
882 (switch-to-buffer (mime::preview-content-info/buffer pc))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
883 (setq cinfo (mime::preview-content-info/content-info pc))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
884 (mime-article/point-content-number (mime::content-info/point-min cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
885 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
886
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
887 (defun mime-preview/cinfo-to-pcinfo (cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
888 (let ((rpcl mime::preview/content-list) cell)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
889 (catch 'tag
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
890 (while rpcl
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
891 (setq cell (car rpcl))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
892 (if (eq cinfo (mime::preview-content-info/content-info cell))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
893 (throw 'tag cell)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
894 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
895 (setq rpcl (cdr rpcl))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
896 ))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
897
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
898 (autoload 'mime-preview/decode-content "tm-play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
899
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
900 (defvar mime-viewer/decoding-mode "play" "MIME body decoding mode")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
901
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
902 (defun mime-viewer/play-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
903 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
904 (let ((mime-viewer/decoding-mode "play"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
905 (mime-preview/decode-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
906 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
907
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
908 (defun mime-viewer/extract-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
909 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
910 (let ((mime-viewer/decoding-mode "extract"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
911 (mime-preview/decode-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
912 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
913
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
914 (defun mime-viewer/print-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
915 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
916 (let ((mime-viewer/decoding-mode "print"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
917 (mime-preview/decode-content)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
918 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
919
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
920 (defun mime-viewer/follow-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
921 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
922 (let ((root-cinfo
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
923 (mime::preview-content-info/content-info
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
924 (car mime::preview/content-list)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
925 pc p-beg p-end cinfo rcnum)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
926 (let ((rest mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
927 b e cell len rc)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
928 (if (catch 'tag
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
929 (while (setq cell (car rest))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
930 (setq b (mime::preview-content-info/point-min cell)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
931 e (mime::preview-content-info/point-max cell))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
932 (setq rest (cdr rest))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
933 (if (and (<= b (point))(<= (point) e))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
934 (throw 'tag cell)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
935 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
936 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
937 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
938 (setq pc cell
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
939 cinfo (mime::preview-content-info/content-info pc)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
940 rcnum (mime::content-info/rcnum cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
941 (setq len (length rcnum))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
942 (setq p-beg (mime::preview-content-info/point-min pc)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
943 p-end (mime::preview-content-info/point-max pc))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
944 (while (and (setq cell (car rest))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
945 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
946 (setq rc
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
947 (mime::content-info/rcnum
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
948 (mime::preview-content-info/content-info
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
949 cell)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
950 (equal rcnum
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
951 (nthcdr (- (length rc) len) rc))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
952 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
953 (setq p-end (mime::preview-content-info/point-max cell))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
954 (setq rest (cdr rest))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
955 ))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
956 (if pc
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
957 (let* ((mode (mime-preview/get-original-major-mode))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
958 (new-name (format "%s-%s" (buffer-name) (reverse rcnum)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
959 new-buf
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
960 (the-buf (current-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
961 (a-buf mime::preview/article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
962 (hb (mime::content-info/point-min cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
963 (he (mime::content-info/point-max cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
964 fields from to cc reply-to subj mid f)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
965 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
966 (set-buffer (setq new-buf (get-buffer-create new-name)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
967 (erase-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
968 (insert-buffer-substring the-buf p-beg p-end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
969 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
970 (if (mime-viewer/header-visible-p rcnum root-cinfo)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
971 (delete-region (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
972 (if (re-search-forward "^$" nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
973 (match-end 0)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
974 (point-min)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
975 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
976 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
977 (insert "\n")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
978 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
979 (let ((rcnum (mime::content-info/rcnum cinfo)) ci str)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
980 (while (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
981 (setq str
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
982 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
983 (set-buffer a-buf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
984 (setq ci (mime-article/rcnum-to-cinfo rcnum))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
985 (save-restriction
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
986 (narrow-to-region
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
987 (mime::content-info/point-min ci)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
988 (mime::content-info/point-max ci)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
989 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
990 (std11-header-string-except
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
991 (concat "^"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
992 (apply (function regexp-or) fields)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
993 ":") ""))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
994 (if (string-equal (mime::content-info/type ci)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
995 "message/rfc822")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
996 nil
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
997 (if str
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
998 (insert str)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
999 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1000 rcnum))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1001 (setq fields (std11-collect-field-names)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1002 rcnum (cdr rcnum))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1003 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1004 )
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1005 (let ((rest mime-viewer/following-required-fields-list))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1006 (while rest
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1007 (let ((field-name (car rest)))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1008 (or (std11-field-body field-name)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1009 (insert
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1010 (format
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1011 (concat field-name
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1012 ": "
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1013 (save-excursion
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1014 (set-buffer the-buf)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1015 (set-buffer mime::preview/mother-buffer)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1016 (set-buffer mime::preview/article-buffer)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1017 (std11-field-body field-name)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1018 )
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1019 "\n")))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1020 ))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1021 (setq rest (cdr rest))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1022 ))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1023 (mime/decode-message-header)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1024 )
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
1025 (let ((f (cdr (assq mode mime-viewer/following-method-alist))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
1026 (if (functionp f)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
1027 (funcall f new-buf)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
1028 (message
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
1029 (format
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
1030 "Sorry, following method for %s is not implemented yet."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
1031 mode))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
1032 ))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1033 ))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1034
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1035 (defun mime-viewer/display-x-face ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1036 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1037 (save-window-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1038 (set-buffer mime::preview/article-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1039 (mime-viewer/x-face-function)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1040 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1041
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1042 (defun mime-viewer/up-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1043 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1044 (let* ((pc (mime-preview/point-pcinfo (point)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1045 (cinfo (mime::preview-content-info/content-info pc))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1046 (rcnum (mime::content-info/rcnum cinfo))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1047 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1048 (if rcnum
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1049 (let ((r (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1050 (set-buffer (mime::preview-content-info/buffer pc))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1051 (mime-article/rcnum-to-cinfo (cdr rcnum))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1052 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1053 (rpcl mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1054 cell)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1055 (while (and
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1056 (setq cell (car rpcl))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1057 (not (eq r (mime::preview-content-info/content-info cell)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1058 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1059 (setq rpcl (cdr rpcl))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1060 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1061 (goto-char (mime::preview-content-info/point-min cell))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1062 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1063 (mime-viewer/quit)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1064 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1065
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1066 (defun mime-viewer/previous-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1067 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1068 (let* ((pcl mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1069 (p (point))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1070 (i (- (length pcl) 1))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1071 beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1072 (catch 'tag
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
1073 (while (> i 0)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1074 (setq beg (mime::preview-content-info/point-min (nth i pcl)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1075 (if (> p beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1076 (throw 'tag (goto-char beg))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1077 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1078 (setq i (- i 1))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1079 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1080 (let ((f (assq mime::preview/original-major-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1081 mime-viewer/over-to-previous-method-alist)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1082 (if f
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1083 (funcall (cdr f))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1084 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1085 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1086 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1087
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1088 (defun mime-viewer/next-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1089 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1090 (let ((pcl mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1091 (p (point))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1092 beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1093 (catch 'tag
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1094 (while pcl
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1095 (setq beg (mime::preview-content-info/point-min (car pcl)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1096 (if (< p beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1097 (throw 'tag (goto-char beg))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1098 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1099 (setq pcl (cdr pcl))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1100 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1101 (let ((f (assq mime::preview/original-major-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1102 mime-viewer/over-to-next-method-alist)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1103 (if f
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1104 (funcall (cdr f))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1105 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1106 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1107 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1108
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1109 (defun mime-viewer/scroll-up-content (&optional h)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1110 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1111 (or h
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1112 (setq h (- (window-height) 1))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1113 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1114 (if (= (point) (point-max))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1115 (let ((f (assq mime::preview/original-major-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1116 mime-viewer/over-to-next-method-alist)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1117 (if f
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1118 (funcall (cdr f))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1119 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1120 (let ((pcl mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1121 (p (point))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1122 np beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1123 (setq np
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1124 (or (catch 'tag
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1125 (while pcl
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1126 (setq beg (mime::preview-content-info/point-min (car pcl)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1127 (if (< p beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1128 (throw 'tag beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1129 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1130 (setq pcl (cdr pcl))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1131 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1132 (point-max)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1133 (forward-line h)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1134 (if (> (point) np)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1135 (goto-char np)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1136 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1137 ;;(show-subtree)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1138 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1139 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1140
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1141 (defun mime-viewer/scroll-down-content (&optional h)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1142 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1143 (or h
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1144 (setq h (- (window-height) 1))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1145 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1146 (if (= (point) (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1147 (let ((f (assq mime::preview/original-major-mode
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1148 mime-viewer/over-to-previous-method-alist)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1149 (if f
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1150 (funcall (cdr f))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1151 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1152 (let ((pcl mime::preview/content-list)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1153 (p (point))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1154 pp beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1155 (setq pp
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1156 (or (let ((i (- (length pcl) 1)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1157 (catch 'tag
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1158 (while (> i 0)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1159 (setq beg (mime::preview-content-info/point-min
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1160 (nth i pcl)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1161 (if (> p beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1162 (throw 'tag beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1163 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1164 (setq i (- i 1))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1165 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1166 (point-min)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1167 (forward-line (- h))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1168 (if (< (point) pp)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1169 (goto-char pp)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1170 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1171 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1172
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1173 (defun mime-viewer/next-line-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1174 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1175 (mime-viewer/scroll-up-content 1)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1176 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1177
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1178 (defun mime-viewer/previous-line-content ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1179 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1180 (mime-viewer/scroll-down-content 1)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1181 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1182
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1183 (defun mime-viewer/quit ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1184 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1185 (let ((r (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1186 (set-buffer (mime::preview-content-info/buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1187 (mime-preview/point-pcinfo (point))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1188 (assq major-mode mime-viewer/quitting-method-alist)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1189 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1190 (if r
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1191 (funcall (cdr r))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1192 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1193
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1194 (defun mime-viewer/show-summary ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1195 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1196 (let ((r (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1197 (set-buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1198 (mime::preview-content-info/buffer
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1199 (mime-preview/point-pcinfo (point)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1200 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1201 (assq major-mode mime-viewer/show-summary-method)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1202 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1203 (if r
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1204 (funcall (cdr r))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1205 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1206
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1207 (defun mime-viewer/kill-buffer ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1208 (interactive)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1209 (kill-buffer (current-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1210 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1211
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1212
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1213 ;;; @ end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1214 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1215
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1216 (provide 'tm-view)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1217
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1218 (run-hooks 'tm-view-load-hook)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1219
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1220 ;;; tm-view.el ends here