Gnus development mailing list
 help / color / mirror / Atom feed
From: Steve Youngs <steve@youngs.au.com>
Subject: Re: Using versions instead of XEmacs codenames in User-Agent
Date: Sun, 09 Jan 2005 11:28:10 +1000	[thread overview]
Message-ID: <microsoft-free.873bxbcrx1.fsf@youngs.au.com> (raw)
In-Reply-To: <v94qhrx06z.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Sat, 08 Jan 2005 19:09:08 +0100")

[-- Attachment #1: Type: text/plain, Size: 4342 bytes --]

* Reiner Steib <reinersteib+gmane@imap.cc> writes:

  > On Fri, Jan 07 2005, Steve Youngs wrote:
  >> Will do.  But, as Katsumi suggested, perhaps make inclusion
  >> of the codename customisable.

  > I'm not sure how this options should be merged into the current
  > choices of `gnus-user-agent'.  Additionally, I don't have an XEmacs
  > for testing before Monday.  Here is a preliminary version of my patch
  > in case someone want to work on it now:

[ Reiner's patch ]

And here is my version of the same.  It:

        - Adds support for SXEmacs

        - Allows optional exclusion of (S)XEmacs codenames (defaults
          to including the codename to keep with old behaviour)

        - Uses full version numbers, ie major.minor.patch

The default settings should give a User-Agent header similar to the
one in this message's headers.

Reiner, I'll wait to see if you (or anyone else) have any comments
regarding this patch before I commit it.

Index: lisp/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 7.589
diff -u -U0 -r7.589 ChangeLog
--- lisp/ChangeLog	7 Jan 2005 06:17:11 -0000	7.589
+++ lisp/ChangeLog	9 Jan 2005 01:09:15 -0000
@@ -0,0 +1,11 @@
+2005-01-09  Steve Youngs  <steve@sxemacs.org>
+
+	* gnus.el (gnus-user-agent-display-codename): New.  When non-nil
+	and a (S)XEmacs codename exists, display it in the User-Agent
+	header. 
+
+	* gnus-util.el (gnus-emacs-version): Add matching for SXEmacs.
+	Display full version number, ie major.minor.patch for (S)XEmacs.
+	Optionally display (S)XEmacs codename.
+
+
Index: lisp/gnus-util.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-util.el,v
retrieving revision 7.23
diff -u -u -r7.23 gnus-util.el
--- lisp/gnus-util.el	17 Dec 2004 10:27:43 -0000	7.23
+++ lisp/gnus-util.el	9 Jan 2005 01:09:08 -0000
@@ -1479,7 +1479,10 @@
       (nconc (nreverse res) list1 list2))))
 
 (eval-when-compile
-  (defvar xemacs-codename))
+  (defvar xemacs-codename)
+  (defvar sxemacs-codename)
+  (defvar running-xemacs)
+  (defvar running-sxemacs))
 
 (defun gnus-emacs-version ()
   "Stringified Emacs version."
@@ -1498,22 +1501,22 @@
 	      (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 ")")
-	      ")"))
-	 "")))
+     (running-sxemacs
+      (concat "SXEmacs/" 
+	      emacs-program-version
+	      (when (and gnus-user-agent-display-codename
+			 sxemacs-codename)
+		(concat " \"" sxemacs-codename "\""))
+	      (when system-v
+		(concat " (" system-v ")"))))
+     (running-xemacs
+      (concat "XEmacs/"
+	      emacs-program-version
+	      (when (and gnus-user-agent-display-codename
+			 xemacs-codename)
+		(concat " \"" xemacs-codename "\""))
+	      (when system-v
+		(concat " (" system-v ")"))))
      (t emacs-version))))
 
 (defun gnus-rename-file (old-path new-path &optional trim)
Index: lisp/gnus.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v
retrieving revision 7.31
diff -u -u -r7.31 gnus.el
--- lisp/gnus.el	2 Nov 2004 02:54:23 -0000	7.31
+++ lisp/gnus.el	9 Jan 2005 01:09:09 -0000
@@ -2410,6 +2410,12 @@
 	  (item :tag "Show only Gnus version" gnus)
 	  (string :tag "Other")))
 
+(defcustom gnus-user-agent-display-codename t
+  "If non-nil display the (S)XEmacs codename in the User-Agent header."
+  :version "21.4"
+  :group 'gnus-message
+  :type 'boolean)
+
 \f
 ;;; Internal variables



-- 
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
|                   Te audire no possum.                   |
|             Musa sapientum fixa est in aure.             |
|----------------------------------<steve@youngs.au.com>---|

[-- Attachment #2: Type: application/pgp-signature, Size: 256 bytes --]

  reply	other threads:[~2005-01-09  1:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-06  1:49 [PATCH] SXEmacs User-Agent string Steve Youngs
2005-01-06 13:41 ` Using versions instead of XEmacs codenames in User-Agent (was: [PATCH] SXEmacs User-Agent string) Reiner Steib
2005-01-06 23:00   ` Using versions instead of XEmacs codenames in User-Agent Katsumi Yamaoka
2005-01-06 23:29   ` Steve Youngs
2005-01-08 18:09     ` Reiner Steib
2005-01-09  1:28       ` Steve Youngs [this message]
2005-01-09 20:55         ` Reiner Steib
2005-01-09 23:09           ` Steve Youngs
2005-01-10  8:42             ` Bjørn Mork
2005-01-10  9:20               ` Steve Youngs
2005-01-10 10:39                 ` Bjørn Mork
2005-01-10 15:07             ` Reiner Steib
2005-01-10 23:29               ` Steve Youngs

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=microsoft-free.873bxbcrx1.fsf@youngs.au.com \
    --to=steve@youngs.au.com \
    /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).