(mime-edit-insert-user-agent-field): New variable (abolish
authormorioka <morioka>
Fri, 11 Sep 1998 23:51:48 +0000 (23:51 +0000)
committermorioka <morioka>
Fri, 11 Sep 1998 23:51:48 +0000 (23:51 +0000)
`mime-edit-insert-x-emacs-field').
(mime-edit-user-agent-value): New variable (abolish
`mime-edit-x-emacs-value').
(mime-edit-translate-body): Insert User-Agent field instead of
`X-Emacs' field.
(mime-edit-again-ignored-field-regexp): Add `User-Agent' instead of
`X-Emacs' field conditionally.

mime-edit.el

index 94ea968..c146f4f 100644 (file)
@@ -568,30 +568,54 @@ If it is not specified for a major-mode,
 ;;; @@ optional header fields
 ;;;
 
-(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)
-         (if (boundp 'enable-multibyte-characters)
-             (concat "Emacs " ver
-                     (if enable-multibyte-characters
-                         (concat ", MULE " mule-version)
-                       " (with raw setting)")
-                     (if (featurep 'meadow)
-                         (concat ", " (Meadow-version))
-                       ))
-           (concat "MULE " mule-version " based on Emacs " ver))
-       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 (car mime-user-interface-version)
+         "/"
+         (mapconcat #'number-to-string
+                    (cddr mime-user-interface-version) ".")
+         " ("
+         (cadr mime-user-interface-version)
+         ") "
+         (car mime-library-version)
+         "/"
+         (mapconcat #'number-to-string
+                    (cddr mime-library-version) ".")
+         " ("
+         (cadr mime-library-version)
+         ") "
+         (if (featurep 'xemacs)
+             (concat "XEmacs"
+                     (if (string-match "\\s +\\\"" emacs-version)
+                         (concat "/"
+                                 (substring emacs-version 0
+                                            (match-beginning 0))
+                                 " (" xemacs-codename ")")
+                       " (" emacs-version ")")
+                     (if (featurep 'mule) " MULE"))
+           (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
+                             (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 ")"))
+               ver))))
+  "Body of User-Agent field.
+If variable `mime-edit-insert-user-agent-field' is not nil, it is
 inserted into message header.")
 
 \f
@@ -1854,10 +1878,10 @@ Content-Transfer-Encoding: 7bit
       (let ((contype (car ret))                ;Content-Type
            (encoding (nth 1 ret))      ;Content-Transfer-Encoding
            )
-       ;; Insert X-Emacs field
-       (and mime-edit-insert-x-emacs-field
-            (or (mail-position-on-field "X-Emacs")
-                (insert mime-edit-x-emacs-value)
+       ;; Insert User-Agent field
+       (and mime-edit-insert-user-agent-field
+            (or (mail-position-on-field "User-Agent")
+                (insert mime-edit-user-agent-value)
                 ))
        ;; Make primary MIME headers.
        (or (mail-position-on-field "MIME-Version")
@@ -2509,7 +2533,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
 
 (defvar mime-edit-again-ignored-field-regexp
   (concat "^\\(" "Content-.*\\|Mime-Version"
-         (if mime-edit-insert-x-emacs-field "\\|X-Emacs")
+         (if mime-edit-insert-user-agent-field "\\|User-Agent")
          "\\):")
   "Regexp for deleted header fields when `mime-edit-again' is called.")