comparison lisp/version.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 74fd4e045ea6
children da8ed4261e83
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
35 "Non-nil when this is a test (beta) version of XEmacs. 35 "Non-nil when this is a test (beta) version of XEmacs.
36 Warning, this variable did not exist in XEmacs versions prior to 20.3") 36 Warning, this variable did not exist in XEmacs versions prior to 20.3")
37 37
38 (defconst emacs-version 38 (defconst emacs-version
39 (purecopy 39 (purecopy
40 (format "%d.%d %s%s%s%s" 40 (format "%d.%d %s%s%s"
41 emacs-major-version 41 emacs-major-version
42 emacs-minor-version 42 emacs-minor-version
43 (if emacs-patch-level 43 (if xemacs-codename
44 (format "(patch %d)" emacs-patch-level) 44 (concat "\"" xemacs-codename "\"")
45 "") 45 "")
46 " XEmacs Lucid"
46 (if xemacs-betaname 47 (if xemacs-betaname
47 (concat " " xemacs-betaname) 48 (concat " " xemacs-betaname)
48 "") 49 "")))
49 (if xemacs-codename
50 (concat " \"" xemacs-codename "\"")
51 "")
52 " XEmacs Lucid"))
53 "Version numbers of this version of XEmacs.") 50 "Version numbers of this version of XEmacs.")
54 51
55 (if (featurep 'infodock) 52 (if (featurep 'infodock)
56 (require 'id-vers)) 53 (require 'id-vers))
57 54
108 ((null arg) version-string) 105 ((null arg) version-string)
109 ((eq arg 1) (message "%s" version-string)) 106 ((eq arg 1) (message "%s" version-string))
110 (t (insert version-string)))))) 107 (t (insert version-string))))))
111 108
112 ;; from emacs-vers.el 109 ;; from emacs-vers.el
113 (defun emacs-version>= (major &optional minor patch) 110 (defun emacs-version>= (major &optional minor)
114 "Return true if the Emacs version is >= to the given MAJOR, MINOR, 111 "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers.
115 and PATCH numbers. 112 The MAJOR version number argument is required, but the MINOR version number
116 The MAJOR version number argument is required, but the other arguments 113 argument is optional. If the minor version number is not specified (or is the
117 argument are optional. Only the Non-nil arguments are used in the test." 114 symbol `nil') then only the major version numbers are considered in the test."
118 (let ((emacs-patch (or emacs-patch-level emacs-beta-version -1))) 115 (if (null minor)
119 (cond ((> emacs-major-version major)) 116 (>= emacs-major-version major)
120 ((< emacs-major-version major) nil) 117 (or (> emacs-major-version major)
121 ((null minor)) 118 (and (= emacs-major-version major)
122 ((> emacs-minor-version minor)) 119 (>= emacs-minor-version minor)))))
123 ((< emacs-minor-version minor) nil)
124 ((null patch))
125 ((>= emacs-patch patch)))))
126 120
127 ;;; We hope that this alias is easier for people to find. 121 ;;; We hope that this alias is easier for people to find.
128 (define-function 'version 'emacs-version) 122 (define-function 'version 'emacs-version)
129 123
130 ;; Put the emacs version number into the `pure[]' array in a form that 124 ;; Put the emacs version number into the `pure[]' array in a form that
131 ;; `what(1)' can extract from the executable or a core file. We don't 125 ;; `what(1)' can extract from the executable or a core file. We don't
132 ;; actually need this to be pointed to from lisp; pure objects can't 126 ;; actually need this to be pointed to from lisp; pure objects can't
133 ;; be GCed. 127 ;; be GCed.
134 (purecopy (concat "\n@" "(#)" (emacs-version) 128 (or (memq system-type '(windows-nt ms-dos))
135 "\n@" "(#)" "Configuration: " 129 (purecopy (concat "\n@" "(#)" (emacs-version)
136 system-configuration "\n")) 130 "\n@" "(#)" "Configuration: "
131 system-configuration "\n")))
137 132
138 ;;Local variables: 133 ;;Local variables:
139 ;;version-control: never 134 ;;version-control: never
140 ;;End: 135 ;;End:
141 136