diff options
author | Xue Fuqiao <xfq.free@gmail.com> | 2013-12-24 12:41:18 +0800 |
---|---|---|
committer | Xue Fuqiao <xfq.free@gmail.com> | 2013-12-24 12:41:18 +0800 |
commit | dedfb7f8eebcb436bf1d92014f7f11cacece6ac6 (patch) | |
tree | c7b5a8e24c0a2109d36b30e48675ac4545c9e690 /admin | |
parent | 642d7ae8fcbd2fd4c6aabc05e1347507d5d50014 (diff) | |
download | emacs-dedfb7f8eebcb436bf1d92014f7f11cacece6ac6.tar.gz |
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')
-rw-r--r-- | admin/ChangeLog | 6 | ||||
-rw-r--r-- | admin/admin.el | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index 63ed9bfbd6c..40d1e069f03 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,9 @@ +2013-12-24 Xue Fuqiao <xfq.free@gmail.com> + + * admin.el (add-release-logs): + (set-version-in-file, set-version, set-copyright): + Use `user-error'. + 2013-12-22 Eli Zaretskii <eliz@gnu.org> * unidata/unidata-gen.el (unidata-split-name): Don't give any NAME 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 @@ ;; add-release-logs Add ``Version X released'' change log entries. ;; set-version Change Emacs version number in source tree. -;; set-copyright Change emacs short copyright string (eg as +;; set-copyright Change Emacs short copyright string (eg as ;; printed by --version) in source tree. ;;; Code: @@ -46,7 +46,7 @@ Optional argument DATE is the release date, default today." (funcall add-log-time-format)))))) (setq root (expand-file-name root)) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) - (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)) (require 'add-log) (or date (setq date (let ((add-log-time-zone-rule t)) (funcall add-log-time-format)))) @@ -62,10 +62,11 @@ Optional argument DATE is the release date, default today." (insert entry)))) (defun set-version-in-file (root file version rx) + "Subroutine of `set-version'." (find-file (expand-file-name file root)) (goto-char (point-min)) - (unless (re-search-forward rx nil t) - (error "Version not found in %s" file)) + (unless (re-search-forward rx nil :noerror) + (user-error "Version not found in %s" file)) (replace-match (format "%s" version) nil nil nil 1)) (defun set-version (root version) @@ -73,7 +74,7 @@ Optional argument DATE is the release date, default today." Root must be the root of an Emacs source tree." (interactive "DEmacs root directory: \nsVersion number: ") (unless (file-exists-p (expand-file-name "src/emacs.c" root)) - (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)) (set-version-in-file root "README" version (rx (and "version" (1+ space) (submatch (1+ (in "0-9.")))))) @@ -167,7 +168,7 @@ Root must be the root of an Emacs source tree." (format "Copyright (C) %s Free Software Foundation, Inc." (format-time-string "%Y"))))) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) - (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)) (set-version-in-file root "configure.ac" copyright (rx (and bol "copyright" (0+ (not (in ?\"))) ?\" (submatch (1+ (not (in ?\")))) ?\"))) |