X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tm-view.el;h=767e49bda8b402eee4d0b48f9f7c87e8ea4594df;hb=f94c46d394e1304bcc35fee20db5523746cf7a7a;hp=8d1737327220ab6912642cb8c3e2857430188c2f;hpb=1d67a0176fa74b4c2f69e2b5524e4d55efa12a17;p=elisp%2Ftm.git diff --git a/tm-view.el b/tm-view.el index 8d17373..767e49b 100644 --- a/tm-view.el +++ b/tm-view.el @@ -4,11 +4,30 @@ ;;; Copyright (C) 1995 Free Software Foundation, Inc. ;;; Copyright (C) 1994,1995 MORIOKA Tomohiko ;;; -;;; Author: MORIOKA Tomohiko +;;; Author: MORIOKA Tomohiko +;;; modified by Steven L. Baur +;;; Maintainer: MORIOKA Tomohiko +;;; Created: 1994/7/13 (1994/8/31 obsolete tm-body.el) +;;; Version: $Revision: 7.32.1.2 $ ;;; Keywords: mail, news, MIME, multimedia ;;; ;;; This file is part of tm (Tools for MIME). ;;; +;;; This program is free software; you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 2, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with This program. If not, write to the Free Software +;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;;; +;;; Code: (require 'tl-str) (require 'tl-list) @@ -25,7 +44,7 @@ ;;; (defconst mime-viewer/RCS-ID - "$Id: tm-view.el,v 7.15 1995/10/13 08:43:49 morioka Exp $") + "$Id: tm-view.el,v 7.32.1.2 1995/12/10 20:29:06 morioka Exp $") (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID)) (defconst mime/viewer-version mime-viewer/version) @@ -37,10 +56,15 @@ (defvar mime/content-decoding-condition '(((type . "text/plain") (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)) - ;;((type . "text/x-latex") - ;; (method "tm-latex" nil 'file 'type 'encoding 'mode 'name)) + ((type . "text/html") + (method "tm-html" nil 'file 'type 'encoding 'mode 'name) + (mode . "play")) + ((type . "text/x-rot13-47") + (method . mime-article/decode-caesar)) + ((type . "audio/basic") (method "tm-au" nil 'file 'type 'encoding 'mode 'name)) + ((type . "image/gif") (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) ((type . "image/jpeg") @@ -53,16 +77,22 @@ (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) ((type . "image/x-pic") (method "tm-image" nil 'file 'type 'encoding 'mode 'name)) + ((type . "video/mpeg") (method "tm-mpeg" nil 'file 'type 'encoding 'mode 'name)) + ((type . "application/octet-stream") (method "tm-file" nil 'file 'type 'encoding 'mode 'name)) + ;;((type . "message/external-body") ;; (method "xterm" nil ;; "-e" "showexternal" ;; 'file '"access-type" '"name" '"site" '"directory")) + ((type . "message/rfc822") + (method . mime-article/view-message/rfc822)) ((type . "message/partial") - (method . mime/decode-message/partial-region)) + (method . mime-article/decode-message/partial)) + ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)(mode . "play")) ((method "tm-file" nil 'file 'type 'encoding 'mode 'name) @@ -82,14 +112,23 @@ (defvar mime-viewer/content-subject-omitting-Content-Type-list '("application/x-selection")) +(defvar mime-viewer/content-subject-showing-Content-Type-list + '("application/pgp")) + (defvar mime-viewer/uuencode-encoding-name-list '("x-uue" "x-uuencode")) (defvar mime-viewer/ignored-field-list - '("Received" "Return-Path" "Replied" "Errors-To" + '(".*Received" "Return-Path" "Replied" "Errors-To" "Lines" "Sender" "Path" "Nntp-Posting-Host" - "Content-Type" "Precedence" "X-Face")) + "Content-Type" "Precedence" "X-Face" + "Status" "X-VM-.*") + "All fields that match this list will be hidden in MIME preview buffer. +Each elements are regexp of field-name. [tm-view.el]") -(defvar mime-viewer/ignored-field-regexp) +(defvar mime-viewer/ignored-field-regexp + (concat "^" + (apply (function regexp-or) mime-viewer/ignored-field-list) + ":")) (defvar mime-viewer/announcement-for-message/partial (if (and (>= emacs-major-version 19) window-system) @@ -106,29 +145,29 @@ ;;; @@ predicate functions ;;; -(defun mime-viewer/header-visible-p (cnum cinfo &optional ctype) - (or (eq cnum t) +(defun mime-viewer/header-visible-p (rcnum cinfo &optional ctype) + (or (null rcnum) (progn (setq ctype (mime::content-info/type - (mime-article/cnum-to-cinfo (butlast cnum) cinfo) + (mime-article/rcnum-to-cinfo (cdr rcnum) cinfo) )) (member ctype mime-viewer/childrens-header-showing-Content-Type-list) ))) -(defun mime-viewer/body-visible-p (cnum cinfo &optional ctype) +(defun mime-viewer/body-visible-p (rcnum cinfo &optional ctype) (let (ccinfo) (or ctype (setq ctype (mime::content-info/type - (setq ccinfo (mime-article/cnum-to-cinfo cnum cinfo)) + (setq ccinfo (mime-article/rcnum-to-cinfo rcnum cinfo)) )) ) (and (member ctype mime-viewer/default-showing-Content-Type-list) (if (string-equal ctype "application/octet-stream") (progn (or ccinfo - (setq ccinfo (mime-article/cnum-to-cinfo cnum cinfo)) + (setq ccinfo (mime-article/rcnum-to-cinfo rcnum cinfo)) ) (member (mime::content-info/encoding ccinfo) '(nil "7bit" "8bit")) @@ -141,18 +180,18 @@ ;;; (defun mime-viewer/insert-content-subject - (cnum cinfo ctype params subj) + (rcnum cinfo ctype params subj) (save-restriction (narrow-to-region (point)(point)) (insert (let ((access-type (assoc "access-type" params)) (num (or (assoc-value "x-part-number" params) - (if (listp cnum) + (if (consp rcnum) (mapconcat (function (lambda (num) (format "%s" (1+ num)) )) - cnum ".") + (reverse rcnum) ".") "0")) )) (if access-type @@ -174,14 +213,13 @@ )) (defun mime-viewer/default-content-subject-function - (cnum cinfo ctype params subj) - (if (and (listp cnum) + (rcnum cinfo ctype params subj) + (if (and (consp rcnum) (not (member ctype - mime-viewer/content-subject-omitting-Content-Type-list)) - ) + mime-viewer/content-subject-omitting-Content-Type-list))) (mime-viewer/insert-content-subject - cnum cinfo ctype params subj) + rcnum cinfo ctype params subj) )) (defvar mime-viewer/content-subject-function @@ -217,16 +255,16 @@ ("application/pgp" . mime-viewer/filter-text/plain) (nil . mime-viewer/filter-text/plain))) -(defun mime-viewer/default-content-filter (cnum cinfo ctype params subj) +(defun mime-viewer/default-content-filter (rcnum cinfo ctype params subj) ) ;;; @@ content separator ;;; -(defun mime-viewer/default-content-separator (cnum cinfo ctype params subj) - (if (and (not (mime-viewer/header-visible-p cnum cinfo ctype)) - (not (mime-viewer/body-visible-p cnum cinfo ctype)) +(defun mime-viewer/default-content-separator (rcnum cinfo ctype params subj) + (if (and (not (mime-viewer/header-visible-p rcnum cinfo ctype)) + (not (mime-viewer/body-visible-p rcnum cinfo ctype)) ) (progn (goto-char (point-max)) @@ -237,12 +275,19 @@ ;;; @@ buffer local variables ;;; -(defvar mime::article/content-info nil) +;; for XEmacs (defvar mime::article/preview-buffer nil) +(defvar mime::article/code-converter nil) + +(make-variable-buffer-local 'mime::article/content-info) +(make-variable-buffer-local 'mime::article/preview-buffer) +(make-variable-buffer-local 'mime::article/code-converter) -(defvar mime::preview/article-buffer nil) -(defvar mime::preview/content-list nil) -(defvar mime::preview/original-major-mode nil) +(make-variable-buffer-local 'mime::preview/mother-buffer) +(make-variable-buffer-local 'mime::preview/content-list) +(make-variable-buffer-local 'mime::preview/article-buffer) +(make-variable-buffer-local 'mime::preview/original-major-mode) +(make-variable-buffer-local 'mime::preview/original-window-configuration) ;;; @@ quitting method @@ -250,19 +295,10 @@ (defvar mime-viewer/quitting-method-alist '((mime/show-message-mode - . (lambda () - (set-window-configuration - mime/show-mode-old-window-configuration) - (let ((mother mime/mother-buffer)) - (kill-buffer - (mime::preview-content-info/buffer - (car mime::preview/content-list))) - (mime-viewer/kill-buffer) - (pop-to-buffer mother) - (goto-char (point-min)) - (mime-viewer/up-content) - ))) - )) + . mime-viewer/quitting-method-for-mime/show-message-mode))) + +(defvar mime-viewer/over-to-previous-method-alist nil) +(defvar mime-viewer/over-to-next-method-alist nil) ;;; @@ X-Face @@ -312,10 +348,8 @@ The compressed face will be piped to this command.") (get-buffer ibuf) (set-buffer ibuf) )) - (make-variable-buffer-local 'mime::article/content-info) (setq mime::article/content-info (mime/parse-message ctl encoding)) (let ((ret (mime-viewer/make-preview-buffer obuf))) - (make-variable-buffer-local 'mime::article/preview-buffer) (setq mime::article/preview-buffer (car ret)) ret)) @@ -338,9 +372,7 @@ The compressed face will be piped to this command.") (setq bf (get-buffer-create obuf)) (set-buffer obuf) )) - (make-variable-buffer-local 'mime::preview/article-buffer) (setq mime::preview/article-buffer the-buf) - (make-variable-buffer-local 'mime::preview/original-major-mode) (setq mime::preview/original-major-mode mode) (setq major-mode 'mime/viewer-mode) (setq mode-name "MIME-View") @@ -363,12 +395,8 @@ The compressed face will be piped to this command.") (ctype (mime::content-info/type content)) (params (mime::content-info/parameters content)) (encoding (mime::content-info/encoding content)) - (cnum (mime::content-info/rcnum content)) + (rcnum (mime::content-info/rcnum content)) he e nb ne subj) - (setq cnum - (if cnum - (reverse cnum) - t)) (set-buffer ibuf) (goto-char beg) (setq he (if (re-search-forward "^$" nil t) @@ -380,35 +408,43 @@ The compressed face will be piped to this command.") (save-restriction (narrow-to-region beg end) (setq subj - (mime/decode-encoded-words-string + (mime-eword/decode-string (mime-viewer/get-subject params encoding))) ) (set-buffer obuf) (setq nb (point)) (narrow-to-region nb nb) (funcall mime-viewer/content-subject-function - cnum cinfo ctype params subj) + rcnum cinfo ctype params subj) (set-buffer ibuf) - (if (mime-viewer/header-visible-p cnum cinfo ctype) + (if (mime-viewer/header-visible-p rcnum cinfo ctype) (mime-viewer/display-header beg he obuf) ) - (cond ((mime-viewer/body-visible-p cnum cinfo ctype) + (if (and (null rcnum) + (member + ctype mime-viewer/content-subject-showing-Content-Type-list)) + (save-excursion + (set-buffer obuf) + (goto-char (point-max)) + (mime-viewer/insert-content-subject rcnum cinfo ctype params subj) + )) + (cond ((mime-viewer/body-visible-p rcnum cinfo ctype) (mime-viewer/display-body he end obuf - cnum cinfo ctype params subj encoding) + rcnum cinfo ctype params subj encoding) ) ((equal ctype "message/partial") (mime-viewer/display-message/partial obuf) ) - ((and (eq cnum t) + ((and (null rcnum) (null (mime::content-info/children cinfo)) ) (set-buffer obuf) (goto-char (point-max)) - (mime-viewer/insert-content-subject cnum cinfo ctype params subj) + (mime-viewer/insert-content-subject rcnum cinfo ctype params subj) ) (t (set-buffer obuf)) ) - (mime-viewer/default-content-separator cnum cinfo ctype params subj) + (mime-viewer/default-content-separator rcnum cinfo ctype params subj) (prog1 (progn (setq ne (point-max)) @@ -435,7 +471,7 @@ The compressed face will be piped to this command.") )))) (defun mime-viewer/display-body (beg end obuf - cnum cinfo ctype params subj encoding) + rcnum cinfo ctype params subj encoding) (let ((str (buffer-substring beg end)) be) (set-buffer obuf) @@ -446,7 +482,7 @@ The compressed face will be piped to this command.") (let ((f (assoc-value ctype mime-viewer/content-filter-alist))) (if (and f (fboundp f)) (funcall f ctype params encoding) - (mime-viewer/default-content-filter cnum cinfo ctype params subj) + (mime-viewer/default-content-filter rcnum cinfo ctype params subj) )) ))) @@ -524,6 +560,18 @@ The compressed face will be piped to this command.") ))) t)))) +(defun mime-article/rcnum-to-cinfo (rcnum &optional cinfo) + (or cinfo + (setq cinfo mime::article/content-info) + ) + (some-element + (function + (lambda (ci) + (equal (mime::content-info/rcnum ci) rcnum) + )) + (mime/flatten-content-info cinfo) + )) + (defun mime-article/cnum-to-cinfo (cn &optional cinfo) (or cinfo (setq cinfo mime::article/content-info) @@ -552,7 +600,7 @@ The compressed face will be piped to this command.") ) dest)) -(defun mime::point-preview-content (p &optional pcl) +(defun mime-preview/point-pcinfo (p &optional pcl) (or pcl (setq pcl mime::preview/content-list) ) @@ -574,7 +622,9 @@ The compressed face will be piped to this command.") ;;; @ content filter ;;; -(defvar mime-viewer/code-converter-alist nil) +(defvar mime-viewer/code-converter-alist + '((mime/show-message-mode . mime/code-convert-region-to-emacs)) + ) (defun mime-viewer/default-code-convert-region (beg end charset &optional encoding) @@ -582,31 +632,33 @@ The compressed face will be piped to this command.") (mime/code-convert-region-to-emacs beg (point-max) charset) )) +(defun mime-preview/decode-text-region (beg end charset encoding) + (mime/decode-region encoding beg end) + (let* ((mode mime::preview/original-major-mode) + (m (or (save-excursion + (set-buffer mime::preview/article-buffer) + mime::article/code-converter) + (cdr (assq mode mime-viewer/code-converter-alist)) + )) + ) + (if (and m (fboundp m)) + (funcall m beg (point-max) charset encoding) + (mime-viewer/default-code-convert-region + beg (point-max) charset encoding) + ))) + (defun mime-viewer/filter-text/plain (ctype params encoding) (let ((charset (cdr (assoc "charset" params))) (beg (point-min)) (end (point-max)) ) - (goto-char (point-min)) - (cond ((string= encoding "quoted-printable") - (quoted-printable-decode-region beg end) - ) - ((string= encoding "base64") - (base64-decode-region beg end) - )) - (let* ((mode mime::preview/original-major-mode) - (m (assq mode mime-viewer/code-converter-alist)) - ) - (if (and m (fboundp (setq m (cdr m)))) - (funcall m beg (point-max) charset encoding) - (mime-viewer/default-code-convert-region beg (point-max) - charset encoding) - ))) + (mime-preview/decode-text-region beg end charset encoding) + ) (goto-char (point-max)) (if (not (eq (char-after (1- (point))) ?\n)) (insert "\n") ) (if browse-url-browser-function - (save-excursion + (progn (goto-char (point-min)) (while (re-search-forward tm:URL-regexp nil t) (tm:add-button (match-beginning 0)(match-end 0) @@ -652,12 +704,65 @@ The compressed face will be piped to this command.") "q" (function mime-viewer/quit)) (define-key mime/viewer-mode-map "\C-c\C-x" (function mime-viewer/kill-buffer)) + (define-key mime/viewer-mode-map + "<" (function beginning-of-buffer)) + (define-key mime/viewer-mode-map + ">" (function end-of-buffer)) (if mouse-button-2 (define-key mime/viewer-mode-map mouse-button-2 (function tm:button-dispatcher)) ) + (if mouse-button-3 + (define-key mime/viewer-mode-map + mouse-button-3 (function mime-viewer/popup-menu)) + ) )) +(defvar mime-viewer/popup-menu-title "MIME Viewer Commands") +(defvar mime-viewer/popup-menu-items + '(("Move to upper content" . mime-viewer/up-content) + ("Move to previous content" . mime-viewer/previous-content) + ("Move to next content" . mime-viewer/next-content) + ("Scroll to previous content" . mime-viewer/scroll-down-content) + ("Scroll to next content" . mime-viewer/scroll-up-content) + ("Play Content" . mime-viewer/play-content) + ("Extract Content" . mime-viewer/extract-content) + ("Print" . mime-viewer/print-content) + ("Show X Face" . mime-viewer/display-x-face) + ) + "Popup Menu for MIME Viewer") + +(cond ((string-match "XEmacs\\|Lucid" emacs-version) + (defvar mime-viewer/popup-menu + (cons mime-viewer/popup-menu-title + (mapcar (function + (lambda (item) + (vector (car item)(cdr item) t) + )) + mime-viewer/popup-menu-items))) + (defun mime-viewer/popup-menu (event) + "Popup the menu in the MIME Viewer buffer" + (interactive "e") + (select-window (event-window event)) + (set-buffer (event-buffer event)) + (popup-menu 'mime-viewer/popup-menu)) + ) + ((>= emacs-major-version 19) + (defun mime-viewer/popup-menu (event) + (interactive "e") + (mouse-set-point event) + (let ((menu + (cons mime-viewer/popup-menu-title + (list (cons "Menu Items" mime-viewer/popup-menu-items)) + ))) + (let ((func (x-popup-menu event menu))) + (if func + (funcall func) + )) + )) + )) + + (defun mime/viewer-mode (&optional mother ctl encoding ibuf obuf) "Major mode for viewing MIME message. @@ -689,31 +794,23 @@ listed in key order: \\{mime/viewer-mode-map} " (interactive) - (setq mime-viewer/ignored-field-regexp - (concat "^\\(" - (mapconcat (function regexp-quote) - mime-viewer/ignored-field-list "\\|") - "\\):")) (let ((buf (get-buffer mime/output-buffer-name))) (if buf (save-excursion (set-buffer buf) (erase-buffer) ))) - (let ((ret (mime-viewer/setup-buffer ctl encoding ibuf obuf))) + (let ((ret (mime-viewer/setup-buffer ctl encoding ibuf obuf)) + (win-conf (current-window-configuration)) + ) (prog1 (switch-to-buffer (car ret)) + (setq mime::preview/original-window-configuration win-conf) (if mother (progn - (make-variable-buffer-local - 'mime/show-mode-old-window-configuration) - (setq mime/show-mode-old-window-configuration - (current-window-configuration)) - (make-variable-buffer-local 'mime/mother-buffer) - (setq mime/mother-buffer mother) + (setq mime::preview/mother-buffer mother) )) (use-local-map mime/viewer-mode-map) - (make-variable-buffer-local 'mime::preview/content-list) (setq mime::preview/content-list (nth 1 ret)) (goto-char (let ((ce (mime::preview-content-info/point-max @@ -731,7 +828,7 @@ listed in key order: (defun mime-preview/point-content-number (point) (save-window-excursion - (let ((pc (mime::point-preview-content (point))) + (let ((pc (mime-preview/point-pcinfo (point))) cinfo) (switch-to-buffer (mime::preview-content-info/buffer pc)) (setq cinfo (mime::preview-content-info/content-info pc)) @@ -780,18 +877,17 @@ listed in key order: (defun mime-viewer/up-content () (interactive) - (let ((pc (mime::point-preview-content (point))) cinfo + (let ((pc (mime-preview/point-pcinfo (point))) cinfo (the-buf (current-buffer)) - cn r) + rcnum r) (switch-to-buffer (mime::preview-content-info/buffer pc)) (setq cinfo (mime::preview-content-info/content-info pc)) - (setq cn (mime-article/point-content-number - (mime::content-info/point-min cinfo))) - (if (eq cn t) + (setq rcnum (mime::content-info/rcnum cinfo)) + (if (null rcnum) (mime-viewer/quit the-buf (mime::preview-content-info/buffer pc) ) - (setq r (mime-article/cnum-to-cinfo (butlast cn))) + (setq r (mime-article/rcnum-to-cinfo (cdr rcnum))) (switch-to-buffer the-buf) (catch 'tag (let ((rpcl mime::preview/content-list) cell) @@ -819,7 +915,13 @@ listed in key order: (throw 'tag (goto-char beg)) ) (setq i (- i 1)) - )) + ) + (let ((f (assq mime::preview/original-major-mode + mime-viewer/over-to-previous-method-alist))) + (if f + (funcall (cdr f)) + )) + ) )) (defun mime-viewer/next-content () @@ -834,7 +936,13 @@ listed in key order: (throw 'tag (goto-char beg)) ) (setq pcl (cdr pcl)) - )) + ) + (let ((f (assq mime::preview/original-major-mode + mime-viewer/over-to-next-method-alist))) + (if f + (funcall (cdr f)) + )) + ) )) (defun mime-viewer/scroll-up-content (&optional h) @@ -842,50 +950,64 @@ listed in key order: (or h (setq h (- (window-height) 1)) ) - (let ((pcl mime::preview/content-list) - (p (point)) - np beg) - (setq np - (or (catch 'tag - (while pcl - (setq beg (mime::preview-content-info/point-min (car pcl))) - (if (< p beg) - (throw 'tag beg) - ) - (setq pcl (cdr pcl)) - )) - (point-max))) - (forward-line h) - (if (> (point) np) - (goto-char np) - ) - ;;(show-subtree) - )) + (if (= (point) (point-max)) + (let ((f (assq mime::preview/original-major-mode + mime-viewer/over-to-next-method-alist))) + (if f + (funcall (cdr f)) + )) + (let ((pcl mime::preview/content-list) + (p (point)) + np beg) + (setq np + (or (catch 'tag + (while pcl + (setq beg (mime::preview-content-info/point-min (car pcl))) + (if (< p beg) + (throw 'tag beg) + ) + (setq pcl (cdr pcl)) + )) + (point-max))) + (forward-line h) + (if (> (point) np) + (goto-char np) + ) + ;;(show-subtree) + )) + ) (defun mime-viewer/scroll-down-content (&optional h) (interactive) (or h (setq h (- (window-height) 1)) ) - (let ((pcl mime::preview/content-list) - (p (point)) - pp beg) - (setq pp - (or (let ((i (- (length pcl) 1))) - (catch 'tag - (while (> i 0) - (setq beg (mime::preview-content-info/point-min - (nth i pcl))) - (if (> p beg) - (throw 'tag beg) - ) - (setq i (- i 1)) - ))) - (point-min))) - (forward-line (- h)) - (if (< (point) pp) - (goto-char pp) - ))) + (if (= (point) (point-min)) + (let ((f (assq mime::preview/original-major-mode + mime-viewer/over-to-previous-method-alist))) + (if f + (funcall (cdr f)) + )) + (let ((pcl mime::preview/content-list) + (p (point)) + pp beg) + (setq pp + (or (let ((i (- (length pcl) 1))) + (catch 'tag + (while (> i 0) + (setq beg (mime::preview-content-info/point-min + (nth i pcl))) + (if (> p beg) + (throw 'tag beg) + ) + (setq i (- i 1)) + ))) + (point-min))) + (forward-line (- h)) + (if (< (point) pp) + (goto-char pp) + ))) + ) (defun mime-viewer/next-line-content () (interactive) @@ -904,11 +1026,11 @@ listed in key order: ) (or buf (setq buf (mime::preview-content-info/buffer - (mime::point-preview-content (point)))) + (mime-preview/point-pcinfo (point)))) ) (let ((r (progn (switch-to-buffer buf) - (assoc major-mode mime-viewer/quitting-method-alist) + (assq major-mode mime-viewer/quitting-method-alist) ))) (if r (progn