From: morioka Date: Wed, 15 Apr 1998 10:06:55 +0000 (+0000) Subject: Sync up with SEMI 1.2.3 (Tanihama). X-Git-Tag: wemi-1_2_3~5 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aeae8c3d6fe6945a720d64be02e9c1e96818f36;p=elisp%2Fsemi.git Sync up with SEMI 1.2.3 (Tanihama). --- diff --git a/mime-view.el b/mime-view.el index e9140e3..caa409d 100644 --- a/mime-view.el +++ b/mime-view.el @@ -387,6 +387,14 @@ Each elements are regexp of field-name.") (body . visible))) (ctree-set-calist-strictly + 'mime-preview-condition '((type . message)(subtype . rfc822) + (childrens-situation (header . visible)))) + +(ctree-set-calist-strictly + 'mime-preview-condition '((type . message)(subtype . news) + (childrens-situation (header . visible)))) + +(ctree-set-calist-strictly 'mime-preview-condition '((body . visible) (body-presentation-method . with-filter) (body-filter . mime-preview-filter-for-text/plain))) @@ -422,15 +430,6 @@ Each elements are regexp of field-name.") (body-presentation-method . mime-view-insert-message/partial-button))) -(defun mime-view-body-visible-p (entity message-info) - "Return non-nil if body of ENTITY is visible." - (ctree-match-calist mime-preview-condition - (list* (cons 'type (mime-entity-media-type entity)) - (cons 'subtype (mime-entity-media-subtype entity)) - (cons 'encoding (mime-entity-encoding entity)) - (cons 'major-mode major-mode) - (mime-entity-parameters entity)))) - ;;; @@@ entity filter ;;; @@ -482,15 +481,6 @@ Please press `v' key in this buffer. " )) -;;; @@ entity separator -;;; - -(defun mime-view-entity-separator-visible-p (entity message-info) - "Return non-nil if separator is needed for ENTITY." - (and (not (mime-view-header-visible-p entity message-info)) - (not (mime-view-body-visible-p entity message-info)))) - - ;;; @ acting-condition ;;; @@ -725,19 +715,22 @@ The compressed face will be piped to this command.") (goto-char (point-max)) (mime-view-insert-entity-button message-info message-info subj) )) - ) - (setq ne (point-max)) - (widen) - (put-text-property nb ne 'mime-view-raw-buffer ibuf) - (put-text-property nb ne 'mime-view-entity message-info) - (goto-char ne) - (let ((children (mime-entity-children message-info))) - (while children - (mime-view-display-entity (car children) message-info ibuf obuf) - (setq children (cdr children)) - )))) - -(defun mime-view-display-entity (entity message-info ibuf obuf) + (setq ne (point-max)) + (widen) + (put-text-property nb ne 'mime-view-raw-buffer ibuf) + (put-text-property nb ne 'mime-view-entity message-info) + (goto-char ne) + (let ((children (mime-entity-children message-info)) + (default-situation + (cdr (assq 'childrens-situation situation)))) + (while children + (mime-view-display-entity (car children) message-info ibuf obuf + default-situation) + (setq children (cdr children)) + ))))) + +(defun mime-view-display-entity (entity message-info ibuf obuf + default-situation) (let* ((start (mime-entity-point-min entity)) (end (mime-entity-point-max entity)) (media-type (mime-entity-media-type entity)) @@ -765,27 +758,30 @@ The compressed face will be piped to this command.") (if (mime-view-entity-button-visible-p entity message-info) (mime-view-insert-entity-button entity message-info subj) ) - (if (mime-view-header-visible-p entity message-info) - (save-restriction - (narrow-to-region (point)(point)) - (insert-buffer-substring mime-raw-buffer start end-of-header) - (let ((f (cdr (assq mime-preview-original-major-mode - mime-view-content-header-filter-alist)))) - (if (functionp f) - (funcall f) - (mime-view-default-content-header-filter) - )) - (run-hooks 'mime-view-content-header-filter-hook) - )) (let* ((situation (ctree-match-calist mime-preview-condition (list* (cons 'type media-type) (cons 'subtype media-subtype) (cons 'encoding encoding) (cons 'major-mode major-mode) - params))) + (append params + default-situation)))) + (header-is-visible + (cdr (assq 'header situation))) (body-presentation-method (cdr (assq 'body-presentation-method situation)))) + (if header-is-visible + (save-restriction + (narrow-to-region (point)(point)) + (insert-buffer-substring mime-raw-buffer start end-of-header) + (let ((f (cdr (assq mime-preview-original-major-mode + mime-view-content-header-filter-alist)))) + (if (functionp f) + (funcall f) + (mime-view-default-content-header-filter) + )) + (run-hooks 'mime-view-content-header-filter-hook) + )) (cond ((eq body-presentation-method 'with-filter) (let ((body-filter (cdr (assq 'body-filter situation)))) (save-restriction @@ -796,20 +792,25 @@ The compressed face will be piped to this command.") ((functionp body-presentation-method) (funcall body-presentation-method situation) )) - (when (mime-view-entity-separator-visible-p entity message-info) - (goto-char (point-max)) - (insert "\n")) - ) - (setq ne (point-max)) - (widen) - (put-text-property nb ne 'mime-view-raw-buffer ibuf) - (put-text-property nb ne 'mime-view-entity entity) - (goto-char ne) - (let ((children (mime-entity-children entity))) - (while children - (mime-view-display-entity (car children) message-info ibuf obuf) - (setq children (cdr children)) - )))) + (or header-is-visible + body-presentation-method + (progn + (goto-char (point-max)) + (insert "\n") + )) + (setq ne (point-max)) + (widen) + (put-text-property nb ne 'mime-view-raw-buffer ibuf) + (put-text-property nb ne 'mime-view-entity entity) + (goto-char ne) + (let ((children (mime-entity-children entity)) + (default-situation + (cdr (assq 'childrens-situation situation)))) + (while children + (mime-view-display-entity (car children) message-info ibuf obuf + default-situation) + (setq children (cdr children)) + ))))) (defun mime-raw-get-uu-filename (param &optional encoding) (if (member (or encoding