annotate lisp/version.el @ 239:41f2f0e326e9 r20-5b18

Import from CVS: tag r20-5b18
author cvs
date Mon, 13 Aug 2007 10:15:48 +0200
parents 41ff10fd062f
children c42ec1d1cded
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
1 ;; version.el --- Record version number of Emacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
3 ;; Copyright (C) 1985, 1991-1994, 1997 Free Software Foundation, Inc.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
4
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
5 ;; Maintainer: XEmacs Development Team
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
6 ;; Keywords: internal, dumped
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
8 ;; This file is part of XEmacs.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
22 ;; Free Software Foundation Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
23 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents: 70
diff changeset
25 ;;; Synched up with: FSF 19.34.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
27 ;;; Commentary:
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
28
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
29 ;; This file is dumped with XEmacs.
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 155
diff changeset
30
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 187
diff changeset
31 ;;; Code:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
33 (defconst xemacs-betaname
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
34 (and emacs-beta-version (format "(beta%d)" emacs-beta-version))
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 155
diff changeset
35 "Non-nil when this is a test (beta) version of XEmacs.
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 155
diff changeset
36 Warning, this variable did not exist in XEmacs versions prior to 20.3")
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 155
diff changeset
37
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
38 (defconst emacs-version
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
39 (purecopy
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
40 (format "%d.%d %s%s%s"
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
41 emacs-major-version
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
42 emacs-minor-version
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 209
diff changeset
43 (if (and xemacs-codename (not (featurep 'infodock)))
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
44 (concat "\"" xemacs-codename "\"")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
45 "")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
46 (concat " XEmacs "
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 209
diff changeset
47 ;; (if (not (featurep 'infodock))
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
48 " Lucid"
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 209
diff changeset
49 ;; ""))
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 209
diff changeset
50 )
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
51 (if xemacs-betaname
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
52 (concat " " xemacs-betaname)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
53 "")))
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
54 "Version numbers of this version of XEmacs.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 209
diff changeset
56 (if (featurep 'infodock)
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 209
diff changeset
57 (require 'id-vers))
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 209
diff changeset
58
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
59 ;; Moved to C code as of XEmacs 20.3
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
60 ;(defconst emacs-major-version
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
61 ; (progn (or (string-match "^[0-9]+" emacs-version)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
62 ; (error "emacs-version unparsable"))
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
63 ; (string-to-int (match-string 0 emacs-version)))
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
64 ; "Major version number of this version of Emacs, as an integer.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
65 ;Warning, this variable did not exist in Emacs versions earlier than:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
66 ; FSF Emacs: 19.23
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
67 ; XEmacs: 19.10")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
69 ;; Moved to C code as of XEmacs 20.3
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
70 ;(defconst emacs-minor-version
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
71 ; (progn (or (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
72 ; (error "emacs-version unparsable"))
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
73 ; (string-to-int (match-string 1 emacs-version)))
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
74 ; "Minor version number of this version of Emacs, as an integer.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
75 ;Warning, this variable did not exist in Emacs versions earlier than:
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
76 ; FSF Emacs: 19.23
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 161
diff changeset
77 ; XEmacs: 19.10")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
79 (defconst emacs-build-time (current-time-string)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
80 "Time at which Emacs was dumped out.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (defconst emacs-build-system (system-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
84 (defun emacs-version (&optional arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
85 "Return string describing the version of Emacs that is running.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
86 When called interactively with a prefix argument, insert string at point.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 Don't use this function in programs to choose actions according
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 to the system configuration; look at `system-configuration' instead."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
89 (interactive "p")
187
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
90 (save-match-data
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
91 (let ((version-string
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
92 (format
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
93 "XEmacs %s %s(%s%s) of %s %s on %s"
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
94 (substring emacs-version 0 (string-match " XEmacs" emacs-version))
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
95 (if (not (featurep 'infodock))
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
96 "[Lucid] "
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
97 "")
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
98 system-configuration
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
99 (cond ((or (and (fboundp 'featurep)
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
100 (featurep 'mule))
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
101 (memq 'mule features)) ", Mule")
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
102 (t ""))
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
103 (substring emacs-build-time 0
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
104 (string-match " *[0-9]*:" emacs-build-time))
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
105 (substring emacs-build-time
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
106 (string-match "[0-9]*$" emacs-build-time))
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
107 emacs-build-system)))
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
108 (cond
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
109 ((null arg) version-string)
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
110 ((eq arg 1) (message "%s" version-string))
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 165
diff changeset
111 (t (insert version-string))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ;; from emacs-vers.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (defun emacs-version>= (major &optional minor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 The MAJOR version number argument is required, but the MINOR version number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 argument is optional. If the minor version number is not specified (or is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 symbol `nil') then only the major version numbers are considered in the test."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (if (null minor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (>= emacs-major-version major)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (or (> emacs-major-version major)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (and (= emacs-major-version major)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 68
diff changeset
123 (>= emacs-minor-version minor)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;;; We hope that this alias is easier for people to find.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (define-function 'version 'emacs-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;; Put the emacs version number into the `pure[]' array in a form that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ;; `what(1)' can extract from the executable or a core file. We don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ;; actually need this to be pointed to from lisp; pure objects can't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;; be GCed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (or (memq system-type '(vax-vms windows-nt ms-dos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (purecopy (concat "\n@" "(#)" (emacs-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 "\n@" "(#)" "Configuration: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 system-configuration "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ;;Local variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;;version-control: never
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;End:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ;;; version.el ends here