(mime-view-find-every-acting-situation): Change default value to 't.
[elisp/semi.git] / mime-view.el
index adba833..1b6b183 100644 (file)
            " (" (cadr mime-module-version) ")"))
 
 
+;;; @ variables
+;;;
+
+(defgroup mime-view nil
+  "MIME view mode"
+  :group 'mime)
+
+(defcustom mime-view-find-every-acting-situation t
+  "*Find every available acting-situation if non-nil."
+  :group 'mime-view
+  :type 'boolean)
+
+(defcustom mime-acting-situation-examples-file "~/.mime-example"
+  "*File name of example about acting-situation demonstrated by user."
+  :group 'mime-view
+  :type 'file)
+
+
 ;;; @ buffer local variables
 ;;;
 
@@ -486,65 +504,102 @@ if it is not nil.")
 ;;; @ acting-condition
 ;;;
 
-(defvar mime-acting-condition
-  '(((type . text)(subtype . plain)
-     (method "tm-plain" nil 'file "" 'encoding 'mode 'name)
-     (mode "play" "print")
-     )
-    ((type . text)(subtype . html)
-     (method "tm-html" nil 'file "" 'encoding 'mode 'name)
-     (mode . "play")
-     )
-    ((type . text)(subtype . x-rot13-47)
-     (method . mime-method-to-display-caesar)
-     (mode . "play")
-     )
-    ((type . text)(subtype . x-rot13-47-48)
-     (method . mime-method-to-display-caesar)
-     (mode . "play")
-     )
-
-    ((type . audio)(subtype . basic)
-     (method "tm-au"    nil 'file "" 'encoding 'mode 'name)
-     (mode . "play")
-     )
-    
-    ((type . image)
-     (method "tm-image" nil 'file "" 'encoding 'mode 'name)
-     (mode "play" "print")
-     )
-    
-    ((type . video)(subtype . mpeg)
-     (method "tm-mpeg"  nil 'file "" 'encoding 'mode 'name)
-     (mode . "play")
-     )
-    
-    ((type . application)(subtype . postscript)
-     (method "tm-ps" nil 'file "" 'encoding 'mode 'name)
-     (mode "play" "print")
-     )
-    ((type . application)(subtype . octet-stream)
-     (method . mime-method-to-save)(mode "play" "print")
-     )
-
-    ((type . message)(subtype . external-body)
-     ("access-type" . "anon-ftp")
-     (method . mime-method-to-display-message/external-ftp)
-     )
-    ((type . message)(subtype . rfc822)
-     (method . mime-method-to-display-message/rfc822)
-     (mode . "play")
-     )
-    ((type . message)(subtype . partial)
-     (method . mime-method-to-store-message/partial)
-     (mode . "play")
-     )
-    
-    ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)
-     (mode . "play")
-     )
-    ((method . mime-method-to-save)(mode . "extract"))
-    ))
+(defvar mime-acting-condition nil
+  "Condition-tree about how to process entity.")
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . t)(subtype . t)(mode . "play")
+   (method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)
+   ))
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . t)(subtype . t)(mode . "extract")
+   (method . mime-method-to-save)))
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . text)(subtype . plain)(mode . "play")
+   (method "tm-plain" nil 'file "" 'encoding 'mode 'name)
+   ))
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . text)(subtype . plain)(mode . "print")
+   (method "tm-plain" nil 'file "" 'encoding 'mode 'name)
+   ))
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . text)(subtype . html)(mode . "play")
+   (method "tm-html" nil 'file "" 'encoding 'mode 'name)
+   ))
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . text)(subtype . x-rot13-47)(mode . "play")
+   (method . mime-method-to-display-caesar)
+   ))
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . text)(subtype . x-rot13-47-48)(mode . "play")
+   (method . mime-method-to-display-caesar)
+   ))
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . audio)(subtype . basic)(mode . "play")
+   (method "tm-au" nil 'file "" 'encoding 'mode 'name)
+   ))
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . image)(mode . "play")
+   (method "tm-image" nil 'file "" 'encoding 'mode 'name)
+   ))
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . image)(mode . "print")
+   (method "tm-image" nil 'file "" 'encoding 'mode 'name)
+   ))
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . video)(subtype . mpeg)(mode . "play")
+   (method "tm-mpeg" nil 'file "" 'encoding 'mode 'name)
+   ))
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . application)(subtype . postscript)(mode . "play")
+   (method "tm-ps" nil 'file "" 'encoding 'mode 'name)
+   ))
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . application)(subtype . postscript)(mode . "print")
+   (method "tm-ps" nil 'file "" 'encoding 'mode 'name)
+   ))
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . message)(subtype . rfc822)(mode . "play")
+   (method . mime-method-to-display-message/rfc822)
+   ))
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . message)(subtype . partial)(mode . "play")
+   (method . mime-method-to-store-message/partial)
+   ))
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . message)(subtype . external-body)
+   ("access-type" . "anon-ftp")
+   (method . mime-method-to-display-message/external-ftp)
+   ))
+
+(ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((type . application)(subtype . octet-stream)
+   (method . mime-method-to-save)
+   ))
 
 
 ;;; @ quitting method
@@ -1074,8 +1129,7 @@ of the mother-buffer."
 It calls following-method selected from variable
 `mime-view-following-method-alist'."
   (interactive)
-  (let ((message-info (get-text-property (point-min) 'mime-view-entity))
-       entity)
+  (let (entity)
     (while (null (setq entity
                       (get-text-property (point) 'mime-view-entity)))
       (backward-char)
@@ -1138,16 +1192,7 @@ It calls following-method selected from variable
          (erase-buffer)
          (insert-buffer-substring the-buf p-beg p-end)
          (goto-char (point-min))
-          ;; (if (mime-view-header-visible-p entity message-info)
-          ;;     (delete-region (goto-char (point-min))
-          ;;                    (if (re-search-forward "^$" nil t)
-          ;;                        (match-end 0)
-          ;;                      (point-min)))
-          ;;   )
-         ;;(goto-char (point-min))
-         ;;(insert "\n")
-         (goto-char (point-min))
-         (let ((entity-node-id (mime-entity-node-id entity)) ci str)
+          (let ((entity-node-id (mime-entity-node-id entity)) ci str)
            (while (progn
                     (setq
                      str