1 ;;; version.el --- record version number of Emacs.
3 ;;; Copyright (C) 1985, 1992, 1994, 1995, 1999 Free Software Foundation, Inc.
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 (defconst emacs-version
"21.0.90" "\
28 Version numbers of this version of Emacs.")
30 (defconst emacs-major-version
31 (progn (string-match "^[0-9]+" emacs-version
)
32 (string-to-int (match-string 0 emacs-version
)))
33 "Major version number of this version of Emacs.
34 This variable first existed in version 19.23.")
36 (defconst emacs-minor-version
37 (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version
)
38 (string-to-int (match-string 1 emacs-version
)))
39 "Minor version number of this version of Emacs.
40 This variable first existed in version 19.23.")
42 (defconst emacs-build-time
(current-time) "\
43 Time at which Emacs was dumped out.")
45 (defconst emacs-build-system
(system-name))
47 (defun emacs-version (&optional here
) "\
48 Return string describing the version of Emacs that is running.
49 If optional argument HERE is non-nil, insert string at point.
50 Don't use this function in programs to choose actions according
51 to the system configuration; look at `system-configuration' instead."
54 (format (if (not (interactive-p))
55 "GNU Emacs %s (%s%s)\n of %s on %s"
56 "GNU Emacs %s (%s%s) of %s on %s")
59 (cond ((featurep 'motif
) ", Motif")
60 ((featurep 'x-toolkit
) ", X toolkit")
62 (format-time-string "%a %Y-%m-%d" emacs-build-time
)
65 (insert version-string
)
67 (message "%s" version-string
)
70 ;;; We hope that this alias is easier for people to find.
71 (defalias 'version
'emacs-version
)
73 ;;; We put version info into the executable in the form that ident(1) uses.
74 (or (memq system-type
'(vax-vms windows-nt
))
75 (purecopy (concat "\n$Id: " (subst-char-in-string ?
\n ?
(emacs-version))
79 ;;version-control: never
82 ;;; version.el ends here