1 ;;; riece-version.el --- version information handling
2 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 ;; Free Software Foundation, Inc.
4 ;; Copyright (C) 1998-2003 Daiki Ueno
6 ;; Author: Daiki Ueno <ueno@unixuser.org>
8 ;; Keywords: IRC, riece
10 ;; This file is part of Riece.
12 ;; This program is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; This program is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
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.
29 (require 'riece-package-info)
31 ;; NOTE: Most part of this file is copied from Gnus.
33 (defcustom riece-user-agent 'emacs-riece-type
34 "Which information should be exposed in the User-Agent header.
36 It can be one of the symbols `riece' \(show only Riece version\), `emacs-riece'
37 \(show only Emacs and Riece versions\), `emacs-riece-config' \(same as
38 `emacs-riece' plus system configuration\), `emacs-riece-type' \(same as
39 `emacs-riece' plus system type\) or a custom string. If you set it to a
40 string, be sure to use a valid format, see RFC 2616."
43 (item :tag "Show Riece and Emacs versions and system type"
45 (item :tag "Show Riece and Emacs versions and system configuration"
47 (item :tag "Show Riece and Emacs versions" emacs-riece)
48 (item :tag "Show only Riece version" riece)
49 (string :tag "Other")))
51 (defconst riece-version (format "%s v%s" riece-package-name
53 "Version string for this version of Riece.")
56 (defvar emacs-program-version)
57 (defvar xemacs-codename)
58 (defvar sxemacs-codename))
60 (defun riece-extended-version ()
61 "Stringified Riece version and Emacs version.
62 See the variable `riece-user-agent'."
64 (concat riece-package-name "/"
65 (prin1-to-string riece-version-number t)))
68 ((eq riece-user-agent 'emacs-riece-config)
70 ((eq riece-user-agent 'emacs-riece-type)
71 (symbol-name system-type))
75 ((eq riece-user-agent 'riece)
77 ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
78 (concat "Emacs/" (match-string 1 emacs-version)
80 (concat " (" system-v ")")
83 (concat "SXEmacs/" emacs-program-version
86 (when sxemacs-codename
87 (concat sxemacs-codename ", "))
90 (concat "XEmacs/" emacs-program-version
94 (concat xemacs-codename ", "))
97 (if (stringp riece-user-agent)
101 (concat " " emacs-v))))))
103 (defun riece-version (&optional arg)
104 "Version number of this version of Riece.
105 If ARG, use user-agent format."
108 (message "%s" (riece-extended-version))
109 (message "%s" riece-version)))
111 (provide 'riece-version)
113 ;;; riece-version.el ends here