home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / a2.0bemacs-src.lha / Emacs-19.25 / lisp / version.el < prev    next >
Encoding:
Text File  |  1995-01-10  |  2.7 KB  |  76 lines

  1. ;;; version.el --- record version number of Emacs.
  2.  
  3. ;;; Copyright (C) 1985, 1992, 1994 Free Software Foundation, Inc.
  4.  
  5. ;; Maintainer: FSF
  6. ;; Keywords: internal
  7.  
  8. ;; This file is part of GNU Emacs.
  9.  
  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)
  13. ;; any later version.
  14.  
  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.
  19.  
  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
  22. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  
  24. ;;; Code:
  25.  
  26. (defconst emacs-version "19.25" "\
  27. Version numbers of this version of Emacs.")
  28.  
  29. (defconst emacs-major-version
  30.   (progn (string-match "^[0-9]+" emacs-version)
  31.          (string-to-int (substring emacs-version
  32.                                    (match-beginning 0) (match-end 0))))
  33.   "Major version number of this version of Emacs.
  34. This variable first existed in version 19.23.")
  35.  
  36. (defconst emacs-minor-version
  37.   (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)
  38.          (string-to-int (substring emacs-version
  39.                                    (match-beginning 1) (match-end 1))))
  40.   "Minor version number of this version of Emacs.
  41. This variable first existed in version 19.23.")
  42.  
  43. (defconst emacs-build-time (current-time-string) "\
  44. Time at which Emacs was dumped out.")
  45.  
  46. (defconst emacs-build-system (system-name))
  47.  
  48. (defun emacs-version  (&optional here) "\
  49. Return string describing the version of Emacs that is running.
  50. If optional argument HERE is non-nil, insert string at point.
  51. Don't use this function in programs to choose actions according
  52. to the system configuration; look at `system-configuration' instead."
  53.   (interactive "P")
  54.   (let ((version-string
  55.          (format "GNU Emacs %s of %s %s on %s (%s)"
  56.                  emacs-version
  57.                  (substring emacs-build-time 0
  58.                             (string-match " *[0-9]*:" emacs-build-time))
  59.                  (substring emacs-build-time
  60.                             (string-match "[0-9]*$" emacs-build-time))
  61.                  emacs-build-system system-configuration)))
  62.     (if here
  63.         (insert version-string)
  64.       (if (interactive-p)
  65.           (message "%s" (emacs-version))
  66.         version-string))))
  67.  
  68. ;;; We hope that this alias is easier for people to find.
  69. (fset 'version 'emacs-version)
  70.  
  71. ;;Local variables:
  72. ;;version-control: never
  73. ;;End:
  74.  
  75. ;;; version.el ends here
  76.