0
|
1 ;; Record version number of Emacs.
|
|
2 ;; Copyright (C) 1985, 1991-1994 Free Software Foundation, Inc.
|
|
3
|
70
|
4 ;; This file is part of XEmacs.
|
0
|
5
|
70
|
6 ;; XEmacs is free software; you can redistribute it and/or modify
|
0
|
7 ;; it under the terms of the GNU General Public License as published by
|
|
8 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
9 ;; any later version.
|
|
10
|
70
|
11 ;; XEmacs is distributed in the hope that it will be useful,
|
0
|
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 ;; GNU General Public License for more details.
|
|
15
|
|
16 ;; You should have received a copy of the GNU General Public License
|
70
|
17 ;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
18 ;; Free Software Foundation Inc., 59 Temple Place - Suite 330,
|
|
19 ;; Boston, MA 02111-1307, USA.
|
0
|
20
|
72
|
21 ;;; Synched up with: FSF 19.34.
|
0
|
22
|
|
23 ;;; Code:
|
|
24
|
70
|
25 (defconst emacs-version "20.0"
|
|
26 "Version numbers of this version of Emacs.")
|
0
|
27
|
72
|
28 (setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta31)")))
|
0
|
29
|
70
|
30 (defconst emacs-major-version
|
|
31 (progn (or (string-match "^[0-9]+" emacs-version)
|
|
32 (error "emacs-version unparsable"))
|
|
33 (string-to-int (match-string 0 emacs-version)))
|
|
34 "Major version number of this version of Emacs, as an integer.
|
|
35 Warning, this variable did not exist in Emacs versions earlier than:
|
|
36 FSF Emacs: 19.23
|
|
37 XEmacs: 19.10")
|
0
|
38
|
70
|
39 (defconst emacs-minor-version
|
|
40 (progn (or (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)
|
|
41 (error "emacs-version unparsable"))
|
|
42 (string-to-int (match-string 1 emacs-version)))
|
|
43 "Minor version number of this version of Emacs, as an integer.
|
|
44 Warning, this variable did not exist in Emacs versions earlier than:
|
|
45 FSF Emacs: 19.23
|
|
46 XEmacs: 19.10")
|
0
|
47
|
70
|
48 (defconst emacs-build-time (current-time-string)
|
|
49 "Time at which Emacs was dumped out.")
|
0
|
50
|
|
51 (defconst emacs-build-system (system-name))
|
|
52
|
70
|
53 (defun emacs-version (&optional arg)
|
|
54 "Return string describing the version of Emacs that is running.
|
|
55 When called interactively with a prefix argument, insert string at point.
|
0
|
56 Don't use this function in programs to choose actions according
|
|
57 to the system configuration; look at `system-configuration' instead."
|
70
|
58 (interactive "p")
|
|
59 (let ((version-string
|
|
60 (format
|
|
61 "XEmacs %s [Lucid] (%s%s) of %s %s on %s"
|
|
62 (substring emacs-version 0 (string-match " XEmacs" emacs-version))
|
|
63 system-configuration
|
|
64 (cond ((featurep 'mule) ", Mule") (t ""))
|
|
65 (substring emacs-build-time 0
|
|
66 (string-match " *[0-9]*:" emacs-build-time))
|
|
67 (substring emacs-build-time
|
|
68 (string-match "[0-9]*$" emacs-build-time))
|
|
69 emacs-build-system)))
|
|
70 (cond
|
|
71 ((null arg) version-string)
|
|
72 ((eq arg 1) (message "%s" version-string))
|
|
73 (t (insert version-string)))))
|
0
|
74
|
|
75 ;; from emacs-vers.el
|
|
76 (defun emacs-version>= (major &optional minor)
|
|
77 "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers.
|
|
78 The MAJOR version number argument is required, but the MINOR version number
|
|
79 argument is optional. If the minor version number is not specified (or is the
|
|
80 symbol `nil') then only the major version numbers are considered in the test."
|
|
81 (if (null minor)
|
|
82 (>= emacs-major-version major)
|
|
83 (or (> emacs-major-version major)
|
|
84 (and (= emacs-major-version major)
|
70
|
85 (>= emacs-minor-version minor)))))
|
0
|
86
|
|
87 ;;; We hope that this alias is easier for people to find.
|
|
88 (define-function 'version 'emacs-version)
|
|
89
|
|
90 ;; Put the emacs version number into the `pure[]' array in a form that
|
|
91 ;; `what(1)' can extract from the executable or a core file. We don't
|
|
92 ;; actually need this to be pointed to from lisp; pure objects can't
|
|
93 ;; be GCed.
|
|
94 (or (memq system-type '(vax-vms windows-nt ms-dos))
|
|
95 (purecopy (concat "\n@" "(#)" (emacs-version)
|
|
96 "\n@" "(#)" "Configuration: "
|
|
97 system-configuration "\n")))
|
|
98
|
|
99 ;;Local variables:
|
|
100 ;;version-control: never
|
|
101 ;;End:
|
|
102
|
|
103 ;;; version.el ends here
|