home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / lisp / prim / inc-vers.el < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.6 KB  |  48 lines

  1. ;; Load this file to increment the recorded Emacs version number.
  2. ;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
  3.  
  4. ;; This file is part of GNU Emacs.
  5.  
  6. ;; GNU Emacs is free software; you can redistribute it and/or modify
  7. ;; it under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation; either version 2, or (at your option)
  9. ;; any later version.
  10.  
  11. ;; GNU Emacs is distributed in the hope that it will be useful,
  12. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;; GNU General Public License for more details.
  15.  
  16. ;; You should have received a copy of the GNU General Public License
  17. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  18. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20.  
  21. (load "startup")
  22. (set-default-load-path)
  23.  
  24. (insert-file-contents "../lisp/version.el")
  25.  
  26. (re-search-forward 
  27.   "emacs-version \"[^\"0-9]*[0-9]+\\.[0-9]+\\(\\.\\([0-9]+\\)\\|\\)\\( (.*)\\)?\"")
  28. (let ((version (if (= (match-beginning 1) (match-end 1))
  29.            (forward-char -1)
  30.          (goto-char (match-beginning 2))
  31.          (read (current-buffer)))))
  32.   (widen)
  33.   (if (null version)
  34.       (insert ".1")
  35.     (delete-region (match-beginning 2) (match-end 2))
  36.     (prin1 (1+ version) (current-buffer))))
  37. (skip-chars-backward "^\"")
  38. (message "New Emacs version will be %s"
  39.      (buffer-substring (point)
  40.                (progn (skip-chars-forward "^\"") (point))))
  41.  
  42.  
  43. (write-region (point-min) (point-max) "../lisp/version.el" nil 'nomsg)
  44. (erase-buffer)
  45. (set-buffer-modified-p nil)
  46.  
  47. (kill-emacs)
  48.