Gnus development mailing list
 help / color / mirror / Atom feed
* [sgnus 0.16] Enhancement for mail/post
@ 1995-12-02  6:23 Steven L. Baur
  0 siblings, 0 replies; only message in thread
From: Steven L. Baur @ 1995-12-02  6:23 UTC (permalink / raw)


Why don't the X-Mailer: and X-Newsreader: headers include the Emacs
version as well?  Inquiring minds want to know!

--- ChangeLog~	Tue Nov 28 23:23:14 1995
+++ ChangeLog	Fri Dec  1 21:23:00 1995
@@ -1,3 +1,10 @@
+Fri Dec  1 21:21:18 1995  Steven L. Baur  <steve@miranova.com>
+
+	* gnus-msg.el (gnus-inews-insert-headers): Call new function for
+	value of X-Newsreader:, and X-Mailer: headers
+	(gnus-extended-version): New function returning a string with Gnus
+	version + Emacs version
+
 Sun Nov 26 14:46:55 1995  Steven L. Baur  <steve@diana.miranova.com>
 
 	* gnus.el (gnus-summary-edit-article): force read of articles


--- 1.2	1995/11/26 04:08:52
+++ gnus-msg.el	1995/12/02 05:18:00
@@ -1030,7 +1030,27 @@
 	   (delete-region (progn (beginning-of-line) (point))
 			  (progn (forward-line 1) (point))))
       (setq headers (cdr headers)))))
-  
+
+;;; Since the X-Newsreader/X-Mailer are ``vanity'' headers, they might
+;;; as well include the Emacs version as well.
+;;; The following function works with later GNU Emacs, and XEmacs.
+(defun gnus-extended-version ()
+  "Stringified Gnus version and Emacs version"
+  (interactive)
+  (concat gnus-version
+	  "/"
+	  (cond
+	   ((string-match "^\\([0-9]+\\.[0-9]+\\)\\.[0-9]+$" emacs-version)
+	    (concat "Emacs " (substring emacs-version
+					(match-beginning 1)
+					(match-end 1))))
+	   ((string-match "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)" emacs-version)
+	    (concat (substring emacs-version
+			       (match-beginning 1)
+			       (match-end 1))
+		    (format " %d.%d" emacs-major-version emacs-minor-version)))
+	   (t emacs-version))))
+
 (defun gnus-inews-insert-headers (&optional headers)
   "Prepare article headers.
 Headers already prepared in the buffer are not modified.
@@ -1046,8 +1066,8 @@
 	(To nil)
 	(Distribution nil)
 	(Lines (gnus-inews-lines))
-	(X-Newsreader gnus-version)
-	(X-Mailer gnus-version)
+	(X-Newsreader (gnus-extended-version))
+	(X-Mailer (gnus-extended-version))
 	(headers (or headers gnus-required-headers))
 	(case-fold-search t)
 	header value elem)

-- 
steve@miranova.com baur


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-12-02  6:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-12-02  6:23 [sgnus 0.16] Enhancement for mail/post Steven L. Baur

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).