+2005-01-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * lisp/gnus.el (gnus-user-agent): Default to
+ `(emacs gnus mime config mule)'.
+
+ * lisp/gnus-vers.el (gnus-extended-version): Include SEMI, FLIM
+ and APEL versions.
+
+ * lisp/gnus-util.el (gnus-emacs-version): Include Mule and Meadow
+ versions.
+
+ * lisp/gnus-msg.el (gnus-message-make-user-agent): Invalidate
+ optional the 1st arg.
+
2005-01-02 Romain Francoise <romain@orebokech.com>
* GNUS-NEWS: Generated.
+2005-01-10 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus.el (gnus-user-agent): Use list of symbols instead of
+ symbols. Display full version number for (S)XEmacs. Optionally
+ display (S)XEmacs codename.
+
+ * gnus-util.el (gnus-emacs-version): Update for new
+ `gnus-user-agent'.
+
+ * gnus-msg.el (gnus-extended-version): Make it possible to omit
+ Gnus version.
+
2005-01-05 Reiner Steib <Reiner.Steib@gmx.de>
* spam.el (spam-face): New face. Don't use `gnus-splash-face'
(t gnus-select-method))))
\f
-;; Dummies to avoid byte-compile warning.
-(eval-when-compile
- (defvar xemacs-codename))
-
-(defun gnus-message-make-user-agent (&optional include-mime-info max-column
- newline-product)
- "Return a user-agent info. If INCLUDE-MIME-INFO is non-nil and the
-variable `mime-edit-user-agent-value' is bound, the value will be
-included in the return value, and `gnus-user-agent' is ignored. If
-MAX-COLUMN is specified, the return value will be folded up as it were
-filled. NEWLINE-PRODUCT specifies whether a newline should be
-inserted in front of each product-token. If the value is t or `hard',
-it works strictly. Otherwise, if it is non-nil (e.g. `soft'), it
-works semi-strictly.
-
-Here is an odd example, which inserts a User-Agent: header when you
-begin to compose a message:
-
-\(add-hook 'gnus-message-setup-hook
- (lambda nil
- (setq message-user-agent nil)
- (save-excursion
- (save-restriction
- (message-narrow-to-headers)
- (goto-char (point-max))
- (insert \"User-Agent: \"
- (gnus-message-make-user-agent t 76 'soft)
- \"\\n\")))))
-"
- (let ((gnus-v (gnus-extended-version))
- user-agent)
- (cond ((and include-mime-info
- (boundp 'mime-edit-user-agent-value))
- (setq user-agent (concat gnus-v " " mime-edit-user-agent-value)))
- ((eq gnus-user-agent 'gnus-mime-edit)
- (setq user-agent
- (if (boundp 'mime-edit-user-agent-value)
- (concat gnus-v " " mime-edit-user-agent-value)
- gnus-v)))
- (t
- (setq user-agent (if (stringp gnus-user-agent)
- gnus-user-agent
- (concat gnus-v
- (let ((emacs-v (gnus-emacs-version)))
- (when emacs-v
- (concat " " emacs-v))))))))
+(defun gnus-message-make-user-agent (&optional dummy max-column
+ newline-product)
+ "Return a user-agent info. If MAX-COLUMN is specified, the return
+value will be folded up as it were filled. NEWLINE-PRODUCT specifies
+whether a newline should be inserted in front of each product-token;
+if the value is t or `hard', it works strictly. Otherwise, if it is
+non-nil (e.g. `soft'), it works semi-strictly."
+ (let ((user-agent (gnus-extended-version)))
(when max-column
(unless (natnump max-column)
(setq max-column 76))
;;; gnus-util.el --- utility functions for Semi-gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
;; Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
(nconc (nreverse res) list1 list2))))
(eval-when-compile
- (defvar xemacs-codename))
+ (defvar xemacs-codename)
+ (defvar sxemacs-codename)
+ (defvar emacs-program-version)
+ (unless (featurep 'meadow)
+ (defalias 'Meadow-version 'ignore)))
(defun gnus-emacs-version ()
"Stringified Emacs version."
- (let ((system-v
- (cond
- ((eq gnus-user-agent 'emacs-gnus-config)
- system-configuration)
- ((eq gnus-user-agent 'emacs-gnus-type)
- (symbol-name system-type))
- (t nil))))
+ (let* ((lst (if (listp gnus-user-agent)
+ gnus-user-agent
+ '(gnus emacs type)))
+ (system-v (cond ((memq 'config lst)
+ system-configuration)
+ ((memq 'type lst)
+ (symbol-name system-type))
+ (t nil)))
+ (mule-v (when (and (memq 'mule lst)
+ (featurep 'mule))
+ (concat
+ " MULE"
+ (when (boundp 'mule-version)
+ (concat "/" (symbol-value 'mule-version)))
+ (when (featurep 'meadow)
+ (let ((mver (Meadow-version)))
+ (if (string-match "^Meadow-" mver)
+ (concat " Meadow/"
+ (substring mver (match-end 0)))))))))
+ codename emacsname)
+ (cond ((featurep 'sxemacs)
+ (setq emacsname "SXEmacs"
+ codename sxemacs-codename))
+ ((featurep 'xemacs)
+ (setq emacsname "XEmacs"
+ codename xemacs-codename))
+ (t
+ (setq emacsname "Emacs")))
(cond
- ((eq gnus-user-agent 'gnus)
+ ((not (memq 'emacs lst))
nil)
((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
+ ;; Emacs:
(concat "Emacs/" (match-string 1 emacs-version)
(if system-v
(concat " (" system-v ")")
- "")))
- ((string-match
- "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?"
- emacs-version)
- (concat
- (match-string 1 emacs-version)
- (format "/%d.%d" emacs-major-version emacs-minor-version)
- (if (match-beginning 3)
- (match-string 3 emacs-version)
- "")
- (if (boundp 'xemacs-codename)
- (concat
- " (" xemacs-codename
- (if system-v
- (concat ", " system-v ")")
- ")"))
- "")))
- (t emacs-version))))
+ "")
+ mule-v))
+ ((or (featurep 'sxemacs) (featurep 'xemacs))
+ ;; XEmacs or SXEmacs:
+ (concat emacsname "/" emacs-program-version
+ " ("
+ (when (and (memq 'codename lst)
+ codename)
+ (concat codename
+ (when system-v ", ")))
+ (when system-v system-v)
+ ")"
+ mule-v))
+ (t (concat emacs-version mule-v)))))
(defun gnus-rename-file (old-path new-path &optional trim)
"Rename OLD-PATH as NEW-PATH. If TRIM, recursively delete
;;; gnus-vers.el --- Declare gnus version
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+;; Free Software Foundation, Inc.
;; Author: Keiichi Suzuki <keiichi@nanap.org>
;; Katsumi Yamaoka <yamaoka@jpl.org>
(insert (message "%s" gnus-version))
(message "%s" gnus-version)))
+(eval-when-compile
+ (defvar mime-user-interface-product)
+ (require 'mime-def))
+
(defun gnus-extended-version ()
- "Stringified gnus version."
- (concat gnus-product-name "/" gnus-version-number
- " (based on "
- gnus-original-product-name " v" gnus-original-version-number ")"
- (if (zerop (string-to-number gnus-revision-number))
- ""
- (concat " (revision " gnus-revision-number ")"))))
+ "Stringified Gnus, Emacs, SEMI, FLIM and APEL versions.
+See the variable `gnus-user-agent'."
+ (if (stringp gnus-user-agent)
+ gnus-user-agent
+ ;; `gnus-user-agent' is a list:
+ (let* ((float-output-format nil)
+ (gnus-v (when (memq 'gnus gnus-user-agent)
+ (concat
+ gnus-product-name "/" gnus-version-number " ("
+ (unless (zerop (string-to-number gnus-revision-number))
+ (concat "r" gnus-revision-number ", "))
+ "based on " gnus-original-product-name
+ " v" gnus-original-version-number ")")))
+ (emacs-v (gnus-emacs-version))
+ (mime-v (when (memq 'mime gnus-user-agent)
+ (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)
+ ") " (apel-version)))))
+ (mapconcat 'identity (delq nil (list gnus-v mime-v emacs-v)) " "))))
;; gnus-vers.el ends here
;;; gnus.el --- a newsreader for GNU Emacs
;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996, 1997,
-;; 1998, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; 1998, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Lars Magne Ingebrigtsen <larsi@gnus.org>
(symbol :tag "Parameter")
(sexp :tag "Value")))))
-(defcustom gnus-user-agent 'gnus-mime-edit
+(defcustom gnus-user-agent '(emacs gnus mime config mule)
"Which information should be exposed in the User-Agent header.
-It can be one of the symbols `gnus' \(show only Gnus version\), `emacs-gnus'
-\(show only Emacs and Gnus versions\), `emacs-gnus-config' \(same as
-`emacs-gnus' plus system configuration\), `emacs-gnus-type' \(same as
-`emacs-gnus' plus system type\), `gnus-mime-edit' \(show Gnus version and
-MIME Edit User-Agent\) or a custom string. If you set it to a string,
-be sure to use a valid format, see RFC 2616."
+Can be a list of symbols or a string. Valid symbols are `gnus' (show
+Gnus version), `emacs' (show Emacs version) and `mime' (show SEMI,
+FLIM and APEL versions). In addition to the Emacs version, you can
+add `codename' (show (S)XEmacs codename), `mule' (show Mule version
+and also Meadow version if it exists) or either `config' (show system
+configuration) or `type' (show system type). If you set it to a
+string, be sure to use a valid format, see RFC 2616."
+
:version "21.4"
:group 'gnus-message
- :type '(choice
- (item :tag "Show Gnus version and MIME Edit User-Agent"
- gnus-mime-edit)
- (item :tag "Show Gnus and Emacs versions and system type"
- emacs-gnus-type)
- (item :tag "Show Gnus and Emacs versions and system configuration"
- emacs-gnus-config)
- (item :tag "Show Gnus and Emacs versions" emacs-gnus)
- (item :tag "Show only Gnus version" gnus)
- (string :tag "Other")))
+ :type '(choice (list (set :format "%v" :inline t
+ (const gnus :tag "Gnus version")
+ (const emacs :tag "Emacs version")
+ (choice :tag "system"
+ (const type :tag "system type")
+ (const config :tag "system configuration"))
+ (const codename :tag "Emacs codename")
+ (const mime :tag "SEMI and FLIM versions")
+ (const mule
+ :tag "Mule version (and Meadow version)")))
+ (string :format "%t:\n%v")))
+
+;; Convert old (< 2005-01-10) symbol type values:
+(when (symbolp gnus-user-agent)
+ (setq gnus-user-agent
+ (cond ((eq gnus-user-agent 'gnus-mime-edit)
+ '(emacs gnus mime config mule))
+ ((eq gnus-user-agent 'emacs-gnus-config)
+ '(emacs gnus config))
+ ((eq gnus-user-agent 'emacs-gnus-type)
+ '(emacs gnus type))
+ ((eq gnus-user-agent 'emacs-gnus)
+ '(emacs gnus))
+ ((eq gnus-user-agent 'gnus)
+ '(gnus))
+ (t gnus-user-agent)))
+ (gnus-message 1 "Converted `gnus-user-agent' to `%s'." gnus-user-agent)
+ (sit-for 1)
+ (if (get 'gnus-user-agent 'saved-value)
+ (customize-save-variable 'gnus-user-agent gnus-user-agent)
+ (gnus-message 1 "Edit your init file to make this change permanent.")
+ (sit-for 2)))
\f
;;; Internal variables