update.
[elisp/semi.git] / mime-edit.el
index 2b6c125..c4f69d2 100644 (file)
 ;;;
 
 (defconst mime-edit-version-string
-  `,(concat "SEMI "
-           (mapconcat #'number-to-string (cdr semi-version) ".")
-           " - \"" (car semi-version) "\""))
+  `,(concat (car mime-module-version) " "
+           (mapconcat #'number-to-string (cddr mime-module-version) ".")
+           " - \"" (cadr mime-module-version) "\""))
 
 
 ;;; @ variables
@@ -1011,26 +1011,27 @@ just return to previous mode."
     (princ (documentation 'mime-edit-mode))
     (print-help-return-message)))
 
-(defun mime-edit-insert-text ()
+(defun mime-edit-insert-text (&optional subtype)
   "Insert a text message.
-Charset is automatically obtained from the `charsets-mime-charset-alist'."
+Charset is automatically obtained from the `charsets-mime-charset-alist'.
+If optional argument SUBTYPE is not nil, text/SUBTYPE tag is inserted."
   (interactive)
-  (let ((ret (mime-edit-insert-tag "text" nil nil)))
-  (if ret
-      (progn
-       (if (looking-at mime-edit-single-part-tag-regexp)
-           (progn
-             ;; Make a space between the following message.
-             (insert "\n")
-             (forward-char -1)
-             ))
-       (if (and (member (cadr ret) '("enriched" "richtext"))
-                (fboundp 'enriched-mode)
-                )
-           (enriched-mode t)
-         (if (boundp 'enriched-mode)
-             (enriched-mode -1)
-           ))))))
+  (let ((ret (mime-edit-insert-tag "text" subtype nil)))
+    (when ret
+      (if (looking-at mime-edit-single-part-tag-regexp)
+         (progn
+           ;; Make a space between the following message.
+           (insert "\n")
+           (forward-char -1)
+           ))
+      (if (and (member (cadr ret) '("enriched" "richtext"))
+              (fboundp 'enriched-mode)
+              )
+         (enriched-mode t)
+       (if (boundp 'enriched-mode)
+           (enriched-mode -1)
+         ))
+      )))
 
 (defun mime-edit-insert-file (file &optional verbose)
   "Insert a message from a file."
@@ -1131,8 +1132,9 @@ Charset is automatically obtained from the `charsets-mime-charset-alist'."
   (let ((signature-insert-hook
          (function
           (lambda ()
-            (apply (function mime-edit-insert-tag)
-                   (mime-find-file-type signature-file-name))
+           (let ((items (mime-find-file-type signature-file-name)))
+             (apply (function mime-edit-insert-tag)
+                    (car items) (cadr items) (list (caddr items))))
             )))
         )
     (insert-signature arg)
@@ -2531,17 +2533,16 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
   "Quitting method for mime-view."
   (let ((temp mime-raw-buffer)
        buf)
-    (mime-view-kill-buffer)
+    (mime-preview-kill-buffer)
     (set-buffer temp)
     (setq buf mime-edit-buffer)
     (kill-buffer temp)
     (switch-to-buffer buf)
     ))
 
-(set-alist 'mime-view-quitting-method-alist
+(set-alist 'mime-preview-quitting-method-alist
           'mime-temp-message-mode
-          (function mime-edit-quitting-method)
-          )
+          #'mime-edit-quitting-method)
 
 
 ;;; @ edit again