home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / prim / inc-vers.el < prev    next >
Encoding:
Text File  |  1995-05-12  |  1.7 KB  |  55 lines

  1. ;;; inc-vers.el --- load this to increment the recorded XEmacs version number.
  2.  
  3. ;; Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc.
  4.  
  5. ;; Maintainer: FSF
  6. ;; Keywords: internal
  7.  
  8. ;; This file is part of XEmacs.
  9.  
  10. ;; XEmacs is free software; you can redistribute it and/or modify it
  11. ;; 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. ;; XEmacs is distributed in the hope that it will be useful, but
  16. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18. ;; General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with XEmacs; see the file COPYING.  If not, write to the Free
  22. ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  
  24.  
  25. ;;; Code:
  26.  
  27. (insert-file-contents "../lisp/version.el")
  28.  
  29. (re-search-forward 
  30.   "emacs-version \"[^\"0-9]*[0-9]+\\.[0-9]+\\(\\.\\([0-9]+\\)\\|\\)\\( (.*)\\)?\"")
  31. (let ((version (if (= (match-beginning 1) (match-end 1))
  32.            (forward-char -1)
  33.          (goto-char (match-beginning 2))
  34.          (read (current-buffer)))))
  35.   (if (null version)
  36.       (insert ".1")
  37.     (delete-region (match-beginning 2) (match-end 2))
  38.     (prin1 (1+ version) (current-buffer))))
  39. (skip-chars-backward "^\"")
  40. (message "New XEmacs version will be %s"
  41.      (buffer-substring (point)
  42.                (progn (skip-chars-forward "^\"") (point))))
  43.  
  44.  
  45. (if (and (file-accessible-directory-p "../lisp/")
  46.      (null (file-writable-p "../lisp/version.el")))
  47.     (delete-file "../lisp/version.el"))
  48. (write-region (point-min) (point-max) "../lisp/version.el" nil 'nomsg)
  49. (erase-buffer)
  50. (set-buffer-modified-p nil)
  51.  
  52. (kill-emacs)
  53.  
  54. ;;; inc-vers.el ends here
  55.