;;;
(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
)
"*Alist of content-type, subtype, parameters and its values.")
-(defvar mime-file-types
- '(("\\.rtf$"
+(defcustom mime-file-types
+ '(("\\.txt$"
+ "text" "plain" nil
+ nil
+ "inline" (("filename" . file))
+ )
+ ("\\.pln$"
+ "text" "plain" nil
+ nil
+ "inline" (("filename" . file))
+ )
+ ("\\.rtf$"
"text" "richtext" nil
nil
nil nil)
"attachment" (("filename" . file))
)
("\\.signature"
- "text" "plain" nil nil)
+ "text" "plain" nil nil nil nil)
(".*"
"application" "octet-stream" nil
nil
- "attachment" (("filename" . file))
- )
+ "attachment" (("filename" . file)))
)
"*Alist of file name, types, parameters, and default encoding.
-If encoding is nil, it is determined from its contents.")
+If encoding is nil, it is determined from its contents."
+ :type `(repeat
+ (list regexp
+ ;; primary-type
+ (choice :tag "Primary-Type"
+ ,@(nconc (mapcar (lambda (cell)
+ (list 'item (car cell))
+ )
+ mime-content-types)
+ '(string)))
+ ;; subtype
+ (choice :tag "Sub-Type"
+ ,@(nconc
+ (apply #'nconc
+ (mapcar (lambda (cell)
+ (mapcar (lambda (cell)
+ (list 'item (car cell))
+ )
+ (cdr cell)))
+ mime-content-types))
+ '(string)))
+ ;; parameters
+ (repeat :tag "Parameters of Content-Type field"
+ (cons string (choice string symbol)))
+ ;; content-transfer-encoding
+ (choice :tag "Encoding"
+ ,@(cons
+ '(const nil)
+ (mapcar (lambda (cell)
+ (list 'item (car cell))
+ )
+ mime-file-encoding-method-alist)))
+ ;; disposition-type
+ (choice :tag "Disposition-Type"
+ (item nil)
+ (item "inline")
+ (item "attachment")
+ string)
+ ;; parameters
+ (repeat :tag "Parameters of Content-Disposition field"
+ (cons string (choice string symbol)))
+ ))
+ :group 'mime-edit)
;;; @@ about charset, encoding and transfer-level
(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."
(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)
"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