From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/59547 Path: main.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: Using versions instead of XEmacs codenames in User-Agent Date: Sun, 09 Jan 2005 21:55:02 +0100 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: References: Reply-To: Reiner Steib NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1105305415 24937 80.91.229.6 (9 Jan 2005 21:16:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 Jan 2005 21:16:55 +0000 (UTC) Original-X-From: ding-owner+M8087@lists.math.uh.edu Sun Jan 09 22:16:48 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CnkQa-00054V-00 for ; Sun, 09 Jan 2005 22:16:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1CnkN5-0004j9-00; Sun, 09 Jan 2005 15:13:11 -0600 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1CnkMz-0004j4-00 for ding@lists.math.uh.edu; Sun, 09 Jan 2005 15:13:05 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1CnkMq-0008OS-0V for ding@lists.math.uh.edu; Sun, 09 Jan 2005 15:12:56 -0600 Original-Received: from main.gmane.org ([80.91.224.249]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1CnkMo-0004Tp-00 for ; Sun, 09 Jan 2005 22:12:54 +0100 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CnkMo-0005Hs-00 for ; Sun, 09 Jan 2005 22:12:54 +0100 Original-Received: from bridgekeeper.physik.uni-ulm.de ([134.60.10.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Jan 2005 22:12:54 +0100 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Jan 2005 22:12:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 294 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: 'bg&jY[8V'W&:=~6w"|>}#4/T;w~36ei4NNMyKRR.a$n=$|sWFPF1y]a\>6kc\*#GN]UDM| Ywv,vbL^XF1nIp\:F=$Ei2o&mEe:%N~,:3]vtQ~s9u$9izmX$IF@VgGl7/,^dbuM<3|AO2}.%|%?kZ 2Y=@\U!~cll^=8Z9ihKq%wmUe1Ky(#kl3T'>Qk0Ia3mCBsTk?E(,X Mail-Copies-To: nobody User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (i686-pc-linux-gnu) Cancel-Lock: sha1:fGw6Z6Z56rMt5sbjp0YKYvu/Av8= Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: main.gmane.org gmane.emacs.gnus.general:59547 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:59547 --=-=-= On Sun, Jan 09 2005, Steve Youngs wrote: > The default settings should give a User-Agent header similar to the > one in this message's headers. | User-Agent: Gnus/5.110003 (No Gnus v0.3) SXEmacs/22.1.1 "Aston Martin" (linux) Is a quoted string like "Aston Martin" allowed in RFC 2616? Upto now, we had it inside the bracket: | [...] XEmacs/21.4 (Security Through Obscurity, berkeley-unix) [...] > + * gnus.el (gnus-user-agent-display-codename): New. When non-nil > + and a (S)XEmacs codename exists, display it in the User-Agent > + header. I'd prefer not to introduce another variable. We already have `gnus-user-agent' for this. It is confusing to have several variables for the same thing. How about making `gnus-user-agent' a list? ,----[ C-h v gnus-user-agent RET ] | gnus-user-agent's value is (gnus emacs type) | | Which information should be exposed in the User-Agent header. | | Can be a list of symbols or a string. Valid symbols are `gnus' | (show Gnus version) and `emacs' (show Emacs version). In | addition to the Emacs version, you can add `codename' (show | (S)XEmacs codename) 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. `---- With a customize buffer like for the list: ,---- | [X] gnus | [X] emacs | [X] system: Value Menu type | [ ] codename `---- Changes: * 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. See the attached patch for details. > (eval-when-compile > - (defvar xemacs-codename)) > + (defvar xemacs-codename) > + (defvar sxemacs-codename) > + (defvar running-xemacs) > + (defvar running-sxemacs)) Is there any benefit of using `running-[s]xemacs' instead of (featurep '[s]xemacs)? Bye, Reiner. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=rs-User-Agent-02.patch Content-Description: gnus-user-agent: list Index: gnus-msg.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-msg.el,v retrieving revision 7.28 diff -u -r7.28 gnus-msg.el --- gnus-msg.el 7 Nov 2004 23:56:10 -0000 7.28 +++ gnus-msg.el 9 Jan 2005 20:33:32 -0000 @@ -1,6 +1,6 @@ ;;; gnus-msg.el --- mail and post interface for Gnus -;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -;; Free Software Foundation, Inc. +;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +;; 2005 Free Software Foundation, Inc. ;; Author: Masanobu UMEDA ;; Lars Magne Ingebrigtsen @@ -1039,17 +1039,18 @@ "Stringified Gnus version and Emacs version. See the variable `gnus-user-agent'." (interactive) - (let* ((float-output-format nil) - (gnus-v - (concat "Gnus/" - (prin1-to-string (gnus-continuum-version gnus-version) t) - " (" gnus-version ")")) - (emacs-v (gnus-emacs-version))) - (if (stringp gnus-user-agent) - gnus-user-agent - (concat gnus-v - (when emacs-v - (concat " " emacs-v)))))) + (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/" + (prin1-to-string (gnus-continuum-version gnus-version) t) + " (" gnus-version ")"))) + (emacs-v (gnus-emacs-version))) + (concat gnus-v (when (and gnus-v emacs-v) " ") + emacs-v)))) ;;; Index: gnus-util.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-util.el,v retrieving revision 7.23 diff -u -r7.23 gnus-util.el --- gnus-util.el 17 Dec 2004 10:27:43 -0000 7.23 +++ gnus-util.el 9 Jan 2005 20:33:33 -0000 @@ -1,5 +1,5 @@ ;;; gnus-util.el --- utility functions for 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 @@ -1479,41 +1479,48 @@ (nconc (nreverse res) list1 list2)))) (eval-when-compile - (defvar xemacs-codename)) + (defvar xemacs-codename) + (defvar sxemacs-codename) + (defvar emacs-program-version)) (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))) + 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 ")") + ((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) ")")) - ""))) (t emacs-version)))) (defun gnus-rename-file (old-path new-path &optional trim) Index: gnus.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v retrieving revision 7.31 diff -u -r7.31 gnus.el --- gnus.el 2 Nov 2004 02:54:23 -0000 7.31 +++ gnus.el 9 Jan 2005 20:33:33 -0000 @@ -1,7 +1,7 @@ ;;; 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 ;; Lars Magne Ingebrigtsen @@ -2391,24 +2391,44 @@ (symbol :tag "Parameter") (sexp :tag "Value"))))) -(defcustom gnus-user-agent 'emacs-gnus-type +(defcustom gnus-user-agent '(emacs gnus type) "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\) 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\) and `emacs' \(show Emacs version\). In +addition to the Emacs version, you can add `codename' \(show +\(S\)XEmacs codename\) 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 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 :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"))) + (string))) +;; Convert old (< 2005-01-09) symbol type values: +(when (symbolp gnus-user-agent) + (when (get 'gnus-user-agent 'saved-value) + ;; User has changed `gnus-user-agent' thru customize. + (gnus-message 1 "Please customize `gnus-user-agent' again.") + (sit-for 1)) + (setq gnus-user-agent + (cond ((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)))) + + ;;; Internal variables --=-=-= -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ --=-=-=--