annotate lisp/tm/tm-view.el @ 155:43dd3413c7c7 r20-3b4

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