annotate lisp/version.el @ 68:0b7f3b634cf2 r19-16-pre9

Import from CVS: tag r19-16-pre9
author cvs
date Mon, 13 Aug 2007 09:00:03 +0200
parents cc4664d4732c
children 131b0175ea99
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.
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
26 ;; (defconst emacs-version "19.16" "\
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
27 ;; Version numbers of this version of Emacs.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
29 ;; (setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta90)")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
31 ;(defconst emacs-major-version
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
32 ; (progn (or (string-match "^[0-9]+" emacs-version)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
33 ; (error "emacs-version unparsable"))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
34 ; (string-to-int (match-string 0 emacs-version)))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
35 ; "Major version number of this version of Emacs, as an integer.
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
36 ;Warning, this variable did not exist in Emacs versions earlier than:
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
37 ; FSF Emacs: 19.23
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
38 ; XEmacs: 19.10")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
40 ;(defconst emacs-minor-version
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
41 ; (progn (or (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
42 ; (error "emacs-version unparsable"))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
43 ; (string-to-int (match-string 1 emacs-version)))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
44 ; "Minor version number of this version of Emacs, as an integer.
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
45 ;Warning, this variable did not exist in Emacs versions earlier than:
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
46 ; FSF Emacs: 19.23
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
47 ; XEmacs: 19.10")
0
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
52
461c7ba8286a Import from CVS: tag r19-16-pre1
cvs
parents: 50
diff changeset
54 (defconst xemacs-betaname nil
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
55 "Non-nil when this is a test (beta) version of XEmacs.
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
56 Warning, this variable did not exist in XEmacs versions prior to 20.3")
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
57
68
0b7f3b634cf2 Import from CVS: tag r19-16-pre9
cvs
parents: 66
diff changeset
58 (defconst xemacs-codename "Lille"
52
461c7ba8286a Import from CVS: tag r19-16-pre1
cvs
parents: 50
diff changeset
59 "Symbolic name of XEmacs build.
461c7ba8286a Import from CVS: tag r19-16-pre1
cvs
parents: 50
diff changeset
60 Warning, this variable did not exist in XEmacs versions prior to 19.16
461c7ba8286a Import from CVS: tag r19-16-pre1
cvs
parents: 50
diff changeset
61 and 20.3")
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
62
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
63 (defconst emacs-version
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
64 (purecopy
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
65 (format "%d.%d \"%s\"%s%s"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
66 emacs-major-version
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
67 emacs-minor-version
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
68 xemacs-codename
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
69 " XEmacs Lucid"
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
70 (if xemacs-betaname
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
71 (concat " " xemacs-betaname)
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
72 "")))
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
73 "Version numbers of this version of XEmacs.")
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
74
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 48
diff changeset
75
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (defun emacs-version (&optional here) "\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 Return string describing the version of Emacs that is running.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 If optional argument HERE is non-nil, insert string at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 Don't use this function in programs to choose actions according
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 to the system configuration; look at `system-configuration' instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (let ((version-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (format "XEmacs %s [Lucid] (%s) of %s %s on %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (substring emacs-version 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (string-match " XEmacs" emacs-version))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 system-configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (substring emacs-build-time 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (string-match " *[0-9]*:" emacs-build-time))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (substring emacs-build-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (string-match "[0-9]*$" emacs-build-time))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 emacs-build-system)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (if here
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (insert version-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (if (interactive-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (message "%s" version-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 version-string))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ;; from emacs-vers.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (defun emacs-version>= (major &optional minor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 "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
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 The MAJOR version number argument is required, but the MINOR version number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 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
104 symbol `nil') then only the major version numbers are considered in the test."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (if (null minor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (>= emacs-major-version major)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (or (> emacs-major-version major)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (and (= emacs-major-version major)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (>= emacs-minor-version minor))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ;;; We hope that this alias is easier for people to find.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (define-function 'version 'emacs-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ;; Put the emacs version number into the `pure[]' array in a form that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 ;; `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
118 ;; actually need this to be pointed to from lisp; pure objects can't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;; be GCed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (or (memq system-type '(vax-vms windows-nt ms-dos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (purecopy (concat "\n@" "(#)" (emacs-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 "\n@" "(#)" "Configuration: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 system-configuration "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;;Local variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ;;version-control: never
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;;End:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ;;; version.el ends here