emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117100: admin.el tweaks


From: Glenn Morris
Subject: [Emacs-diffs] emacs-24 r117100: admin.el tweaks
Date: Sat, 10 May 2014 21:59:09 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117100
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: emacs-24
timestamp: Sat 2014-05-10 14:59:05 -0700
message:
  admin.el tweaks
  
  * admin/admin.el (set-version-in-file): Don't set identical version.
  (set-version): Provide default version number.
  (set-version, set-copyright): Give start/end messages.
modified:
  admin/ChangeLog                changelog-20091113204419-o5vbwnq5f7feedwu-2226
  admin/admin.el                 admin.el-20091113204419-o5vbwnq5f7feedwu-2254
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog   2014-04-17 21:20:51 +0000
+++ b/admin/ChangeLog   2014-05-10 21:59:05 +0000
@@ -1,3 +1,9 @@
+2014-05-10  Glenn Morris  <address@hidden>
+
+       * admin.el (set-version-in-file): Don't set identical version.
+       (set-version): Provide default version number.
+       (set-version, set-copyright): Give start/end messages.
+
 2014-04-17  Paul Eggert  <address@hidden>
 
        * notes/bzr: Update instructions for merging from gnulib.

=== modified file 'admin/admin.el'
--- a/admin/admin.el    2014-01-13 22:21:32 +0000
+++ b/admin/admin.el    2014-05-10 21:59:05 +0000
@@ -65,17 +65,25 @@
   "Subroutine of `set-version' and `set-copyright'."
   (find-file (expand-file-name file root))
   (goto-char (point-min))
+  (setq version (format "%s" version))
   (unless (re-search-forward rx nil :noerror)
     (user-error "Version not found in %s" file))
-  (replace-match (format "%s" version) nil nil nil 1))
+  (if (not (equal version (match-string 1)))
+      (replace-match version nil nil nil 1)
+    (kill-buffer)
+    (message "No need to update `%s'" file)))
 
-;; TODO report the progress
 (defun set-version (root version)
   "Set Emacs version to VERSION in relevant files under ROOT.
 Root must be the root of an Emacs source tree."
-  (interactive "DEmacs root directory: \nsVersion number: ")
+  (interactive (list
+               (read-directory-name "Emacs root directory: " source-directory)
+               (read-string "Version number: "
+                            (replace-regexp-in-string "\\.[0-9]+\\'" ""
+                                                      emacs-version))))
   (unless (file-exists-p (expand-file-name "src/emacs.c" root))
     (user-error "%s doesn't seem to be the root of an Emacs source tree" root))
+  (message "Setting version numbers...")
   ;; There's also a "version 3" (standing for GPLv3) at the end of
   ;; `README', but since `set-version-in-file' only replaces the first
   ;; occurrence, it won't be replaced.
@@ -158,11 +166,10 @@
 {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")
       (set-version-in-file root "etc/refcards/emacsver.tex" version
                           "\\\\def\\\\versionemacs\
-{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs"))))
-
+{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")))
+  (message "Setting version numbers...done"))
 
 ;; Note this makes some assumptions about form of short copyright.
-;; TODO report the progress
 (defun set-copyright (root copyright)
   "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT.
 Root must be the root of an Emacs source tree."
@@ -174,6 +181,7 @@
                          (format-time-string "%Y")))))
   (unless (file-exists-p (expand-file-name "src/emacs.c" root))
     (user-error "%s doesn't seem to be the root of an Emacs source tree" root))
+  (message "Setting copyrights...")
   (set-version-in-file root "configure.ac" copyright
                       (rx (and bol "copyright" (0+ (not (in ?\")))
                                ?\" (submatch (1+ (not (in ?\")))) ?\")))
@@ -195,7 +203,8 @@
 {\\([0-9]\\{4\\}\\)}.+%.+copyright year")
     (set-version-in-file root "etc/refcards/emacsver.tex" copyright
                         "\\\\def\\\\year\
-{\\([0-9]\\{4\\}\\)}.+%.+copyright year")))
+{\\([0-9]\\{4\\}\\)}.+%.+copyright year"))
+  (message "Setting copyrights...done"))
 
 ;;; Various bits of magic for generating the web manuals
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]