* configure.in (VERSION): Bump up to 1.4.10.
[elisp/liece.git] / lisp / liece-version.el
1 ;;; liece-version.el --- Version information for Liece.
2 ;; Copyright (C) 1998-2000 Daiki Ueno
3
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
5 ;; Created: 1998-09-28
6 ;; Revised: 1999-12-23
7 ;; Keywords: IRC, liece
8
9 ;; This file is part of Liece.
10
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26
27 ;;; Commentary:
28 ;; 
29
30 ;;; Code:
31
32 ;;; @ version number constants
33 ;;;
34
35 (require 'product)
36 (provide 'liece-version)
37
38 (product-provide 'liece-version
39   (product-define "Liece" nil '(1 4 10)))
40
41 (defconst liece-environment-version
42   (concat
43    (if (fboundp 'apel-version)
44        (concat (apel-version) " ")
45      nil)
46    (if (featurep 'xemacs)
47        (concat (cond
48                 ((featurep 'utf-2000)
49                  (concat "UTF-2000-MULE/" utf-2000-version))
50                 ((featurep 'mule) "MULE"))
51                " XEmacs"
52                (if (string-match "^[0-9]+\\(\\.[0-9]+\\)" emacs-version)
53                    (concat
54                     "/"
55                     (substring emacs-version 0 (match-end 0))
56                     (cond ((and (boundp 'xemacs-betaname)
57                                 xemacs-betaname)
58                            ;; It does not exist in XEmacs
59                            ;; versions prior to 20.3.
60                            (concat " " xemacs-betaname))
61                           ((and (boundp 'emacs-patch-level)
62                                 emacs-patch-level)
63                            ;; It does not exist in FSF Emacs or in
64                            ;; XEmacs versions earlier than 21.1.1.
65                            (format " (patch %d)" emacs-patch-level))
66                           (t ""))
67                     " (" xemacs-codename ") ("
68                     system-configuration ")")
69                  " (" emacs-version ")"))
70      (let ((ver (if (string-match "\\.[0-9]+$" emacs-version)
71                     (substring emacs-version 0 (match-beginning 0))
72                   emacs-version)))
73        (if (featurep 'mule)
74            (if (boundp 'enable-multibyte-characters)
75                (concat "Emacs/" ver
76                        " (" system-configuration ")"
77                        (if enable-multibyte-characters
78                            (concat " MULE/" mule-version)
79                          " (with unibyte mode)")
80                        (if (featurep 'meadow)
81                            (let ((mver (Meadow-version)))
82                              (if (string-match "^Meadow-" mver)
83                                  (concat " Meadow/"
84                                          (substring mver
85                                                     (match-end 0))))))
86                        (if (boundp 'NEMACS)
87                            (let ((nemacs-version
88                                   (condition-case ()
89                                       (eval '(nemacs-version))
90                                     (error ""))))
91                              (when (string-match
92                                     "Nemacs version \\([^ ]*\\)"
93                                     nemacs-version)
94                                (setq nemacs-version
95                                      (match-string 1 nemacs-version)))
96                              (concat " NEmacs/" nemacs-version))))
97              (concat "MULE/" mule-version
98                      " (based on Emacs " ver ")"))
99          (concat "Emacs/" ver " (" system-configuration ")"))))))
100
101 (defun liece-version ()
102   "Print Liece version."
103   (interactive)
104   (let ((product-info
105          (concat (product-string-1 'liece-version t)
106                  (if liece-insert-environment-version
107                      (concat " " liece-environment-version)
108                    nil))))
109     (if (interactive-p)
110         (message "%s" product-info)
111       product-info)))
112
113 ;;; liece-version.el ends here