comparison lisp/version.el @ 414:da8ed4261e83 r21-2-15

Import from CVS: tag r21-2-15
author cvs
date Mon, 13 Aug 2007 11:21:38 +0200
parents 697ef44129c6
children
comparison
equal deleted inserted replaced
413:901169e5ca31 414:da8ed4261e83
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" 40 (format "%d.%d %s%s%s%s"
41 emacs-major-version 41 emacs-major-version
42 emacs-minor-version 42 emacs-minor-version
43 (if xemacs-codename 43 (if emacs-patch-level
44 (concat "\"" xemacs-codename "\"") 44 (format "(patch %d)" emacs-patch-level)
45 "") 45 "")
46 " XEmacs Lucid"
47 (if xemacs-betaname 46 (if xemacs-betaname
48 (concat " " xemacs-betaname) 47 (concat " " xemacs-betaname)
49 ""))) 48 "")
49 (if xemacs-codename
50 (concat " \"" xemacs-codename "\"")
51 "")
52 " XEmacs Lucid"))
50 "Version numbers of this version of XEmacs.") 53 "Version numbers of this version of XEmacs.")
51 54
52 (if (featurep 'infodock) 55 (if (featurep 'infodock)
53 (require 'id-vers)) 56 (require 'id-vers))
54 57
105 ((null arg) version-string) 108 ((null arg) version-string)
106 ((eq arg 1) (message "%s" version-string)) 109 ((eq arg 1) (message "%s" version-string))
107 (t (insert version-string)))))) 110 (t (insert version-string))))))
108 111
109 ;; from emacs-vers.el 112 ;; from emacs-vers.el
110 (defun emacs-version>= (major &optional minor) 113 (defun emacs-version>= (major &optional minor patch)
111 "Return true if the Emacs version is >= to the given MAJOR and MINOR numbers. 114 "Return true if the Emacs version is >= to the given MAJOR, MINOR,
112 The MAJOR version number argument is required, but the MINOR version number 115 and PATCH numbers.
113 argument is optional. If the minor version number is not specified (or is the 116 The MAJOR version number argument is required, but the other arguments
114 symbol `nil') then only the major version numbers are considered in the test." 117 argument are optional. Only the Non-nil arguments are used in the test."
115 (if (null minor) 118 (let ((emacs-patch (or emacs-patch-level emacs-beta-version -1)))
116 (>= emacs-major-version major) 119 (cond ((> emacs-major-version major))
117 (or (> emacs-major-version major) 120 ((< emacs-major-version major) nil)
118 (and (= emacs-major-version major) 121 ((null minor))
119 (>= emacs-minor-version minor))))) 122 ((> emacs-minor-version minor))
123 ((< emacs-minor-version minor) nil)
124 ((null patch))
125 ((>= emacs-patch patch)))))
120 126
121 ;;; We hope that this alias is easier for people to find. 127 ;;; We hope that this alias is easier for people to find.
122 (define-function 'version 'emacs-version) 128 (define-function 'version 'emacs-version)
123 129
124 ;; Put the emacs version number into the `pure[]' array in a form that 130 ;; Put the emacs version number into the `pure[]' array in a form that