annotate lisp/version.el @ 2:ac2d302a0011 r19-15b2

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