1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 14:30:50 -08:00

Minor refactoring in admin/admin.el

* 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.
This commit is contained in:
Stefan Kangas 2025-02-20 02:13:29 +01:00
parent a8b1726487
commit e9c9ed1f46

View file

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