1 ;;; mime-view.el --- interactive MIME viewer for GNU Emacs
3 ;; Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
7 ;; Renamed: 1994/08/31 from tm-body.el
8 ;; Renamed: 1997/02/19 from tm-view.el
9 ;; Keywords: MIME, multimedia, mail, news
11 ;; This file is part of SEMI (Sample of Elastic MIME Interfaces).
13 ;; This program is free software; you can redistribute it and/or
14 ;; modify it under the terms of the GNU General Public License as
15 ;; published by the Free Software Foundation; either version 2, or (at
16 ;; your option) any later version.
18 ;; This program is distributed in the hope that it will be useful, but
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 ;; General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
40 (defconst mime-view-version
41 (concat (mime-product-name mime-user-interface-product) " MIME-View "
42 (mapconcat #'number-to-string
43 (mime-product-version mime-user-interface-product) ".")
44 " (" (mime-product-code-name mime-user-interface-product) ")"))
50 (defgroup mime-view nil
54 (defcustom mime-situation-examples-file "~/.mime-example"
55 "*File name of situation-examples demonstrated by user."
59 (defcustom mime-preview-move-scroll nil
60 "*Decides whether to scroll when moving to next entity.
61 When t, scroll the buffer. Non-nil but not t means scroll when
62 the next entity is within next-screen-context-lines from top or
63 buttom. Nil means don't scroll at all."
65 :type '(choice (const :tag "Off" nil)
67 (sexp :tag "Situation" 1)))
70 ;;; @ in raw-buffer (representation space)
73 (defvar mime-preview-buffer nil
74 "MIME-preview buffer corresponding with the (raw) buffer.")
75 (make-variable-buffer-local 'mime-preview-buffer)
78 (defvar mime-raw-representation-type-alist
79 '((mime-show-message-mode . binary)
80 (mime-temp-message-mode . binary)
82 "Alist of major-mode vs. representation-type of mime-raw-buffer.
83 Each element looks like (SYMBOL . REPRESENTATION-TYPE). SYMBOL is
84 major-mode or t. t means default. REPRESENTATION-TYPE must be
85 `binary' or `cooked'.")
88 ;;; @ in preview-buffer (presentation space)
91 (defvar mime-mother-buffer nil
92 "Mother buffer corresponding with the (MIME-preview) buffer.
93 If current MIME-preview buffer is generated by other buffer, such as
94 message/partial, it is called `mother-buffer'.")
95 (make-variable-buffer-local 'mime-mother-buffer)
97 ;; (defvar mime-raw-buffer nil
98 ;; "Raw buffer corresponding with the (MIME-preview) buffer.")
99 ;; (make-variable-buffer-local 'mime-raw-buffer)
101 (defvar mime-preview-original-window-configuration nil
102 "Window-configuration before mime-view-mode is called.")
103 (make-variable-buffer-local 'mime-preview-original-window-configuration)
105 (defun mime-preview-original-major-mode (&optional recursive point)
106 "Return major-mode of original buffer.
107 If optional argument RECURSIVE is non-nil and current buffer has
108 mime-mother-buffer, it returns original major-mode of the
110 (if (and recursive mime-mother-buffer)
112 (set-buffer mime-mother-buffer)
113 (mime-preview-original-major-mode recursive))
114 (cdr (assq 'major-mode
115 (get-text-property (or point
116 (if (> (point) (buffer-size))
117 (max (1- (point-max)) (point-min))
119 'mime-view-situation)))))
122 ;;; @ entity information
125 (defun mime-entity-situation (entity &optional situation)
126 "Return situation of ENTITY."
127 (let (rest param name)
129 (unless (assq 'type situation)
130 (setq rest (or (mime-entity-content-type entity)
131 (make-mime-content-type 'text 'plain))
132 situation (cons (car rest) situation)
134 (unless (assq 'subtype situation)
136 (setq rest (or (cdr (mime-entity-content-type entity))
137 '((subtype . plain)))))
138 (setq situation (cons (car rest) situation)
141 (setq param (car rest))
142 (or (assoc (car param) situation)
143 (setq situation (cons param situation)))
144 (setq rest (cdr rest)))
146 ;; Content-Disposition
148 (unless (assq 'disposition-type situation)
149 (setq rest (mime-entity-content-disposition entity))
151 (setq situation (cons (cons 'disposition-type
152 (mime-content-disposition-type rest))
154 rest (mime-content-disposition-parameters rest))))
156 (setq param (car rest)
158 (if (cond ((string= name "filename")
159 (if (assq 'filename situation)
161 (setq name 'filename)))
162 ((string= name "creation-date")
163 (if (assq 'creation-date situation)
165 (setq name 'creation-date)))
166 ((string= name "modification-date")
167 (if (assq 'modification-date situation)
169 (setq name 'modification-date)))
170 ((string= name "read-date")
171 (if (assq 'read-date situation)
173 (setq name 'read-date)))
174 ((string= name "size")
175 (if (assq 'size situation)
178 (t (setq name (cons 'disposition name))
179 (if (assoc name situation)
183 (cons (cons name (cdr param))
185 (setq rest (cdr rest)))
187 ;; Content-Transfer-Encoding
188 (or (assq 'encoding situation)
190 (cons (cons 'encoding (or (mime-entity-encoding entity)
196 (defsubst mime-delq-null-situation (situations field
197 &rest ignored-values)
200 (let* ((situation (car situations))
201 (cell (assq field situation)))
203 (or (memq (cdr cell) ignored-values)
204 (setq dest (cons situation dest)))))
205 (setq situations (cdr situations)))
208 (defun mime-compare-situation-with-example (situation example)
209 (let ((example (copy-alist example))
212 (let* ((cell (car situation))
214 (ecell (assoc key example)))
216 (if (equal cell ecell)
217 (setq match (1+ match))
218 (setq example (delq ecell example)))))
219 (setq situation (cdr situation)))
220 (cons match example)))
222 (defun mime-sort-situation (situation)
232 (disposition-type . 6)))
235 (let ((ret (assq a-t order)))
237 (setq a-order (cdr ret))
241 (let ((ret (assq b-t order)))
243 (setq b-order (cdr ret))
246 (if (= a-order b-order)
247 (string< (format "%s" a-t)(format "%s" b-t))
248 (< a-order b-order))))))
250 (defun mime-unify-situations (entity-situation
251 condition situation-examples
252 &optional required-name ignored-value
255 (in-calist-package 'mime-view)
257 (ctree-find-calist condition entity-situation
260 (setq ret (mime-delq-null-situation ret required-name
262 (or (assq 'ignore-examples entity-situation)
270 (let ((situation (car rest))
271 (examples situation-examples))
274 (mime-compare-situation-with-example
275 situation (caar examples)))
276 (ret-score (car ret)))
277 (cond ((> ret-score max-score)
278 (setq max-score ret-score
279 max-escore (cdar examples)
280 max-examples (list (cdr ret))
281 max-situations (list situation)))
282 ((= ret-score max-score)
283 (cond ((> (cdar examples) max-escore)
284 (setq max-escore (cdar examples)
285 max-examples (list (cdr ret))
286 max-situations (list situation)))
287 ((= (cdar examples) max-escore)
289 (cons (cdr ret) max-examples))
290 (or (member situation max-situations)
292 (cons situation max-situations))))))))
293 (setq examples (cdr examples))))
294 (setq rest (cdr rest)))
296 (setq ret max-situations)
298 (let* ((example (car max-examples))
300 (assoc example situation-examples)))
302 (setcdr cell (1+ (cdr cell)))
303 (setq situation-examples
304 (cons (cons example 0)
305 situation-examples))))
306 (setq max-examples (cdr max-examples)))))))
307 (cons ret situation-examples)
308 ;; ret: list of situations
309 ;; situation-examples: new examples (notoce that contents of
310 ;; argument `situation-examples' has bees modified)
313 (defun mime-view-entity-title (entity)
314 (or (mime-entity-read-field entity 'Content-Description)
315 (mime-entity-read-field entity 'Subject)
316 (mime-entity-filename entity)
319 (defvar mime-preview-situation-example-list nil)
320 (defvar mime-preview-situation-example-list-max-size 16)
321 ;; (defvar mime-preview-situation-example-condition nil)
323 (defun mime-find-entity-preview-situation (entity
324 &optional default-situation)
326 (mime-unify-situations
327 (append (mime-entity-situation entity)
329 mime-preview-condition
330 mime-preview-situation-example-list)))
331 (setq mime-preview-situation-example-list
337 (defvar mime-acting-situation-example-list nil)
338 (defvar mime-acting-situation-example-list-max-size 16)
339 (defvar mime-situation-examples-file-coding-system nil)
341 (defun mime-save-situation-examples ()
342 (if (or mime-preview-situation-example-list
343 mime-acting-situation-example-list)
344 (let ((file mime-situation-examples-file))
346 (insert ";;; " (file-name-nondirectory file) "\n")
347 (insert "\n;; This file is generated automatically by "
348 mime-view-version "\n\n")
349 (insert ";;; Code:\n\n")
350 (if mime-preview-situation-example-list
351 (pp `(setq mime-preview-situation-example-list
352 ',mime-preview-situation-example-list)
354 (if mime-acting-situation-example-list
355 (pp `(setq mime-acting-situation-example-list
356 ',mime-acting-situation-example-list)
359 (file-name-nondirectory file)
361 (setq buffer-file-coding-system
362 mime-situation-examples-file-coding-system)
364 ;; ((boundp 'buffer-file-coding-system)
365 ;; (setq buffer-file-coding-system
366 ;; mime-situation-examples-file-coding-system))
367 ;; ((boundp 'file-coding-system)
368 ;; (setq file-coding-system
369 ;; mime-situation-examples-file-coding-system)))
370 (setq buffer-file-name file)
373 (add-hook 'kill-emacs-hook 'mime-save-situation-examples)
375 (defun mime-reduce-situation-examples (situation-examples)
376 (let ((len (length situation-examples))
384 ir situation-examples)
388 jr situation-examples)
392 (setq ret (mime-compare-situation-with-example (car ic)(car jc))
394 det-ret (+ (length (car ic))(length (car jc)))
395 det-org (length (cdr ret))
396 freq (+ (cdr ic)(cdr jc)))
397 (cond ((< max-sim sim)
404 dest (cons (cdr ret) freq)))
406 (cond ((> min-det-ret det-ret)
407 (setq min-det-ret det-ret
412 dest (cons (cdr ret) freq)))
413 ((= min-det-ret det-ret)
414 (cond ((> min-det-org det-org)
415 (setq min-det-org det-org
419 dest (cons (cdr ret) freq)))
420 ((= min-det-org det-org)
421 (cond ((> min-freq freq)
425 dest (cons (cdr ret) freq)))))))))))
434 (setq jr (nthcdr (1- d-j) situation-examples))
435 (setcdr jr (cddr jr))
437 (setq situation-examples
438 (cdr situation-examples))
439 (setq ir (nthcdr (1- d-i) situation-examples))
440 (setcdr ir (cddr ir)))
441 (if (setq ir (assoc (car dest) situation-examples))
443 (setcdr ir (+ (cdr ir)(cdr dest)))
445 (cons dest situation-examples)
446 ;; situation-examples may be modified.
450 ;;; @ presentation of preview
456 ;;; @@@ predicate function
459 ;; (defun mime-view-entity-button-visible-p (entity)
460 ;; "Return non-nil if header of ENTITY is visible.
461 ;; Please redefine this function if you want to change default setting."
462 ;; (let ((media-type (mime-entity-media-type entity))
463 ;; (media-subtype (mime-entity-media-subtype entity)))
464 ;; (or (not (eq media-type 'application))
465 ;; (and (not (eq media-subtype 'x-selection))
466 ;; (or (not (eq media-subtype 'octet-stream))
467 ;; (let ((mother-entity (mime-entity-parent entity)))
468 ;; (or (not (eq (mime-entity-media-type mother-entity)
470 ;; (not (eq (mime-entity-media-subtype mother-entity)
475 ;;; @@@ entity button generator
478 (defun mime-view-insert-entity-button (entity)
479 "Insert entity-button of ENTITY."
480 (let ((entity-node-id (mime-entity-node-id entity))
481 (params (mime-entity-parameters entity))
482 (subject (mime-view-entity-title entity)))
484 (let ((access-type (assoc "access-type" params))
485 (num (or (cdr (assoc "x-part-number" params))
486 (if (consp entity-node-id)
489 (format "%s" (1+ num))))
490 (reverse entity-node-id) ".")
493 (let ((server (assoc "server" params)))
494 (setq access-type (cdr access-type))
496 (format "%s %s ([%s] %s)"
497 num subject access-type (cdr server))
498 (let ((site (cdr (assoc "site" params)))
499 (dir (cdr (assoc "directory" params)))
500 (url (cdr (assoc "url" params))))
502 (format "%s %s ([%s] %s)"
503 num subject access-type url)
504 (format "%s %s ([%s] %s:%s)"
505 num subject access-type site dir))))))
507 (let ((media-type (mime-entity-media-type entity))
508 (media-subtype (mime-entity-media-subtype entity))
509 (charset (cdr (assoc "charset" params)))
510 (encoding (mime-entity-encoding entity)))
514 (format " <%s/%s%s%s>"
515 media-type media-subtype
517 (concat "; " charset)
520 (concat " (" encoding ")")
522 (if (>= (+ (current-column)(length rest))(window-width))
525 (function mime-preview-play-current-entity))))
531 (defvar mime-header-presentation-method-alist nil
532 "Alist of major mode vs. corresponding header-presentation-method functions.
533 Each element looks like (SYMBOL . FUNCTION).
534 SYMBOL must be major mode in raw-buffer or t. t means default.
535 Interface of FUNCTION must be (ENTITY SITUATION).")
537 (defvar mime-view-ignored-field-list
538 '(".*Received:" ".*Path:" ".*Id:" "^References:"
539 "^Replied:" "^Errors-To:"
540 "^Lines:" "^Sender:" ".*Host:" "^Xref:"
541 "^Content-Type:" "^Precedence:"
542 "^Status:" "^X-VM-.*:")
543 "All fields that match this list will be hidden in MIME preview buffer.
544 Each elements are regexp of field-name.")
546 (defvar mime-view-visible-field-list '("^Dnas.*:" "^Message-Id:")
547 "All fields that match this list will be displayed in MIME preview buffer.
548 Each elements are regexp of field-name.")
554 ;;; @@@ predicate function
557 (in-calist-package 'mime-view)
559 (defun mime-calist::field-match-method-as-default-rule (calist
560 field-type field-value)
561 (let ((s-field (assq field-type calist)))
562 (cond ((null s-field)
563 (cons (cons field-type field-value) calist))
566 (define-calist-field-match-method
567 'header #'mime-calist::field-match-method-as-default-rule)
569 (define-calist-field-match-method
570 'body #'mime-calist::field-match-method-as-default-rule)
573 (defvar mime-preview-condition nil
574 "Condition-tree about how to display entity.")
576 (ctree-set-calist-strictly
577 'mime-preview-condition '((type . application)(subtype . octet-stream)
580 (ctree-set-calist-strictly
581 'mime-preview-condition '((type . application)(subtype . octet-stream)
584 (ctree-set-calist-strictly
585 'mime-preview-condition '((type . application)(subtype . octet-stream)
589 (ctree-set-calist-strictly
590 'mime-preview-condition '((type . application)(subtype . pgp)
593 (ctree-set-calist-strictly
594 'mime-preview-condition '((type . application)(subtype . x-latex)
597 (ctree-set-calist-strictly
598 'mime-preview-condition '((type . application)(subtype . x-selection)
601 (ctree-set-calist-strictly
602 'mime-preview-condition '((type . application)(subtype . x-comment)
605 (ctree-set-calist-strictly
606 'mime-preview-condition '((type . message)(subtype . delivery-status)
609 (ctree-set-calist-strictly
610 'mime-preview-condition
612 (body-presentation-method . mime-display-text/plain)))
614 (defvar mime-preview-fill-flowed-text
615 (module-installed-p 'flow-fill)
616 "If non-nil, fill RFC2646 \"flowed\" text.")
618 (autoload 'fill-flowed "flow-fill")
620 (ctree-set-calist-strictly
621 'mime-preview-condition
624 (body-presentation-method . mime-display-text/plain)))
626 (ctree-set-calist-strictly
627 'mime-preview-condition
628 '((type . text)(subtype . enriched)
630 (body-presentation-method . mime-display-text/enriched)))
632 (ctree-set-calist-strictly
633 'mime-preview-condition
634 '((type . text)(subtype . richtext)
636 (body-presentation-method . mime-display-text/richtext)))
638 (autoload 'mime-display-application/x-postpet "postpet")
640 (ctree-set-calist-strictly
641 'mime-preview-condition
642 '((type . application)(subtype . x-postpet)
644 (body-presentation-method . mime-display-application/x-postpet)))
646 (ctree-set-calist-strictly
647 'mime-preview-condition
648 '((type . text)(subtype . t)
650 (body-presentation-method . mime-display-text/plain)))
652 (ctree-set-calist-strictly
653 'mime-preview-condition
654 '((type . multipart)(subtype . alternative)
656 (body-presentation-method . mime-display-multipart/alternative)))
658 (ctree-set-calist-strictly
659 'mime-preview-condition
660 '((type . multipart)(subtype . t)
662 (body-presentation-method . mime-display-multipart/mixed)))
664 (ctree-set-calist-strictly
665 'mime-preview-condition
666 '((type . message)(subtype . partial)
668 (body-presentation-method . mime-display-message/partial-button)))
670 (ctree-set-calist-strictly
671 'mime-preview-condition
672 '((type . message)(subtype . rfc822)
674 (body-presentation-method . mime-display-multipart/mixed)
675 (childrens-situation (header . visible)
676 (entity-button . invisible))))
678 (ctree-set-calist-strictly
679 'mime-preview-condition
680 '((type . message)(subtype . news)
682 (body-presentation-method . mime-display-multipart/mixed)
683 (childrens-situation (header . visible)
684 (entity-button . invisible))))
687 ;;; @@@ entity presentation
690 (defun mime-display-text/plain (entity situation)
692 (narrow-to-region (point-max)(point-max))
694 (mime-insert-text-content entity)
696 (message "Can't decode current entity.")
698 (run-hooks 'mime-text-decode-hook)
699 (goto-char (point-max))
700 (if (not (eq (char-after (1- (point))) ?\n))
702 (if (and mime-preview-fill-flowed-text
703 (equal (cdr (assoc "format" situation)) "flowed"))
705 (mime-add-url-buttons)
706 (run-hooks 'mime-display-text/plain-hook)))
708 (defun mime-display-text/richtext (entity situation)
710 (narrow-to-region (point-max)(point-max))
711 (mime-insert-text-content entity)
712 (run-hooks 'mime-text-decode-hook)
713 (let ((beg (point-min)))
714 (remove-text-properties beg (point-max) '(face nil))
715 (richtext-decode beg (point-max)))))
717 (defun mime-display-text/enriched (entity situation)
719 (narrow-to-region (point-max)(point-max))
720 (mime-insert-text-content entity)
721 (run-hooks 'mime-text-decode-hook)
722 (let ((beg (point-min)))
723 (remove-text-properties beg (point-max) '(face nil))
724 (enriched-decode beg (point-max)))))
726 (defvar mime-view-announcement-for-message/partial
727 "This is message/partial style split message.")
729 (defun mime-display-message/partial-button (&optional entity situation)
731 (goto-char (point-max))
732 (if (not (search-backward "\n\n" nil t))
734 (goto-char (point-max))
735 (mime-insert-button mime-view-announcement-for-message/partial
736 #'mime-preview-play-current-entity)))
738 (defun mime-display-multipart/mixed (entity situation)
739 (let ((children (mime-entity-children entity))
740 (original-major-mode-cell (assq 'major-mode situation))
742 (cdr (assq 'childrens-situation situation))))
743 (if original-major-mode-cell
744 (setq default-situation
745 (cons original-major-mode-cell default-situation)))
747 (mime-display-entity (car children) nil default-situation)
748 (setq children (cdr children)))))
750 (defcustom mime-view-type-subtype-score-alist
751 '(((text . enriched) . 3)
752 ((text . richtext) . 2)
755 "Alist MEDIA-TYPE vs corresponding score.
756 MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default."
758 :type '(repeat (cons (choice :tag "Media-Type"
759 (cons :tag "Type/Subtype"
760 (symbol :tag "Primary-type")
761 (symbol :tag "Subtype"))
763 (const :tag "Default" t))
766 (defun mime-display-multipart/alternative (entity situation)
767 (let* ((children (mime-entity-children entity))
768 (original-major-mode-cell (assq 'major-mode situation))
770 (cdr (assq 'childrens-situation situation)))
775 (if original-major-mode-cell
776 (setq default-situation
777 (cons original-major-mode-cell default-situation)))
782 (mime-find-entity-preview-situation
783 child default-situation)))
784 (if (cdr (assq 'body-presentation-method situation))
789 (cdr (assq 'type situation))
790 (cdr (assq 'subtype situation)))
791 mime-view-type-subtype-score-alist)
793 (cdr (assq 'type situation))
794 mime-view-type-subtype-score-alist)
797 mime-view-type-subtype-score-alist)))))
798 (if (> score max-score)
806 (let ((child (car children))
807 (situation (car situations)))
808 (mime-display-entity child (if (= i p)
810 (put-alist 'body 'invisible
811 (copy-alist situation)))))
812 (setq children (cdr children)
813 situations (cdr situations)
817 ;;; @ acting-condition
820 (defvar mime-acting-condition nil
821 "Condition-tree about how to process entity.")
823 (if (file-readable-p mime-mailcap-file)
824 (let ((entries (mime-parse-mailcap-file)))
826 (let ((entry (car entries))
829 (let* ((field (car entry))
830 (field-type (car field)))
831 (cond ((eq field-type 'view) (setq view field))
832 ((eq field-type 'print) (setq print field))
833 ((memq field-type '(compose composetyped edit)))
834 (t (setq shared (cons field shared)))))
835 (setq entry (cdr entry)))
836 (setq shared (nreverse shared))
837 (ctree-set-calist-with-default
838 'mime-acting-condition
839 (append shared (list '(mode . "play")(cons 'method (cdr view)))))
841 (ctree-set-calist-with-default
842 'mime-acting-condition
844 (list '(mode . "print")(cons 'method (cdr view)))))))
845 (setq entries (cdr entries)))))
847 (ctree-set-calist-strictly
848 'mime-acting-condition
849 '((type . application)(subtype . octet-stream)
851 (method . mime-detect-content)))
853 (ctree-set-calist-with-default
854 'mime-acting-condition
856 (method . mime-save-content)))
858 (ctree-set-calist-strictly
859 'mime-acting-condition
860 '((type . text)(subtype . x-rot13-47)(mode . "play")
861 (method . mime-view-caesar)))
862 (ctree-set-calist-strictly
863 'mime-acting-condition
864 '((type . text)(subtype . x-rot13-47-48)(mode . "play")
865 (method . mime-view-caesar)))
867 (ctree-set-calist-strictly
868 'mime-acting-condition
869 '((type . message)(subtype . rfc822)(mode . "play")
870 (method . mime-view-message/rfc822)))
871 (ctree-set-calist-strictly
872 'mime-acting-condition
873 '((type . message)(subtype . partial)(mode . "play")
874 (method . mime-store-message/partial-piece)))
876 (ctree-set-calist-strictly
877 'mime-acting-condition
878 '((type . message)(subtype . external-body)
879 ("access-type" . "anon-ftp")
880 (method . mime-view-message/external-anon-ftp)))
882 (ctree-set-calist-strictly
883 'mime-acting-condition
884 '((type . message)(subtype . external-body)
885 ("access-type" . "url")
886 (method . mime-view-message/external-url)))
888 (ctree-set-calist-strictly
889 'mime-acting-condition
890 '((type . application)(subtype . octet-stream)
891 (method . mime-save-content)))
894 ;;; @ quitting method
897 (defvar mime-preview-quitting-method-alist
898 '((mime-show-message-mode
899 . mime-preview-quitting-method-for-mime-show-message-mode))
900 "Alist of major-mode vs. quitting-method of mime-view.")
902 (defvar mime-preview-over-to-previous-method-alist nil
903 "Alist of major-mode vs. over-to-previous-method of mime-view.")
905 (defvar mime-preview-over-to-next-method-alist nil
906 "Alist of major-mode vs. over-to-next-method of mime-view.")
909 ;;; @ following method
912 (defvar mime-preview-following-method-alist nil
913 "Alist of major-mode vs. following-method of mime-view.")
915 (defvar mime-view-following-required-fields-list
922 (defun mime-display-entity (entity &optional situation
923 default-situation preview-buffer)
925 (setq preview-buffer (current-buffer)))
926 (let* (e nb ne nhb nbb)
927 (in-calist-package 'mime-view)
930 (mime-find-entity-preview-situation entity default-situation)))
931 (let ((button-is-invisible
932 (eq (cdr (or (assq '*entity-button situation)
933 (assq 'entity-button situation)))
936 (eq (cdr (or (assq '*header situation)
937 (assq 'header situation)))
940 (eq (cdr (or (assq '*body situation)
941 (assq 'body situation)))
943 (children (mime-entity-children entity)))
944 (set-buffer preview-buffer)
946 (narrow-to-region nb nb)
947 (or button-is-invisible
948 ;; (if (mime-view-entity-button-visible-p entity)
949 (mime-view-insert-entity-button entity)
952 (if header-is-visible
953 (let ((header-presentation-method
954 (or (cdr (assq 'header-presentation-method situation))
955 (cdr (assq (cdr (assq 'major-mode situation))
956 mime-header-presentation-method-alist)))))
958 (if header-presentation-method
959 (funcall header-presentation-method entity situation)
960 (mime-insert-header entity
961 mime-view-ignored-field-list
962 mime-view-visible-field-list))
963 (mime-add-url-buttons)
964 (run-hooks 'mime-display-header-hook)
965 (put-text-property nhb (point-max) 'mime-view-entity-header entity)
966 (goto-char (point-max))
971 (let ((body-presentation-method
972 (cdr (assq 'body-presentation-method situation))))
973 (if (functionp body-presentation-method)
974 (funcall body-presentation-method entity situation)
975 (mime-display-text/plain entity situation)))
976 (when button-is-invisible
977 (goto-char (point-max))
978 (mime-view-insert-entity-button entity))
979 (unless header-is-visible
980 (goto-char (point-max))
982 (setq ne (point-max))
984 (put-text-property nb ne 'mime-view-entity entity)
985 (put-text-property nb ne 'mime-view-situation situation)
986 (put-text-property nbb ne 'mime-view-entity-body entity)
988 (if (and children body-is-visible)
989 (let ((body-presentation-method
990 (cdr (assq 'body-presentation-method situation))))
991 (if (functionp body-presentation-method)
992 (funcall body-presentation-method entity situation)
993 (mime-display-multipart/mixed entity situation)))))))
996 ;;; @ MIME viewer mode
999 (defconst mime-view-popup-menu-list
1001 ["Move to upper entity" mime-preview-move-to-upper]
1002 ["Move to previous entity" mime-preview-move-to-previous]
1003 ["Move to next entity" mime-preview-move-to-next]
1004 ["Scroll-down" mime-preview-scroll-down-entity]
1005 ["Scroll-up" mime-preview-scroll-up-entity]
1006 ["Play current entity" mime-preview-play-current-entity]
1007 ["Extract current entity" mime-preview-extract-current-entity]
1008 ["Print current entity" mime-preview-print-current-entity])
1009 "Menu for MIME Viewer")
1011 (defun mime-view-popup-menu (event)
1012 "Popup the menu in the MIME Viewer buffer"
1014 (mime-popup-menu-popup mime-view-popup-menu-list event))
1016 ;;; The current local map is taken precendence over `widget-keymap',
1017 ;;; because GNU Emacs' widget implementation doesn't set `local-map' property.
1018 ;;; So we need to specify derivation.
1019 (defvar widget-keymap)
1020 (defun mime-view-maybe-inherit-widget-keymap ()
1021 (when (boundp 'widget-keymap)
1022 (set-keymap-parent (current-local-map) widget-keymap)))
1024 (add-hook 'mime-view-define-keymap-hook 'mime-view-maybe-inherit-widget-keymap)
1026 (defun mime-view-define-keymap (&optional default)
1027 (let ((mime-view-mode-map (if (keymapp default)
1028 (copy-keymap default)
1029 (make-sparse-keymap))))
1030 (define-key mime-view-mode-map
1031 "u" (function mime-preview-move-to-upper))
1032 (define-key mime-view-mode-map
1033 "p" (function mime-preview-move-to-previous))
1034 (define-key mime-view-mode-map
1035 "n" (function mime-preview-move-to-next))
1036 (define-key mime-view-mode-map
1037 "\e\t" (function mime-preview-move-to-previous))
1038 (define-key mime-view-mode-map
1039 "\t" (function mime-preview-move-to-next))
1040 (define-key mime-view-mode-map
1041 " " (function mime-preview-scroll-up-entity))
1042 (define-key mime-view-mode-map
1043 "\M- " (function mime-preview-scroll-down-entity))
1044 (define-key mime-view-mode-map
1045 "\177" (function mime-preview-scroll-down-entity))
1046 (define-key mime-view-mode-map
1047 "\C-m" (function mime-preview-next-line-entity))
1048 (define-key mime-view-mode-map
1049 "\C-\M-m" (function mime-preview-previous-line-entity))
1050 (define-key mime-view-mode-map
1051 "v" (function mime-preview-play-current-entity))
1052 (define-key mime-view-mode-map
1053 "e" (function mime-preview-extract-current-entity))
1054 (define-key mime-view-mode-map
1055 "\C-c\C-p" (function mime-preview-print-current-entity))
1057 (define-key mime-view-mode-map
1058 "\C-c\C-t\C-f" (function mime-preview-toggle-header))
1059 (define-key mime-view-mode-map
1060 "\C-c\C-th" (function mime-preview-toggle-header))
1061 (define-key mime-view-mode-map
1062 "\C-c\C-t\C-c" (function mime-preview-toggle-content))
1064 (define-key mime-view-mode-map
1065 "\C-c\C-v\C-f" (function mime-preview-show-header))
1066 (define-key mime-view-mode-map
1067 "\C-c\C-vh" (function mime-preview-show-header))
1068 (define-key mime-view-mode-map
1069 "\C-c\C-v\C-c" (function mime-preview-show-content))
1071 (define-key mime-view-mode-map
1072 "\C-c\C-d\C-f" (function mime-preview-hide-header))
1073 (define-key mime-view-mode-map
1074 "\C-c\C-dh" (function mime-preview-hide-header))
1075 (define-key mime-view-mode-map
1076 "\C-c\C-d\C-c" (function mime-preview-hide-content))
1078 (define-key mime-view-mode-map
1079 "a" (function mime-preview-follow-current-entity))
1080 (define-key mime-view-mode-map
1081 "q" (function mime-preview-quit))
1082 (define-key mime-view-mode-map
1083 "\C-c\C-x" (function mime-preview-kill-buffer))
1084 ;; (define-key mime-view-mode-map
1085 ;; "<" (function beginning-of-buffer))
1086 ;; (define-key mime-view-mode-map
1087 ;; ">" (function end-of-buffer))
1088 (define-key mime-view-mode-map
1089 "?" (function describe-mode))
1090 (define-key mime-view-mode-map
1091 [tab] (function mime-preview-move-to-next))
1092 (define-key mime-view-mode-map
1093 [delete] (function mime-preview-scroll-down-entity))
1094 (define-key mime-view-mode-map
1095 [backspace] (function mime-preview-scroll-down-entity))
1096 (if (functionp default)
1097 (if (featurep 'xemacs)
1098 (set-keymap-default-binding mime-view-mode-map default)
1099 (setq mime-view-mode-map
1100 (append mime-view-mode-map (list (cons t default))))))
1101 (define-key mime-view-mode-map
1102 [down-mouse-3] (function mime-view-popup-menu))
1103 ;; (run-hooks 'mime-view-define-keymap-hook)
1104 mime-view-mode-map))
1106 (defvar mime-view-mode-default-map (mime-view-define-keymap))
1109 (defsubst mime-maybe-hide-echo-buffer ()
1110 "Clear mime-echo buffer and delete window for it."
1111 (let ((buf (get-buffer mime-echo-buffer-name)))
1116 (let ((win (get-buffer-window buf)))
1118 (delete-window win)))
1119 (bury-buffer buf)))))
1121 (defvar mime-view-redisplay nil)
1124 (defun mime-display-message (message &optional preview-buffer
1125 mother default-keymap-or-function
1126 original-major-mode keymap)
1127 "View MESSAGE in MIME-View mode.
1129 Optional argument PREVIEW-BUFFER specifies the buffer of the
1130 presentation. It must be either nil or a name of preview buffer.
1132 Optional argument MOTHER specifies mother-buffer of the preview-buffer.
1134 Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or
1135 function. If it is a keymap, keymap of MIME-View mode will be added
1136 to it. If it is a function, it will be bound as default binding of
1137 keymap of MIME-View mode.
1139 Optional argument ORIGINAL-MAJOR-MODE is major-mode of representation
1140 buffer of MESSAGE. If it is nil, current `major-mode' is used.
1142 Optional argument KEYMAP is keymap of MIME-View mode. If it is
1143 non-nil, DEFAULT-KEYMAP-OR-FUNCTION is ignored. If it is nil,
1144 `mime-view-mode-default-map' is used."
1145 (mime-maybe-hide-echo-buffer)
1146 (let ((win-conf (current-window-configuration)))
1148 (setq preview-buffer
1149 (concat "*Preview-" (mime-entity-name message) "*")))
1150 (or original-major-mode
1151 (setq original-major-mode major-mode))
1152 (let ((inhibit-read-only t))
1153 (set-buffer (get-buffer-create preview-buffer))
1157 (setq mime-mother-buffer mother))
1158 (setq mime-preview-original-window-configuration win-conf)
1159 (setq major-mode 'mime-view-mode)
1160 (setq mode-name "MIME-View")
1161 (mime-display-entity message nil
1162 `((entity-button . invisible)
1164 (major-mode . ,original-major-mode))
1168 (if default-keymap-or-function
1169 (mime-view-define-keymap default-keymap-or-function)
1170 mime-view-mode-default-map)))
1172 (next-single-property-change (point-min) 'mime-view-entity)))
1175 (goto-char (point-min))
1176 (search-forward "\n\n" nil t)))
1177 (run-hooks 'mime-view-mode-hook)
1178 (set-buffer-modified-p nil)
1179 (setq buffer-read-only t)
1183 (defun mime-view-buffer (&optional raw-buffer preview-buffer mother
1184 default-keymap-or-function
1185 representation-type)
1186 "View RAW-BUFFER in MIME-View mode.
1187 Optional argument PREVIEW-BUFFER is either nil or a name of preview
1189 Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or
1190 function. If it is a keymap, keymap of MIME-View mode will be added
1191 to it. If it is a function, it will be bound as default binding of
1192 keymap of MIME-View mode.
1193 Optional argument REPRESENTATION-TYPE is representation-type of
1194 message. It must be nil, `binary' or `cooked'. If it is nil,
1195 `cooked' is used as default."
1198 (setq raw-buffer (current-buffer)))
1199 (or representation-type
1200 (setq representation-type
1202 (set-buffer raw-buffer)
1203 (cdr (or (assq major-mode mime-raw-representation-type-alist)
1204 (assq t mime-raw-representation-type-alist))))))
1205 (if (eq representation-type 'binary)
1206 (setq representation-type 'buffer))
1207 (setq preview-buffer (mime-display-message
1208 (mime-open-entity representation-type raw-buffer)
1209 preview-buffer mother default-keymap-or-function))
1210 (or (get-buffer-window preview-buffer)
1211 (let ((r-win (get-buffer-window raw-buffer)))
1213 (set-window-buffer r-win preview-buffer)
1214 (let ((m-win (and mother (get-buffer-window mother))))
1216 (set-window-buffer m-win preview-buffer)
1217 (switch-to-buffer preview-buffer)))))))
1219 (defun mime-view-mode (&optional mother ctl encoding
1220 raw-buffer preview-buffer
1221 default-keymap-or-function)
1222 "Major mode for viewing MIME message.
1224 Here is a list of the standard keys for mime-view-mode.
1229 u Move to upper content
1230 p or M-TAB Move to previous content
1231 n or TAB Move to next content
1232 SPC Scroll up or move to next content
1233 M-SPC or DEL Scroll down or move to previous content
1234 RET Move to next line
1235 M-RET Move to previous line
1236 v Decode current content as `play mode'
1237 e Decode current content as `extract mode'
1238 C-c C-p Decode current content as `print mode'
1239 a Followup to current content.
1241 button-2 Move to point under the mouse cursor
1242 and decode current content as `play mode'
1245 (unless mime-view-redisplay
1247 (if raw-buffer (set-buffer raw-buffer))
1250 (or (assq major-mode mime-raw-representation-type-alist)
1251 (assq t mime-raw-representation-type-alist)))))
1252 (if (eq type 'binary)
1253 (setq type 'buffer))
1254 (setq mime-message-structure (mime-open-entity type raw-buffer))
1255 (or (mime-entity-content-type mime-message-structure)
1256 (mime-entity-set-content-type mime-message-structure ctl)))
1257 (or (mime-entity-encoding mime-message-structure)
1258 (mime-entity-set-encoding mime-message-structure encoding))))
1259 (mime-display-message mime-message-structure preview-buffer
1260 mother default-keymap-or-function))
1266 (defun mime-preview-find-boundary-info (&optional get-mother)
1270 (while (null (setq entity
1271 (get-text-property (point) 'mime-view-entity)))
1273 (setq p-beg (previous-single-property-change (point) 'mime-view-entity))
1274 (setq entity-node-id (mime-entity-node-id entity))
1275 (setq len (length entity-node-id))
1278 (if (eq (next-single-property-change (point-min)
1283 ((eq (next-single-property-change p-beg 'mime-view-entity)
1285 (setq p-beg (point))))
1286 (setq p-end (next-single-property-change p-beg 'mime-view-entity))
1288 (setq p-end (point-max)))
1289 ((null entity-node-id)
1290 (setq p-end (point-max)))
1297 (next-single-property-change
1298 (point) 'mime-view-entity))
1300 (let ((rc (mime-entity-node-id
1301 (get-text-property (1- (point))
1302 'mime-view-entity))))
1303 (or (and (>= (setq i (- (length rc) len)) 0)
1304 (equal entity-node-id (nthcdr i rc)))
1307 (setq p-end (point-max))))))
1308 (vector p-beg p-end entity)))
1314 (autoload 'mime-preview-play-current-entity "mime-play"
1315 "Play current entity." t)
1317 (defun mime-preview-extract-current-entity (&optional ignore-examples)
1318 "Extract current entity into file (maybe).
1319 It decodes current entity to call internal or external method as
1320 \"extract\" mode. The method is selected from variable
1321 `mime-acting-condition'."
1323 (mime-preview-play-current-entity ignore-examples "extract"))
1325 (defun mime-preview-print-current-entity (&optional ignore-examples)
1326 "Print current entity (maybe).
1327 It decodes current entity to call internal or external method as
1328 \"print\" mode. The method is selected from variable
1329 `mime-acting-condition'."
1331 (mime-preview-play-current-entity ignore-examples "print"))
1337 (defun mime-preview-follow-current-entity ()
1338 "Write follow message to current entity.
1339 It calls following-method selected from variable
1340 `mime-preview-following-method-alist'."
1342 (let ((entity (mime-preview-find-boundary-info t))
1345 (setq p-beg (aref entity 0)
1346 p-end (aref entity 1)
1347 entity (aref entity 2))
1348 (if (get-text-property p-beg 'mime-view-entity-body)
1351 (next-single-property-change
1352 p-beg 'mime-view-entity-body nil
1353 (or (next-single-property-change p-beg 'mime-view-entity)
1355 (let* ((mode (mime-preview-original-major-mode 'recursive))
1356 (entity-node-id (mime-entity-node-id entity))
1358 (format "%s-%s" (buffer-name) (reverse entity-node-id)))
1360 (the-buf (current-buffer))
1363 (set-buffer (setq new-buf (get-buffer-create new-name)))
1366 (insert-buffer-substring the-buf pb-beg p-end)
1367 (goto-char (point-min))
1368 (let ((current-entity
1369 (if (and (eq (mime-entity-media-type entity) 'message)
1370 (eq (mime-entity-media-subtype entity) 'rfc822))
1371 (car (mime-entity-children entity))
1373 (while (and current-entity
1374 (if (and (eq (mime-entity-media-type
1375 current-entity) 'message)
1376 (eq (mime-entity-media-subtype
1377 current-entity) 'rfc822))
1379 (mime-insert-header current-entity fields)
1381 (setq fields (std11-collect-field-names)
1382 current-entity (mime-entity-parent current-entity))))
1383 (let ((rest mime-view-following-required-fields-list)
1386 (setq field-name (car rest))
1387 (or (std11-field-body field-name)
1390 (set-buffer the-buf)
1391 (let ((entity (when mime-mother-buffer
1392 (set-buffer mime-mother-buffer)
1393 (get-text-property (point)
1394 'mime-view-entity))))
1396 (null (setq ret (mime-entity-fetch-field
1397 entity field-name))))
1398 (setq entity (mime-entity-parent entity)))))
1400 (insert (concat field-name ": " ret "\n")))))
1401 (setq rest (cdr rest)))))
1402 (let ((f (cdr (assq mode mime-preview-following-method-alist))))
1407 "Sorry, following method for %s is not implemented yet."
1414 (defun mime-preview-move-to-upper ()
1415 "Move to upper entity.
1416 If there is no upper entity, call function `mime-preview-quit'."
1419 (while (null (setq cinfo
1420 (get-text-property (point) 'mime-view-entity)))
1422 (let ((r (mime-entity-parent cinfo))
1425 (while (setq point (previous-single-property-change
1426 (point) 'mime-view-entity))
1428 (when (eq r (get-text-property (point) 'mime-view-entity))
1429 (if (or (eq mime-preview-move-scroll t)
1430 (and mime-preview-move-scroll
1433 (move-to-window-line -1)
1434 (forward-line (* -1 next-screen-context-lines))
1437 (recenter next-screen-context-lines))
1439 (mime-preview-quit)))))
1441 (defun mime-preview-move-to-previous ()
1442 "Move to previous entity.
1443 If there is no previous entity, it calls function registered in
1444 variable `mime-preview-over-to-previous-method-alist'."
1446 (while (and (not (bobp))
1447 (null (get-text-property (point) 'mime-view-entity)))
1449 (let ((point (previous-single-property-change (point) 'mime-view-entity)))
1451 (>= point (point-min)))
1452 (if (get-text-property (1- point) 'mime-view-entity)
1453 (progn (goto-char point)
1455 (or (eq mime-preview-move-scroll t)
1456 (and mime-preview-move-scroll
1459 (move-to-window-line 0)
1460 (forward-line next-screen-context-lines)
1463 (recenter (* -1 next-screen-context-lines))))
1464 (goto-char (1- point))
1465 (mime-preview-move-to-previous))
1466 (let ((f (assq (mime-preview-original-major-mode)
1467 mime-preview-over-to-previous-method-alist)))
1469 (funcall (cdr f)))))))
1471 (defun mime-preview-move-to-next ()
1472 "Move to next entity.
1473 If there is no previous entity, it calls function registered in
1474 variable `mime-preview-over-to-next-method-alist'."
1476 (while (and (not (eobp))
1477 (null (get-text-property (point) 'mime-view-entity)))
1479 (let ((point (next-single-property-change (point) 'mime-view-entity)))
1481 (<= point (point-max)))
1484 (if (null (get-text-property point 'mime-view-entity))
1485 (mime-preview-move-to-next)
1487 (or (eq mime-preview-move-scroll t)
1488 (and mime-preview-move-scroll
1491 (move-to-window-line -1)
1493 (* -1 next-screen-context-lines))
1496 (recenter next-screen-context-lines))))
1497 (let ((f (assq (mime-preview-original-major-mode)
1498 mime-preview-over-to-next-method-alist)))
1500 (funcall (cdr f)))))))
1502 (defun mime-preview-scroll-up-entity (&optional h)
1503 "Scroll up current entity.
1504 If reached to (point-max), it calls function registered in variable
1505 `mime-preview-over-to-next-method-alist'."
1508 (let ((f (assq (mime-preview-original-major-mode)
1509 mime-preview-over-to-next-method-alist)))
1513 (or (next-single-property-change (point) 'mime-view-entity)
1515 (bottom (window-end (selected-window))))
1518 (progn (goto-char point)
1519 (recenter next-screen-context-lines))
1523 (goto-char (point-max))))))))
1525 (defun mime-preview-scroll-down-entity (&optional h)
1526 "Scroll down current entity.
1527 If reached to (point-min), it calls function registered in variable
1528 `mime-preview-over-to-previous-method-alist'."
1531 (let ((f (assq (mime-preview-original-major-mode)
1532 mime-preview-over-to-previous-method-alist)))
1536 (or (previous-single-property-change (point) 'mime-view-entity)
1538 (top (window-start (selected-window))))
1541 (progn (goto-char point)
1542 (recenter (* -1 next-screen-context-lines)))
1545 (beginning-of-buffer
1546 (goto-char (point-min))))))))
1548 (defun mime-preview-next-line-entity (&optional lines)
1549 "Scroll up one line (or prefix LINES lines).
1550 If LINES is negative, scroll down LINES lines."
1552 (mime-preview-scroll-up-entity (or lines 1)))
1554 (defun mime-preview-previous-line-entity (&optional lines)
1555 "Scrroll down one line (or prefix LINES lines).
1556 If LINES is negative, scroll up LINES lines."
1558 (mime-preview-scroll-down-entity (or lines 1)))
1564 (defun mime-preview-toggle-display (type &optional display)
1565 (let ((situation (mime-preview-find-boundary-info))
1566 (sym (intern (concat "*" (symbol-name type))))
1568 (setq p-beg (aref situation 0)
1569 p-end (aref situation 1)
1570 entity (aref situation 2)
1571 situation (get-text-property p-beg 'mime-view-situation))
1572 (cond ((eq display 'invisible)
1577 (eq (cdr (or (assq sym situation)
1578 (assq type situation)))
1580 (setq situation (put-alist sym (if display
1585 (let ((inhibit-read-only t))
1586 (delete-region p-beg p-end)
1587 (mime-display-entity entity situation)))
1588 (let ((ret (assoc situation mime-preview-situation-example-list)))
1590 (setcdr ret (1+ (cdr ret)))
1591 (add-to-list 'mime-preview-situation-example-list
1592 (cons situation 0))))))
1594 (defun mime-preview-toggle-header (&optional force-visible)
1596 (mime-preview-toggle-display 'header force-visible))
1598 (defun mime-preview-toggle-content (&optional force-visible)
1600 (mime-preview-toggle-display 'body force-visible))
1602 (defun mime-preview-show-header ()
1604 (mime-preview-toggle-display 'header 'visible))
1606 (defun mime-preview-show-content ()
1608 (mime-preview-toggle-display 'body 'visible))
1610 (defun mime-preview-hide-header ()
1612 (mime-preview-toggle-display 'header 'invisible))
1614 (defun mime-preview-hide-content ()
1616 (mime-preview-toggle-display 'body 'invisible))
1622 (defun mime-preview-quit ()
1623 "Quit from MIME-preview buffer.
1624 It calls function registered in variable
1625 `mime-preview-quitting-method-alist'."
1627 (let ((r (assq (mime-preview-original-major-mode)
1628 mime-preview-quitting-method-alist)))
1630 (funcall (cdr r)))))
1632 (defun mime-preview-kill-buffer ()
1634 (kill-buffer (current-buffer)))
1640 (provide 'mime-view)
1642 (let ((file mime-situation-examples-file))
1643 (if (file-readable-p file)
1645 (insert-file-contents file)
1646 (setq mime-situation-examples-file-coding-system
1648 ((boundp 'buffer-file-coding-system)
1649 (symbol-value 'buffer-file-coding-system))
1650 ((boundp 'file-coding-system)
1651 (symbol-value 'file-coding-system))
1657 (while (and (> (length mime-preview-situation-example-list)
1658 mime-preview-situation-example-list-max-size)
1660 (setq mime-preview-situation-example-list
1661 (mime-reduce-situation-examples
1662 mime-preview-situation-example-list))
1664 (error (setq mime-preview-situation-example-list nil)))
1665 ;; (let ((rest mime-preview-situation-example-list))
1667 ;; (ctree-set-calist-strictly 'mime-preview-condition
1669 ;; (setq rest (cdr rest))))
1672 (while (and (> (length mime-acting-situation-example-list)
1673 mime-acting-situation-example-list-max-size)
1675 (setq mime-acting-situation-example-list
1676 (mime-reduce-situation-examples
1677 mime-acting-situation-example-list))
1679 (error (setq mime-acting-situation-example-list nil))))))
1681 ;;; mime-view.el ends here