-(defvar mime-edit-insert-x-emacs-field t
- "*If non-nil, insert X-Emacs header field.")
-
-(defvar mime-edit-x-emacs-value
- (if (featurep 'xemacs)
- (concat emacs-version (if (featurep 'mule)
- " with mule"
- " without mule"))
- (let ((ver (if (string-match "\\.[0-9]+$" emacs-version)
- (substring emacs-version 0 (match-beginning 0))
- emacs-version)))
- (if (featurep 'mule)
- (concat "Emacs " ver
- (if enable-multibyte-characters
- (concat ", MULE " mule-version)
- " (with raw setting)")
- (if (featurep 'meadow)
- (concat ", " (Meadow-version))
- ))
- ver)))
- "Body of X-Emacs field.
-If variable `mime-edit-insert-x-emacs-field' is not nil, it is
+(defvar mime-edit-insert-user-agent-field t
+ "*If non-nil, insert User-Agent header field.")
+
+(defvar mime-edit-user-agent-value
+ (concat (mime-product-name mime-user-interface-product)
+ "/"
+ (mapconcat #'number-to-string
+ (mime-product-version mime-user-interface-product) ".")
+ " ("
+ (mime-product-code-name mime-user-interface-product)
+ ") "
+ (mime-product-name mime-library-product)
+ "/"
+ (mapconcat #'number-to-string
+ (mime-product-version mime-library-product) ".")
+ " ("
+ (mime-product-code-name mime-library-product)
+ ") "
+ (if (fboundp 'apel-version)
+ (concat (apel-version) " "))
+ (if (featurep 'xemacs)
+ (concat (cond ((featurep 'utf-2000)
+ (concat "UTF-2000-MULE/" utf-2000-version))
+ ((featurep 'mule) "MULE"))
+ " XEmacs"
+ (if (string-match "^[0-9]+\\(\\.[0-9]+\\)" emacs-version)
+ (concat
+ "/"
+ (substring emacs-version 0 (match-end 0))
+ (cond ((and (boundp 'xemacs-betaname)
+ xemacs-betaname)
+ ;; It does not exist in XEmacs
+ ;; versions prior to 20.3.
+ (concat " " xemacs-betaname))
+ ((and (boundp 'emacs-patch-level)
+ emacs-patch-level)
+ ;; It does not exist in FSF Emacs or in
+ ;; XEmacs versions earlier than 21.1.1.
+ (format " (patch %d)" emacs-patch-level))
+ (t ""))
+ " (" xemacs-codename ")"
+ ;; `xemacs-extra-name' has appeared in the
+ ;; development version of XEmacs 21.5-b8.
+ (if (and (boundp 'xemacs-extra-name)
+ (symbol-value 'xemacs-extra-name))
+ (concat " " (symbol-value 'xemacs-extra-name))
+ "")
+ " ("
+ system-configuration ")")
+ " (" emacs-version ")"))
+ (let ((ver (if (string-match "\\.[0-9]+$" emacs-version)
+ (substring emacs-version 0 (match-beginning 0))
+ emacs-version)))
+ (if (featurep 'mule)
+ (if (boundp 'enable-multibyte-characters)
+ (concat "Emacs/" ver
+ " (" system-configuration ")"
+ (if enable-multibyte-characters
+ (concat " MULE/" mule-version)
+ " (with unibyte mode)")
+ (if (featurep 'meadow)
+ (let ((mver (Meadow-version)))
+ (if (string-match "^Meadow-" mver)
+ (concat " Meadow/"
+ (substring mver
+ (match-end 0)))
+ ))))
+ (concat "MULE/" mule-version
+ " (based on Emacs " ver ")"))
+ (concat "Emacs/" ver " (" system-configuration ")")))))
+ "Body of User-Agent field.
+If variable `mime-edit-insert-user-agent-field' is not nil, it is