0
|
1 ;; Record version number of Emacs.
|
|
2 ;; Copyright (C) 1985, 1991-1994 Free Software Foundation, Inc.
|
|
3
|
|
4 ;; This file is part of GNU Emacs.
|
|
5
|
|
6 ;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
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
|
|
11 ;; GNU Emacs is distributed in the hope that it will be useful,
|
|
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
|
|
17 ;; along with GNU Emacs; see the file COPYING. If not, write to
|
|
18 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
19
|
|
20 ;;; Synched up with: FSF 19.30.
|
|
21
|
|
22 ;;; Code:
|
|
23
|
|
24 ;; The following line is modified automatically
|
|
25 ;; by loading inc-version.el, each time a new Emacs is dumped.
|
50
|
26 ;; (defconst emacs-version "19.16" "\
|
|
27 ;; Version numbers of this version of Emacs.")
|
0
|
28
|
50
|
29 ;; (setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta90)")))
|
0
|
30
|
50
|
31 ;(defconst emacs-major-version
|
|
32 ; (progn (or (string-match "^[0-9]+" emacs-version)
|
|
33 ; (error "emacs-version unparsable"))
|
|
34 ; (string-to-int (match-string 0 emacs-version)))
|
|
35 ; "Major version number of this version of Emacs, as an integer.
|
|
36 ;Warning, this variable did not exist in Emacs versions earlier than:
|
|
37 ; FSF Emacs: 19.23
|
|
38 ; XEmacs: 19.10")
|
0
|
39
|
50
|
40 ;(defconst emacs-minor-version
|
|
41 ; (progn (or (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)
|
|
42 ; (error "emacs-version unparsable"))
|
|
43 ; (string-to-int (match-string 1 emacs-version)))
|
|
44 ; "Minor version number of this version of Emacs, as an integer.
|
|
45 ;Warning, this variable did not exist in Emacs versions earlier than:
|
|
46 ; FSF Emacs: 19.23
|
|
47 ; XEmacs: 19.10")
|
0
|
48
|
|
49 (defconst emacs-build-time (current-time-string) "\
|
|
50 Time at which Emacs was dumped out.")
|
|
51
|
|
52 (defconst emacs-build-system (system-name))
|
|
53
|
52
|
54 (defconst xemacs-betaname nil
|
50
|
55 "Non-nil when this is a test (beta) version of XEmacs.
|
|
56 Warning, this variable did not exist in XEmacs versions prior to 20.3")
|
|
57
|
68
|
58 (defconst xemacs-codename "Lille"
|
52
|
59 "Symbolic name of XEmacs build.
|
|
60 Warning, this variable did not exist in XEmacs versions prior to 19.16
|
|
61 and 20.3")
|
50
|
62
|
|
63 (defconst emacs-version
|
|
64 (purecopy
|
|
65 (format "%d.%d \"%s\"%s%s"
|
|
66 emacs-major-version
|
|
67 emacs-minor-version
|
|
68 xemacs-codename
|
|
69 " XEmacs Lucid"
|
|
70 (if xemacs-betaname
|
|
71 (concat " " xemacs-betaname)
|
|
72 "")))
|
|
73 "Version numbers of this version of XEmacs.")
|
|
74
|
|
75
|
0
|
76 (defun emacs-version (&optional here) "\
|
|
77 Return string describing the version of Emacs that is running.
|
|
78 If optional argument HERE is non-nil, insert string at point.
|
|
79 Don't use this function in programs to choose actions according
|
|
80 to the system configuration; look at `system-configuration' instead."
|
|
81 (interactive "P")
|
|
82 (let ((version-string
|
|
83 (format "XEmacs %s [Lucid] (%s) of %s %s on %s"
|
|
84 (substring emacs-version 0
|
|
85 (string-match " XEmacs" emacs-version))
|
|
86 system-configuration
|
|
87 (substring emacs-build-time 0
|
|
88 (string-match " *[0-9]*:" emacs-build-time))
|
|
89 (substring emacs-build-time
|
|
90 (string-match "[0-9]*$" emacs-build-time))
|
|
91 emacs-build-system)))
|
|
92 (if here
|
|
93 (insert version-string)
|
|
94 (if (interactive-p)
|
|
95 (message "%s" version-string)
|
|
96 version-string))))
|
|
97
|
|
98 ;; from emacs-vers.el
|
|
99 (defun emacs-version>= (major &optional minor)
|
|
100 "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers.
|
|
101
|
|
102 The MAJOR version number argument is required, but the MINOR version number
|
|
103 argument is optional. If the minor version number is not specified (or is the
|
|
104 symbol `nil') then only the major version numbers are considered in the test."
|
|
105 (if (null minor)
|
|
106 (>= emacs-major-version major)
|
|
107 (or (> emacs-major-version major)
|
|
108 (and (= emacs-major-version major)
|
|
109 (>= emacs-minor-version minor))
|
|
110 )
|
|
111 ))
|
|
112
|
|
113 ;;; We hope that this alias is easier for people to find.
|
|
114 (define-function 'version 'emacs-version)
|
|
115
|
|
116 ;; Put the emacs version number into the `pure[]' array in a form that
|
|
117 ;; `what(1)' can extract from the executable or a core file. We don't
|
|
118 ;; actually need this to be pointed to from lisp; pure objects can't
|
|
119 ;; be GCed.
|
|
120 (or (memq system-type '(vax-vms windows-nt ms-dos))
|
|
121 (purecopy (concat "\n@" "(#)" (emacs-version)
|
|
122 "\n@" "(#)" "Configuration: "
|
|
123 system-configuration "\n")))
|
|
124
|
|
125 ;;Local variables:
|
|
126 ;;version-control: never
|
|
127 ;;End:
|
|
128
|
|
129 ;;; version.el ends here
|