(mime-preview-condition): Delete (message-button . visible) to
[elisp/semi.git] / mime-view.el
index a5de61e..3a73c4e 100644 (file)
@@ -186,9 +186,6 @@ If optional argument MESSAGE-INFO is not specified,
 ;;; @@@ predicate function
 ;;;
 
-(defvar mime-view-content-button-visible-ctype-list
-  '("application/pgp"))
-
 (defun mime-view-entity-button-visible-p (entity message-info)
   "Return non-nil if header of ENTITY is visible.
 Please redefine this function if you want to change default setting."
@@ -650,11 +647,6 @@ The compressed face will be piped to this command.")
         (end (mime-entity-point-max message-info))
         (media-type (mime-entity-media-type message-info))
         (media-subtype (mime-entity-media-subtype message-info))
-        (ctype (if media-type
-                   (if media-subtype
-                       (format "%s/%s" media-type media-subtype)
-                     (symbol-name media-type)
-                     )))
         (params (mime-entity-parameters message-info))
         (encoding (mime-entity-encoding message-info))
         end-of-header e nb ne subj)
@@ -687,11 +679,6 @@ The compressed face will be piped to this command.")
          ))
       (run-hooks 'mime-view-content-header-filter-hook)
       )
-    (if (member ctype mime-view-content-button-visible-ctype-list)
-       (save-excursion
-         (goto-char (point-max))
-         (mime-view-insert-entity-button message-info message-info subj)
-         ))
     (let* ((situation
            (ctree-match-calist mime-preview-condition
                                (list* (cons 'type       media-type)
@@ -699,8 +686,14 @@ The compressed face will be piped to this command.")
                                       (cons 'encoding   encoding)
                                       (cons 'major-mode major-mode)
                                       params)))
+          (message-button
+           (cdr (assq 'message-button situation)))
           (body-presentation-method
            (cdr (assq 'body-presentation-method situation))))
+      (when message-button
+       (goto-char (point-max))
+       (mime-view-insert-entity-button message-info message-info subj)
+       )
       (cond ((eq body-presentation-method 'with-filter)
             (let ((body-filter (cdr (assq 'body-filter situation))))
               (save-restriction
@@ -732,11 +725,6 @@ The compressed face will be piped to this command.")
         (end (mime-entity-point-max entity))
         (media-type (mime-entity-media-type entity))
         (media-subtype (mime-entity-media-subtype entity))
-        (ctype (if media-type
-                   (if media-subtype
-                       (format "%s/%s" media-type media-subtype)
-                     (symbol-name media-type)
-                     )))
         (params (mime-entity-parameters entity))
         (encoding (mime-entity-encoding entity))
         end-of-header e nb ne subj)