Mercurial > hg > xemacs-beta
comparison lisp/version.el @ 0:376386a54a3c r19-14
Import from CVS: tag r19-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:45:50 +0200 |
parents | |
children | ac2d302a0011 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:376386a54a3c |
---|---|
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. | |
26 (defconst emacs-version "19.14" "\ | |
27 Version numbers of this version of Emacs.") | |
28 | |
29 (setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid"))) | |
30 | |
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") | |
39 | |
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") | |
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 | |
54 (defun emacs-version (&optional here) "\ | |
55 Return string describing the version of Emacs that is running. | |
56 If optional argument HERE is non-nil, insert string at point. | |
57 Don't use this function in programs to choose actions according | |
58 to the system configuration; look at `system-configuration' instead." | |
59 (interactive "P") | |
60 (let ((version-string | |
61 (format "XEmacs %s [Lucid] (%s) of %s %s on %s" | |
62 (substring emacs-version 0 | |
63 (string-match " XEmacs" emacs-version)) | |
64 system-configuration | |
65 (substring emacs-build-time 0 | |
66 (string-match " *[0-9]*:" emacs-build-time)) | |
67 (substring emacs-build-time | |
68 (string-match "[0-9]*$" emacs-build-time)) | |
69 emacs-build-system))) | |
70 (if here | |
71 (insert version-string) | |
72 (if (interactive-p) | |
73 (message "%s" version-string) | |
74 version-string)))) | |
75 | |
76 ;; from emacs-vers.el | |
77 (defun emacs-version>= (major &optional minor) | |
78 "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers. | |
79 | |
80 The MAJOR version number argument is required, but the MINOR version number | |
81 argument is optional. If the minor version number is not specified (or is the | |
82 symbol `nil') then only the major version numbers are considered in the test." | |
83 (if (null minor) | |
84 (>= emacs-major-version major) | |
85 (or (> emacs-major-version major) | |
86 (and (= emacs-major-version major) | |
87 (>= emacs-minor-version minor)) | |
88 ) | |
89 )) | |
90 | |
91 ;;; We hope that this alias is easier for people to find. | |
92 (define-function 'version 'emacs-version) | |
93 | |
94 ;; Put the emacs version number into the `pure[]' array in a form that | |
95 ;; `what(1)' can extract from the executable or a core file. We don't | |
96 ;; actually need this to be pointed to from lisp; pure objects can't | |
97 ;; be GCed. | |
98 (or (memq system-type '(vax-vms windows-nt ms-dos)) | |
99 (purecopy (concat "\n@" "(#)" (emacs-version) | |
100 "\n@" "(#)" "Configuration: " | |
101 system-configuration "\n"))) | |
102 | |
103 ;;Local variables: | |
104 ;;version-control: never | |
105 ;;End: | |
106 | |
107 ;;; version.el ends here |