comparison lisp/version.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 0b7f3b634cf2
children b9518feda344
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
1 ;; Record version number of Emacs. 1 ;; Record version number of Emacs.
2 ;; Copyright (C) 1985, 1991-1994 Free Software Foundation, Inc. 2 ;; Copyright (C) 1985, 1991-1994 Free Software Foundation, Inc.
3 3
4 ;; This file is part of GNU Emacs. 4 ;; This file is part of XEmacs.
5 5
6 ;; GNU Emacs is free software; you can redistribute it and/or modify 6 ;; XEmacs is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by 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) 8 ;; the Free Software Foundation; either version 2, or (at your option)
9 ;; any later version. 9 ;; any later version.
10 10
11 ;; GNU Emacs is distributed in the hope that it will be useful, 11 ;; XEmacs is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details. 14 ;; GNU General Public License for more details.
15 15
16 ;; You should have received a copy of the GNU General Public License 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 17 ;; along with GNU Emacs; see the file COPYING. If not, write to the
18 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 ;; Free Software Foundation Inc., 59 Temple Place - Suite 330,
19 ;; Boston, MA 02111-1307, USA.
19 20
20 ;;; Synched up with: FSF 19.30. 21 ;;; Synched up with: FSF 19.30.
21 22
22 ;;; Code: 23 ;;; Code:
23 24
24 ;; The following line is modified automatically 25 (defconst emacs-version "20.0"
25 ;; by loading inc-version.el, each time a new Emacs is dumped. 26 "Version numbers of this version of Emacs.")
26 ;; (defconst emacs-version "19.16" "\
27 ;; Version numbers of this version of Emacs.")
28 27
29 ;; (setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta90)"))) 28 (setq emacs-version (purecopy (concat emacs-version " XEmacs Lucid (beta30)")))
30 29
31 ;(defconst emacs-major-version 30 (defconst emacs-major-version
32 ; (progn (or (string-match "^[0-9]+" emacs-version) 31 (progn (or (string-match "^[0-9]+" emacs-version)
33 ; (error "emacs-version unparsable")) 32 (error "emacs-version unparsable"))
34 ; (string-to-int (match-string 0 emacs-version))) 33 (string-to-int (match-string 0 emacs-version)))
35 ; "Major version number of this version of Emacs, as an integer. 34 "Major version number of this version of Emacs, as an integer.
36 ;Warning, this variable did not exist in Emacs versions earlier than: 35 Warning, this variable did not exist in Emacs versions earlier than:
37 ; FSF Emacs: 19.23 36 FSF Emacs: 19.23
38 ; XEmacs: 19.10") 37 XEmacs: 19.10")
39 38
40 ;(defconst emacs-minor-version 39 (defconst emacs-minor-version
41 ; (progn (or (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version) 40 (progn (or (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)
42 ; (error "emacs-version unparsable")) 41 (error "emacs-version unparsable"))
43 ; (string-to-int (match-string 1 emacs-version))) 42 (string-to-int (match-string 1 emacs-version)))
44 ; "Minor version number of this version of Emacs, as an integer. 43 "Minor version number of this version of Emacs, as an integer.
45 ;Warning, this variable did not exist in Emacs versions earlier than: 44 Warning, this variable did not exist in Emacs versions earlier than:
46 ; FSF Emacs: 19.23 45 FSF Emacs: 19.23
47 ; XEmacs: 19.10") 46 XEmacs: 19.10")
48 47
49 (defconst emacs-build-time (current-time-string) "\ 48 (defconst emacs-build-time (current-time-string)
50 Time at which Emacs was dumped out.") 49 "Time at which Emacs was dumped out.")
51 50
52 (defconst emacs-build-system (system-name)) 51 (defconst emacs-build-system (system-name))
53 52
54 (defconst xemacs-betaname nil 53 (defun emacs-version (&optional arg)
55 "Non-nil when this is a test (beta) version of XEmacs. 54 "Return string describing the version of Emacs that is running.
56 Warning, this variable did not exist in XEmacs versions prior to 20.3") 55 When called interactively with a prefix argument, insert string at point.
57
58 (defconst xemacs-codename "Lille"
59 "Symbolic name of XEmacs build.
60 Warning, this variable did not exist in XEmacs versions prior to 19.16
61 and 20.3")
62
63 (defconst emacs-version
64 (purecopy
65 (format "%d.%d \"%s\"%s%s"
66 emacs-major-version
67 emacs-minor-version
68 xemacs-codename
69 " XEmacs Lucid"
70 (if xemacs-betaname
71 (concat " " xemacs-betaname)
72 "")))
73 "Version numbers of this version of XEmacs.")
74
75
76 (defun emacs-version (&optional here) "\
77 Return string describing the version of Emacs that is running.
78 If optional argument HERE is non-nil, insert string at point.
79 Don't use this function in programs to choose actions according 56 Don't use this function in programs to choose actions according
80 to the system configuration; look at `system-configuration' instead." 57 to the system configuration; look at `system-configuration' instead."
81 (interactive "P") 58 (interactive "p")
82 (let ((version-string 59 (let ((version-string
83 (format "XEmacs %s [Lucid] (%s) of %s %s on %s" 60 (format
84 (substring emacs-version 0 61 "XEmacs %s [Lucid] (%s%s) of %s %s on %s"
85 (string-match " XEmacs" emacs-version)) 62 (substring emacs-version 0 (string-match " XEmacs" emacs-version))
86 system-configuration 63 system-configuration
87 (substring emacs-build-time 0 64 (cond ((featurep 'mule) ", Mule") (t ""))
88 (string-match " *[0-9]*:" emacs-build-time)) 65 (substring emacs-build-time 0
89 (substring emacs-build-time 66 (string-match " *[0-9]*:" emacs-build-time))
90 (string-match "[0-9]*$" emacs-build-time)) 67 (substring emacs-build-time
91 emacs-build-system))) 68 (string-match "[0-9]*$" emacs-build-time))
92 (if here 69 emacs-build-system)))
93 (insert version-string) 70 (cond
94 (if (interactive-p) 71 ((null arg) version-string)
95 (message "%s" version-string) 72 ((eq arg 1) (message "%s" version-string))
96 version-string)))) 73 (t (insert version-string)))))
97 74
98 ;; from emacs-vers.el 75 ;; from emacs-vers.el
99 (defun emacs-version>= (major &optional minor) 76 (defun emacs-version>= (major &optional minor)
100 "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers. 77 "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers.
101
102 The MAJOR version number argument is required, but the MINOR version number 78 The MAJOR version number argument is required, but the MINOR version number
103 argument is optional. If the minor version number is not specified (or is the 79 argument is optional. If the minor version number is not specified (or is the
104 symbol `nil') then only the major version numbers are considered in the test." 80 symbol `nil') then only the major version numbers are considered in the test."
105 (if (null minor) 81 (if (null minor)
106 (>= emacs-major-version major) 82 (>= emacs-major-version major)
107 (or (> emacs-major-version major) 83 (or (> emacs-major-version major)
108 (and (= emacs-major-version major) 84 (and (= emacs-major-version major)
109 (>= emacs-minor-version minor)) 85 (>= emacs-minor-version minor)))))
110 )
111 ))
112 86
113 ;;; We hope that this alias is easier for people to find. 87 ;;; We hope that this alias is easier for people to find.
114 (define-function 'version 'emacs-version) 88 (define-function 'version 'emacs-version)
115 89
116 ;; Put the emacs version number into the `pure[]' array in a form that 90 ;; Put the emacs version number into the `pure[]' array in a form that