From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Subject: Re: User-Agent string
Date: Mon, 24 Feb 2003 22:12:26 +0100 [thread overview]
Message-ID: <v9r89x8jt1.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <m3isvchxhh.fsf@quimbies.gnus.org>
[-- Attachment #1: Type: text/plain, Size: 894 bytes --]
On Sat, Feb 22 2003, Lars Magne Ingebrigtsen wrote:
> 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 <Reiner.Steib@gmx.de>
* 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 <Reiner.Steib@gmx.de>
* gnus.texi (Mail and Post): Added `gnus-user-agent', removed
`gnus-version-expose-system'.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-user-agent.patch --]
[-- Type: text/x-patch, Size: 5870 bytes --]
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 <Reiner.Steib@gmx.de>
+
+ * gnus.texi (Mail and Post): Added `gnus-user-agent', removed
+ `gnus-version-expose-system'.
+
2003-02-24 Jesper Harder <harder@ifa.au.dk>
* 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))))))
\f
;;;
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 <Reiner.Steib@gmx.de>
+
+ * 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 <tzz@lifelogs.com>
From Michael Shields <shields@msrl.com>
[-- Attachment #3: Type: text/plain, Size: 117 bytes --]
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/
next prev parent reply other threads:[~2003-02-24 21:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E18h9EM-0004hv-00@quimby.gnus.org>
2003-02-07 20:05 ` Changes committed gnus/lisp (ChangeLog gnus-msg.el gnus-sum.el) Jesper Harder
2003-02-07 20:29 ` Lars Magne Ingebrigtsen
2003-02-08 3:43 ` Vasily Korytov
2003-02-08 5:13 ` Jesper Harder
2003-02-08 20:47 ` Lars Magne Ingebrigtsen
2003-02-09 3:07 ` Vasily Korytov
2003-02-09 3:20 ` Vasily Korytov
2003-02-10 8:33 ` Vasily Korytov
2003-02-10 8:41 ` Russ Allbery
2003-02-10 9:10 ` Vasily Korytov
2003-02-11 1:32 ` Lars Magne Ingebrigtsen
2003-02-11 5:10 ` Jesper Harder
2003-02-11 13:23 ` User-Agent string (was: Changes committed gnus/lisp (ChangeLog gnus-msg.el gnus-sum.el)) Reiner Steib
2003-02-12 10:19 ` User-Agent string Vasily Korytov
2003-02-22 20:27 ` Lars Magne Ingebrigtsen
2003-02-24 21:12 ` Reiner Steib [this message]
2003-02-24 22:18 ` Vasily Korytov
2003-02-27 14:50 ` Reiner Steib
2003-02-27 19:33 ` Vasily Korytov
2003-02-28 19:26 ` Reiner Steib
2003-03-01 23:06 ` Frank Haun
2003-03-03 16:18 ` Reiner Steib
2003-02-25 10:26 ` Kai Großjohann
2003-02-11 7:23 ` Changes committed gnus/lisp (ChangeLog gnus-msg.el gnus-sum.el) Vasily Korytov
2003-02-22 20:28 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=v9r89x8jt1.fsf@marauder.physik.uni-ulm.de \
--to=4.uce.03.r.s@nurfuerspam.de \
--cc=reiner.steib@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).