annotate lisp/version.el @ 104:cf808b4c4290 r20-1b4

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