From e1e7d46f1c945363b644d103dd37ad4cc03e70a8 Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 5 Sep 1997 16:07:25 +0000 Subject: [PATCH] (mime-view-body-visible-p): Change interface to use `media-type' and `media-subtype' instead of `ctype'. (mime-view-entity-separator-function): ditto. --- mime-view.el | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/mime-view.el b/mime-view.el index da0cfe4..8ecb44c 100644 --- a/mime-view.el +++ b/mime-view.el @@ -6,7 +6,7 @@ ;; Created: 1994/7/13 ;; Renamed: 1994/8/31 from tm-body.el ;; Renamed: 1997/02/19 from tm-view.el -;; Version: $Revision: 0.110 $ +;; Version: $Revision: 0.111 $ ;; Keywords: MIME, multimedia, mail, news ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). @@ -40,7 +40,7 @@ ;;; (defconst mime-view-RCS-ID - "$Id: mime-view.el,v 0.110 1997-09-05 12:56:51 morioka Exp $") + "$Id: mime-view.el,v 0.111 1997-09-05 16:07:25 morioka Exp $") (defconst mime-view-version `,(get-version-string mime-view-RCS-ID)) @@ -209,20 +209,16 @@ Each elements are regexp of field-name.") mime-view-childrens-header-showing-Content-Type-list) )) -(defun mime-view-body-visible-p (rcnum cinfo &optional ctype) - (let (ccinfo) - (or ctype - (setq ctype - (mime-entity-info-type/subtype - (setq ccinfo (mime-article/rcnum-to-cinfo rcnum cinfo)) - )) - ) +(defun mime-view-body-visible-p (rcnum cinfo media-type media-subtype) + (let ((ctype (if media-type + (if media-subtype + (format "%s/%s" media-type media-subtype) + (symbol-name media-type) + )))) (and (member ctype mime-view-visible-media-type-list) - (if (string-equal ctype "application/octet-stream") - (progn - (or ccinfo - (setq ccinfo (mime-article/rcnum-to-cinfo rcnum cinfo)) - ) + (if (and (eq media-type 'application) + (eq media-subtype 'octet-stream)) + (let ((ccinfo (mime-article/rcnum-to-cinfo rcnum cinfo))) (member (mime-entity-info-encoding ccinfo) '(nil "7bit" "8bit")) ) @@ -341,11 +337,13 @@ function. t means default media-type.") ;;; @@ entity separator ;;; -(defun mime-view-entity-separator-function (rcnum cinfo ctype params subj) +(defun mime-view-entity-separator-function (rcnum cinfo + media-type media-subtype + params subj) "Insert entity separator conditionally. Please redefine this function if you want to change default setting." (or (mime-view-header-visible-p rcnum cinfo) - (mime-view-body-visible-p rcnum cinfo ctype) + (mime-view-body-visible-p rcnum cinfo media-type media-subtype) (progn (goto-char (point-max)) (insert "\n") @@ -544,7 +542,7 @@ The compressed face will be piped to this command.") (mime-view-insert-entity-button rcnum cinfo ctype params subj encoding) )) - (cond ((mime-view-body-visible-p rcnum cinfo ctype) + (cond ((mime-view-body-visible-p rcnum cinfo media-type media-subtype) (mime-view-display-body he end rcnum cinfo ctype params subj encoding) ) @@ -558,7 +556,8 @@ The compressed face will be piped to this command.") (mime-view-insert-entity-button rcnum cinfo ctype params subj encoding) )) - (mime-view-entity-separator-function rcnum cinfo ctype params subj) + (mime-view-entity-separator-function + rcnum cinfo media-type media-subtype params subj) (setq ne (point-max)) (widen) (put-text-property nb ne 'mime-view-raw-buffer ibuf) -- 1.7.10.4