diff options
| author | Xue Fuqiao | 2013-12-24 12:41:18 +0800 |
|---|---|---|
| committer | Xue Fuqiao | 2013-12-24 12:41:18 +0800 |
| commit | dedfb7f8eebcb436bf1d92014f7f11cacece6ac6 (patch) | |
| tree | c7b5a8e24c0a2109d36b30e48675ac4545c9e690 /admin/admin.el | |
| parent | 642d7ae8fcbd2fd4c6aabc05e1347507d5d50014 (diff) | |
| download | emacs-dedfb7f8eebcb436bf1d92014f7f11cacece6ac6.tar.gz emacs-dedfb7f8eebcb436bf1d92014f7f11cacece6ac6.zip | |
Change some `error's to `user-error's.
* admin/admin.el (add-release-logs):
(set-version-in-file, set-version, set-copyright):
Use `user-error'.
Diffstat (limited to 'admin/admin.el')
| -rw-r--r-- | admin/admin.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/admin/admin.el b/admin/admin.el index f8ca8aec261..228a8570a77 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | ;; add-release-logs Add ``Version X released'' change log entries. | 22 | ;; add-release-logs Add ``Version X released'' change log entries. |
| 23 | ;; set-version Change Emacs version number in source tree. | 23 | ;; set-version Change Emacs version number in source tree. |
| 24 | ;; set-copyright Change emacs short copyright string (eg as | 24 | ;; set-copyright Change Emacs short copyright string (eg as |
| 25 | ;; printed by --version) in source tree. | 25 | ;; printed by --version) in source tree. |
| 26 | 26 | ||
| 27 | ;;; Code: | 27 | ;;; Code: |
| @@ -46,7 +46,7 @@ Optional argument DATE is the release date, default today." | |||
| 46 | (funcall add-log-time-format)))))) | 46 | (funcall add-log-time-format)))))) |
| 47 | (setq root (expand-file-name root)) | 47 | (setq root (expand-file-name root)) |
| 48 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | 48 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
| 49 | (error "%s doesn't seem to be the root of an Emacs source tree" root)) | 49 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) |
| 50 | (require 'add-log) | 50 | (require 'add-log) |
| 51 | (or date (setq date (let ((add-log-time-zone-rule t)) | 51 | (or date (setq date (let ((add-log-time-zone-rule t)) |
| 52 | (funcall add-log-time-format)))) | 52 | (funcall add-log-time-format)))) |
| @@ -62,10 +62,11 @@ Optional argument DATE is the release date, default today." | |||
| 62 | (insert entry)))) | 62 | (insert entry)))) |
| 63 | 63 | ||
| 64 | (defun set-version-in-file (root file version rx) | 64 | (defun set-version-in-file (root file version rx) |
| 65 | "Subroutine of `set-version'." | ||
| 65 | (find-file (expand-file-name file root)) | 66 | (find-file (expand-file-name file root)) |
| 66 | (goto-char (point-min)) | 67 | (goto-char (point-min)) |
| 67 | (unless (re-search-forward rx nil t) | 68 | (unless (re-search-forward rx nil :noerror) |
| 68 | (error "Version not found in %s" file)) | 69 | (user-error "Version not found in %s" file)) |
| 69 | (replace-match (format "%s" version) nil nil nil 1)) | 70 | (replace-match (format "%s" version) nil nil nil 1)) |
| 70 | 71 | ||
| 71 | (defun set-version (root version) | 72 | (defun set-version (root version) |
| @@ -73,7 +74,7 @@ Optional argument DATE is the release date, default today." | |||
| 73 | Root must be the root of an Emacs source tree." | 74 | Root must be the root of an Emacs source tree." |
| 74 | (interactive "DEmacs root directory: \nsVersion number: ") | 75 | (interactive "DEmacs root directory: \nsVersion number: ") |
| 75 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | 76 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
| 76 | (error "%s doesn't seem to be the root of an Emacs source tree" root)) | 77 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) |
| 77 | (set-version-in-file root "README" version | 78 | (set-version-in-file root "README" version |
| 78 | (rx (and "version" (1+ space) | 79 | (rx (and "version" (1+ space) |
| 79 | (submatch (1+ (in "0-9.")))))) | 80 | (submatch (1+ (in "0-9.")))))) |
| @@ -167,7 +168,7 @@ Root must be the root of an Emacs source tree." | |||
| 167 | (format "Copyright (C) %s Free Software Foundation, Inc." | 168 | (format "Copyright (C) %s Free Software Foundation, Inc." |
| 168 | (format-time-string "%Y"))))) | 169 | (format-time-string "%Y"))))) |
| 169 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | 170 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
| 170 | (error "%s doesn't seem to be the root of an Emacs source tree" root)) | 171 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) |
| 171 | (set-version-in-file root "configure.ac" copyright | 172 | (set-version-in-file root "configure.ac" copyright |
| 172 | (rx (and bol "copyright" (0+ (not (in ?\"))) | 173 | (rx (and bol "copyright" (0+ (not (in ?\"))) |
| 173 | ?\" (submatch (1+ (not (in ?\")))) ?\"))) | 174 | ?\" (submatch (1+ (not (in ?\")))) ?\"))) |