]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor refactoring in admin/admin.el
authorStefan Kangas <stefankangas@gmail.com>
Thu, 20 Feb 2025 01:13:29 +0000 (02:13 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Mar 2025 20:48:16 +0000 (21:48 +0100)
* admin/admin.el (admin--read-root-directory):
(admin--read-version): New functions.
(add-release-logs, set-version, set-copyright, make-manuals)
(make-manuals-dist, make-news-html-file): Use above new function.

(cherry picked from commit e9c9ed1f46853793cb4b064718c990cc2cd17f59)

admin/admin.el

index 80aface4a9f90007f7c7921194be472056690776..b2c8ffb26ef5367cd3ddf9990a1ebfad5ce9eddf 100644 (file)
 
 (defvar add-log-time-format)           ; in add-log
 
+(defun admin--read-root-directory ()
+  (read-directory-name "Emacs root directory: "
+                       source-directory nil t))
+
+(defun admin--read-version ()
+  (read-string "Version number: " emacs-version))
+
 (defun add-release-logs (root version &optional date)
   "Add \"Version VERSION released.\" change log entries in ROOT.
 Also update the etc/HISTORY file.
 Root must be the root of an Emacs source tree.
 Optional argument DATE is the release date, default today."
-  (interactive (list (read-directory-name "Emacs root directory: ")
+  (interactive (list (admin--read-root-directory)
                     (read-string "Version number: "
                                  (format "%s.%s" emacs-major-version
                                          emacs-minor-version))
@@ -94,9 +101,8 @@ Optional argument DATE is the release date, default today."
 (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 (list
-               (read-directory-name "Emacs root directory: " source-directory)
-               (read-string "Version number: " emacs-version)))
+  (interactive (list (admin--read-root-directory)
+                    (admin--read-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))
   (unless admin-git-command
@@ -213,9 +219,9 @@ Documentation changes might not have been completed!"))))
         (dolist (s '("Installation Changes" "Startup Changes" "Changes"
                      "Editing Changes"
                      "Changes in Specialized Modes and Packages"
-                          "New Modes and Packages"
-                          "Incompatible Lisp Changes"
-                          "Lisp Changes"))
+                     "New Modes and Packages"
+                     "Incompatible Lisp Changes"
+                     "Lisp Changes"))
           (insert (format "\n\f\n* %s in Emacs %s\n" s newshort)))
         (insert (format "\n\f\n* Changes in Emacs %s on \
 Non-Free Operating Systems\n" newshort)))
@@ -230,7 +236,7 @@ Non-Free Operating Systems\n" newshort)))
   "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT.
 Root must be the root of an Emacs source tree."
   (interactive (list
-                (read-directory-name "Emacs root directory: " nil nil t)
+                (admin--read-root-directory)
                 (read-string
                  "Short copyright string: "
                  (format "Copyright (C) %s Free Software Foundation, Inc."
@@ -289,8 +295,7 @@ Optional argument TYPE is type of output (nil means all)."
                       (if noninteractive
                           (or (pop command-line-args-left)
                               default-directory)
-                        (read-directory-name "Emacs root directory: "
-                                             source-directory nil t))))
+                        (admin--read-root-directory))))
                 (list root
                       (if current-prefix-arg
                           (completing-read
@@ -772,8 +777,7 @@ Optional argument TYPE is type of output (nil means all)."
                       (if noninteractive
                           (or (pop command-line-args-left)
                               default-directory)
-                        (read-directory-name "Emacs root directory: "
-                                             source-directory nil t))))
+                        (admin--read-root-directory))))
                 (list root
                       (if current-prefix-arg
                           (completing-read