From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/50356 Path: main.gmane.org!not-for-mail From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de> Newsgroups: gmane.emacs.gnus.general Subject: Re: User-Agent string Date: Mon, 24 Feb 2003 22:12:26 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: <87d6m2ywwq.fsf@unix.home> Reply-To: reiner.steib@gmx.de NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1046121461 14820 80.91.224.249 (24 Feb 2003 21:17:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 24 Feb 2003 21:17:41 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18nPyl-0003ql-00 for ; Mon, 24 Feb 2003 22:17:39 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18nPuE-0005aa-00; Mon, 24 Feb 2003 15:12:58 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 24 Feb 2003 15:13:57 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id PAA07203 for ; Mon, 24 Feb 2003 15:13:37 -0600 (CST) Original-Received: (qmail 17948 invoked by alias); 24 Feb 2003 21:12:32 -0000 Original-Received: (qmail 17942 invoked from network); 24 Feb 2003 21:12:31 -0000 Original-Received: from theotp5.physik.uni-ulm.de (134.60.10.145) by 66.230.238.6 with SMTP; 24 Feb 2003 21:12:31 -0000 Original-Received: (from ste@localhost) by theotp5.physik.uni-ulm.de (8.11.2/8.11.2) id h1OLCQW26523; Mon, 24 Feb 2003 22:12:26 +0100 X-Authentication-Warning: theotp5.physik.uni-ulm.de: ste set sender to reiner.steib@physik.uni-ulm.de using -f Original-To: ding@gnus.org X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l;3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2;n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes: > >> To make it easier for the user to expose less information, we could >> add something like this... >> >> --8<---------------cut here---------------start------------->8--- >> (defcustom gnus-user-agent 'full >> "Which information should be exposed in the User-Agent header. > > I think this makes most sense -- letting the user decide. The attached patch contains code, documentation and ChangeLog entries for this. 2003-02-24 Reiner Steib * gnus-msg.el (gnus-user-agent): New variable. (gnus-version-expose-system): Removed. Obsoleted by `gnus-user-agent'. (gnus-extended-version): Use `gnus-user-agent'. 2003-02-24 Reiner Steib * gnus.texi (Mail and Post): Added `gnus-user-agent', removed `gnus-version-expose-system'. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gnus-user-agent.patch Content-Description: gnus-user-agent.patch Index: texi/gnus.texi =================================================================== RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v retrieving revision 6.427 diff -u -r6.427 gnus.texi --- texi/gnus.texi 24 Feb 2003 02:01:01 -0000 6.427 +++ texi/gnus.texi 24 Feb 2003 16:58:03 -0000 @@ -11183,13 +11183,17 @@ lists will work most of the time. Posting to these groups (@kbd{a}) is still a pain, though. -@item gnus-version-expose-system -@vindex gnus-version-expose-system +@item gnus-user-agent +@vindex gnus-user-agent +@cindex User-Agent -Your system type (@code{system-configuration} variable, such as -@samp{i686-pc-linux}) is exposed in the auto-generated by default -User-Agent header. Sometimes, it may be desireable (mostly because of -aesthetic reasons) to turn it off. In this case, set it to @code{nil}. +This variable controls which information should be exposed in the +User-Agent header. It can be one of the symbols @code{full} (show full +information, i.e. Emacs and Gnus version and system configuration), +@code{emacs-gnus} (show only Emacs and Gnus version), +@code{emacs-gnus-type} (same as @code{emacs-gnus} plus system type), +@code{gnus} (show only Gnus version) or a custom string. If you set it +to a string, be sure to use a valid format, see RFC 2616. @end table Index: texi/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/texi/ChangeLog,v retrieving revision 6.464 diff -u -r6.464 ChangeLog --- texi/ChangeLog 24 Feb 2003 03:16:20 -0000 6.464 +++ texi/ChangeLog 24 Feb 2003 16:58:03 -0000 @@ -1,3 +1,8 @@ +2003-02-24 Reiner Steib + + * gnus.texi (Mail and Post): Added `gnus-user-agent', removed + `gnus-version-expose-system'. + 2003-02-24 Jesper Harder * gnus.texi: Markup fixes. Index: lisp/gnus-msg.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-msg.el,v retrieving revision 6.121 diff -u -r6.121 gnus-msg.el --- lisp/gnus-msg.el 23 Feb 2003 12:32:18 -0000 6.121 +++ lisp/gnus-msg.el 24 Feb 2003 16:58:03 -0000 @@ -283,10 +283,21 @@ :group 'gnus-message :type 'boolean) -(defcustom gnus-version-expose-system nil - "If non-nil, `system-configuration' is exposed in `gnus-extended-version'." +(defcustom gnus-user-agent 'full + "Which information should be exposed in the User-Agent header. + +It can be one of the symbols `full' \(show full information, i.e. Emacs and +Gnus version and system configuration\), `emacs-gnus' \(show only Emacs and +Gnus version\), `emacs-gnus-type' \(same as `emacs-gnus' plus system type\), +`gnus' \(show only Gnus version\) or a custom string. If you set it to a +string, be sure to use a valid format, see RFC 2616." :group 'gnus-message - :type 'boolean) + :type '(choice (item :tag "Show full info" full) + (item :tag "Show Gnus and Emacs versions and system type" + emacs-gnus-type) + (item :tag "Show Gnus and Emacs versions" emacs-gnus) + (item :tag "Show only Gnus version" gnus) + (string :tag "Other"))) ;;; Internal variables. @@ -1026,31 +1037,51 @@ (defvar xemacs-codename)) (defun gnus-extended-version () - "Stringified Gnus version and Emacs version." + "Stringified Gnus version and Emacs version. +See the variable `gnus-user-agent'." (interactive) - (concat - "Gnus/" (gnus-prin1-to-string (gnus-continuum-version gnus-version)) - " (" gnus-version ")" - " " - (cond - ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version) - (concat "Emacs/" (match-string 1 emacs-version) - (if gnus-version-expose-system - " (" system-configuration ")" - ""))) - ((string-match "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?" - emacs-version) - (concat (match-string 1 emacs-version) + (let* ((gnus-v + (concat "Gnus/" + (prin1-to-string (gnus-continuum-version gnus-version) t) + " (" gnus-version ")")) + (system-v + (cond + ((eq gnus-user-agent 'full) + system-configuration) + ((eq gnus-user-agent 'emacs-gnus-type) + (symbol-name system-type)) + (t nil))) + (emacs-v + (cond + ((eq gnus-user-agent 'gnus) + nil) + ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version) + (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) - (if gnus-version-expose-system - (concat " (" xemacs-codename ", " system-configuration ")") - (concat " (" xemacs-codename ")")) - ""))) - (t emacs-version)))) + (concat + " (" xemacs-codename + (if system-v + (concat ", " system-v ")") + ")")) + ""))) + (t emacs-version)))) + (if (stringp gnus-user-agent) + gnus-user-agent + (concat gnus-v + (when emacs-v + (concat " " emacs-v)))))) ;;; Index: lisp/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 6.2043 diff -u -r6.2043 ChangeLog --- lisp/ChangeLog 24 Feb 2003 16:20:06 -0000 6.2043 +++ lisp/ChangeLog 24 Feb 2003 16:58:03 -0000 @@ -1,3 +1,10 @@ +2003-02-24 Reiner Steib + + * gnus-msg.el (gnus-user-agent): New variable. + (gnus-version-expose-system): Removed. Obsoleted by + `gnus-user-agent'. + (gnus-extended-version): Use `gnus-user-agent'. + 2003-02-24 Ted Zlatanov From Michael Shields --=-=-= Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/ --=-=-=--