home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / emacs-18.59-bin.lha / lib / emacs / 18.59 / lisp / inc-vers.el < prev    next >
Lisp/Scheme  |  1991-09-15  |  2KB  |  55 lines

  1. ;; Load this file to increment the recorded Emacs version number.
  2. ;; Copyright (C) 1985, 1986 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 1, 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. ;; Find the file version.el in the path for lisp files, 
  22. ;; and set version-file.
  23. (setq version-file nil)
  24. (setq temp (mapcar '(lambda (dir)
  25.               (cons dir (file-exists-p (expand-file-name "version.el" dir))))
  26.            load-path))
  27. (while temp
  28.   (and (cdr (car temp)) (null version-file)
  29.        (setq version-file (expand-file-name "version.el" (car (car temp)))))
  30.   (setq temp (cdr temp)))
  31.       
  32. (insert-file-contents version-file)
  33.  
  34. (re-search-forward "emacs-version \"[^\"]*[0-9]+\"")
  35. (forward-char -1)
  36. (save-excursion
  37.   (save-restriction
  38.     (narrow-to-region (point)
  39.               (progn (skip-chars-backward "0-9") (point)))
  40.     (goto-char (point-min))
  41.     (let ((version (read (current-buffer))))
  42.       (delete-region (point-min) (point-max))
  43.       (prin1 (1+ version) (current-buffer)))))
  44. (skip-chars-backward "^\"")
  45. (message "New Emacs version will be %s"
  46.      (buffer-substring (point)
  47.                (progn (skip-chars-forward "^\"") (point))))
  48.  
  49.  
  50. (write-region (point-min) (point-max) version-file nil 'nomsg)
  51. (erase-buffer)
  52. (set-buffer-modified-p nil)
  53.  
  54. (kill-emacs)
  55.