1 ;; version.el --- Record version number of SXEmacs.
3 ;; Copyright (C) 1985, 1991-1994, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 2004 Steve Youngs.
6 ;; Maintainer: SXEmacs Development Team
7 ;; Keywords: internal, dumped
9 ;; This file is part of SXEmacs.
11 ;; SXEmacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; SXEmacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
24 ;;; Synched up with: not synched.
28 ;; This file is dumped with SXEmacs.
32 (defconst sxemacs-betaname
33 (and emacs-beta-version (format "(beta%d)" emacs-beta-version))
34 "Non-nil when this is a test (beta) version of XEmacs.
35 Warning, this variable did not exist in XEmacs versions prior to 20.3")
37 (defconst emacs-version (concat "SXEmacs: " sxemacs-git-version)
38 "Version numbers of this version of XEmacs.")
40 ;; Sadly, our `emacs-version' causes a problem for Dired. This is because
41 ;; Dired uses some regex matching against `emacs-version' instead of simply
42 ;; using the "standard" `emacs-*-version' variables. The following trivial
43 ;; patch to dired.el will fix Dired for you. I have already been in touch
44 ;; with the Dired maintainers about this. --SY.
46 ;; --- dired.el.orig 2004-10-03 07:15:32.000000000 +1000
47 ;; +++ dired.el 2004-12-13 16:06:47.000000000 +1000
49 ;; ;; it been since Lucid went away?
50 ;; (let ((lucid-p (string-match "XEmacs" emacs-version))
52 ;; - (or (string-match "^\\([0-9]+\\)\\.\\([0-9]+\\)" emacs-version)
53 ;; + (or (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)" emacs-version)
54 ;; (error "dired does not work with emacs version %s" emacs-version))
55 ;; (setq ver (string-to-int (substring emacs-version (match-beginning 1)
57 ;; @@ -6617,7 +6617,7 @@
59 ;; (let ((lucid-p (string-match "XEmacs" emacs-version))
61 ;; - (or (string-match "^\\([0-9]+\\)\\." emacs-version)
62 ;; + (or (string-match "\\([0-9]+\\)\\." emacs-version)
63 ;; (error "Weird emacs version %s" emacs-version))
64 ;; (setq ver (string-to-int (substring emacs-version (match-beginning 1)
67 (if (featurep 'infodock)
70 (defconst emacs-build-time (current-time-string)
71 "Time at which Emacs was dumped out.")
73 (defconst emacs-build-system (system-name))
75 (defun emacs-version (&optional arg)
76 "Return string describing the version of Emacs that is running.
77 When called interactively with a prefix argument, insert string at point.
78 Don't use this function in programs to choose actions according
79 to the system configuration; look at `system-configuration' instead."
84 "SXEmacs: %s, built %s on %s"
89 ((null arg) version-string)
90 ((eq arg 1) (message "%s" version-string))
91 (t (insert version-string))))))
94 (defun emacs-version>= (major &optional minor patch)
95 "Return true if the Emacs version is >= to the given MAJOR, MINOR,
97 The MAJOR version number argument is required, but the other arguments
98 argument are optional. Only the Non-nil arguments are used in the test."
99 (let ((emacs-patch (or emacs-patch-level emacs-beta-version -1)))
100 (cond ((> emacs-major-version major))
101 ((< emacs-major-version major) nil)
103 ((> emacs-minor-version minor))
104 ((< emacs-minor-version minor) nil)
106 ((>= emacs-patch patch)))))
108 ;;; We hope that this alias is easier for people to find.
109 (define-function 'version 'emacs-version)
111 ;; Put the emacs version number into the `pure[]' array in a form that
112 ;; `what(1)' can extract from the executable or a core file. We don't
113 ;; actually need this to be pointed to from lisp; pure objects can't
115 (concat "\n@" "(#)" (emacs-version)
116 "\n@" "(#)" "Configuration: "
117 system-configuration "\n")
122 ;;version-control: never
125 ;;; version.el ends here