0
|
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 ;;; Synched up with: Not in FSF.
|
|
25
|
|
26 ;;; Code:
|
|
27
|
|
28 (insert-file-contents "../lisp/version.el")
|
|
29
|
|
30 (re-search-forward
|
|
31 "emacs-version \"[^\"0-9]*[0-9]+\\.[0-9]+\\(\\.\\([0-9]+\\)\\|\\)\\( (.*)\\)?\"")
|
|
32 (let ((version (if (= (match-beginning 1) (match-end 1))
|
|
33 (forward-char -1)
|
|
34 (goto-char (match-beginning 2))
|
|
35 (read (current-buffer)))))
|
|
36 (if (null version)
|
|
37 (insert ".1")
|
|
38 (delete-region (match-beginning 2) (match-end 2))
|
|
39 (prin1 (1+ version) (current-buffer))))
|
|
40 (skip-chars-backward "^\"")
|
|
41 (message "New XEmacs version will be %s"
|
|
42 (buffer-substring (point)
|
|
43 (progn (skip-chars-forward "^\"") (point))))
|
|
44
|
|
45
|
|
46 (if (and (file-accessible-directory-p "../lisp/")
|
|
47 (null (file-writable-p "../lisp/version.el")))
|
|
48 (delete-file "../lisp/version.el"))
|
|
49 (write-region (point-min) (point-max) "../lisp/version.el" nil 'nomsg)
|
|
50 (erase-buffer)
|
|
51 (set-buffer-modified-p nil)
|
|
52
|
|
53 (kill-emacs)
|
|
54
|
|
55 ;;; inc-vers.el ends here
|