Merge the t-gnus-6_17-quimby branch.
[elisp/gnus.git-] / lisp / gnus-vers.el
1 ;;; gnus-vers.el --- Declare gnus version
2
3 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
4 ;; Free Software Foundation, Inc.
5
6 ;; Author: Keiichi Suzuki <keiichi@nanap.org>
7 ;;         Katsumi Yamaoka <yamaoka@jpl.org>
8 ;; Keywords: news, mail, compatibility
9
10 ;; This file is part of T-gnus.
11
12 ;; This program is free software; you can redistribute it and/or
13 ;; modify it under the terms of the GNU General Public License as
14 ;; published by the Free Software Foundation; either version 2, or (at
15 ;; your option) any later version.
16
17 ;; This program is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 ;; General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
26
27 ;;; Commentary:
28
29 ;;; Code:
30
31 (eval-when-compile (require 'cl))
32
33 (require 'poe)
34 (require 'product)
35 (provide 'gnus-vers)
36
37 (defconst gnus-revision-number "00"
38   "Revision number for this version of gnus.")
39
40 ;; Product information of this gnus.
41 (product-provide 'gnus-vers
42   (product-define "T-gnus" nil
43                   (list 6 17 4
44                         (string-to-number gnus-revision-number))))
45
46 (defconst gnus-original-version-number "0.4"
47   "Version number for this version of Gnus.")
48
49 (provide 'running-pterodactyl-gnus-0_73-or-later)
50
51 (defconst gnus-original-product-name "No Gnus"
52   "Product name of the original version of Gnus.")
53
54 (defconst gnus-product-name (product-name (product-find 'gnus-vers))
55   "Product name of this version of gnus.")
56
57 (defconst gnus-version-number
58   (mapconcat
59    'number-to-string
60    (butlast (product-version (product-find 'gnus-vers)))
61    ".")
62   "Version number for this version of gnus.")
63
64 (defconst gnus-version
65   (format "%s %s r%s (based on %s v%s ; for SEMI 1.14 FLIM 1.14)"
66           gnus-product-name gnus-version-number gnus-revision-number
67           gnus-original-product-name gnus-original-version-number)
68   "Version string for this version of gnus.")
69
70 (defun gnus-version (&optional arg)
71   "Version number of this version of Gnus.
72 If ARG, insert string at point."
73   (interactive "P")
74   (if arg
75       (insert (message "%s" gnus-version))
76     (message "%s" gnus-version)))
77
78 (eval-when-compile
79   (defvar mime-user-interface-product)
80   (require 'mime-def))
81
82 (defun gnus-extended-version ()
83   "Stringified Gnus, Emacs, SEMI, FLIM and APEL versions.
84 See the variable `gnus-user-agent'."
85   (if (stringp gnus-user-agent)
86       gnus-user-agent
87     ;; `gnus-user-agent' is a list:
88     (let* ((float-output-format nil)
89            (gnus-v (when (memq 'gnus gnus-user-agent)
90                      (concat
91                       gnus-product-name "/" gnus-version-number " ("
92                       (unless (zerop (string-to-number gnus-revision-number))
93                         (concat "r" gnus-revision-number ", "))
94                       "based on " gnus-original-product-name
95                       " v" gnus-original-version-number ")")))
96            (emacs-v (gnus-emacs-version))
97            (mime-v (when (memq 'mime gnus-user-agent)
98                      (concat
99                       (mime-product-name mime-user-interface-product) "/"
100                       (mapconcat
101                        #'number-to-string
102                        (mime-product-version mime-user-interface-product)
103                        ".")
104                       " ("
105                       (mime-product-code-name mime-user-interface-product)
106                       ") "
107                       (mime-product-name mime-library-product) "/"
108                       (mapconcat
109                        #'number-to-string
110                        (mime-product-version mime-library-product)
111                        ".")
112                       " ("
113                       (mime-product-code-name mime-library-product)
114                       ") " (apel-version)))))
115       (mapconcat 'identity (delq nil (list gnus-v mime-v emacs-v)) " "))))
116
117 ;; gnus-vers.el ends here