From 8c16bd8c3566df3b0cbbc28692a23a378604f423 Mon Sep 17 00:00:00 2001 From: Deepak Goel Date: Thu, 6 Dec 2007 17:56:42 +0000 Subject: [PATCH] Fix buggy calls to `error'. --- lisp/ChangeLog | 22 ++++++++++++++++++++++ lisp/allout.el | 2 +- lisp/bindings.el | 2 +- lisp/dired.el | 2 +- lisp/ediff-init.el | 4 ++-- lisp/ibuffer.el | 2 +- lisp/man.el | 4 ++-- lisp/vc-cvs.el | 2 +- lisp/vc-mcvs.el | 2 +- lisp/vc.el | 4 ++-- lisp/wdired.el | 2 +- lisp/whitespace.el | 4 ++-- 12 files changed, 37 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4c1132d0184..1f36c708900 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,25 @@ +2007-12-06 D. Goel + + * whitespace.el (whitespace-write-file-hook): Ditto. + + * wdired.el (wdired-check-kill-buffer): Ditto. + + * vc.el (vc-update): Ditto. + + * vc-mcvs.el (vc-mcvs-checkin): Ditto. + + * vc-cvs.el (vc-cvs-checkin): Ditto. + + * man.el (Man-bgproc-sentinel): Ditto. + (Man-goto-see-also-section): Ditto. + + * ibuffer.el (ibuffer-current-buffer): Ditto. + + * dired.el (dired-move-to-end-of-filename): Ditto. + + * bindings.el (complete-symbol): Ditto. + + * allout.el (allout-write-file-hook-handler): Fix buggy call(s) to `error'. 2007-12-06 D. Goel diff --git a/lisp/allout.el b/lisp/allout.el index 8878c56735f..c0175032bd8 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1501,7 +1501,7 @@ See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.") (condition-case failure (setq allout-after-save-decrypt (allout-encrypt-decrypted except-mark)) - (error (progn + (error "%s" (progn (message "allout-write-file-hook-handler suppressing error %s" failure) diff --git a/lisp/bindings.el b/lisp/bindings.el index ca9f03c4c7c..435c935a69c 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -616,7 +616,7 @@ language you are using." (if (fboundp 'complete-tag) (complete-tag) ;; Don't autoload etags if we have no tags table. - (error (substitute-command-keys + (error "%s" (substitute-command-keys "No tags table loaded; use \\[visit-tags-table] to load one"))))) ;; Reduce total amount of space we must allocate during this function diff --git a/lisp/dired.el b/lisp/dired.el index ab56579e718..51067e46001 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2009,7 +2009,7 @@ Return the position of the beginning of the filename, or nil if none found." (forward-char -1)))) (or no-error (not (eq opoint (point))) - (error (if hidden + (error "%s" (if hidden (substitute-command-keys "File line is hidden, type \\[dired-hide-subdir] to unhide") "No file on this line"))) diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index b46562b5fde..91c8f41bb13 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el @@ -1576,7 +1576,7 @@ This default should work without changes." ) ((ediff-key-press-event-p event) (point)) - (t (error nil)))) + (t (error "Error")))) (defun ediff-event-buffer (event) (cond ((ediff-mouse-event-p event) @@ -1587,7 +1587,7 @@ This default should work without changes." ) ((ediff-key-press-event-p event) (current-buffer)) - (t (error nil)))) + (t (error "Error")))) (defun ediff-event-key (event-or-key) (ediff-cond-compile-for-xemacs-or-emacs diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index b09a3e26979..7ee2c973cfe 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1392,7 +1392,7 @@ If point is on a group name, this function operates on that group." (when must-be-live (if (bufferp buf) (unless (buffer-live-p buf) - (error (substitute-command-keys "Buffer %s has been killed; use `\\[ibuffer-update]' to update") buf)) + (error "%s" (substitute-command-keys "Buffer %s has been killed; use `\\[ibuffer-update]' to update") buf)) (error "No buffer on this line"))) buf)) diff --git a/lisp/man.el b/lisp/man.el index 41f1d37bb18..c3621be1c97 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1077,7 +1077,7 @@ manpage command." (Man-notify-when-ready Man-buffer)) (if err-mess - (error err-mess)) + (error "%s" err-mess)) )))) @@ -1338,7 +1338,7 @@ Returns t if section is found, nil otherwise." Actually the section moved to is described by `Man-see-also-regexp'." (interactive) (if (not (Man-find-section Man-see-also-regexp)) - (error (concat "No " Man-see-also-regexp + (error "%s" (concat "No " Man-see-also-regexp " section found in the current manpage")))) (defun Man-possibly-hyphenated-word () diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index c9c50fceba2..6d57a329b0c 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -351,7 +351,7 @@ its parents." ((re-search-forward "Up-to-date check failed" nil t) (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge)) files) - (error (substitute-command-keys + (error "%s" (substitute-command-keys (concat "Up-to-date check failed: " "type \\[vc-next-action] to merge in changes")))) (t diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el index b5a81866eca..c3b68f8aeaf 100644 --- a/lisp/vc-mcvs.el +++ b/lisp/vc-mcvs.el @@ -294,7 +294,7 @@ This is only possible if Meta-CVS is responsible for FILE's directory.") ((re-search-forward "Up-to-date check failed" nil t) (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge)) files) - (error (substitute-command-keys + (error "%s" (substitute-command-keys (concat "Up-to-date check failed: " "type \\[vc-next-action] to merge in changes")))) (t diff --git a/lisp/vc.el b/lisp/vc.el index 622c9682fbc..b54373a4e22 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -2619,10 +2619,10 @@ changes from the current branch are merged into the working file." (vc-checkout file nil "") (if (eq (vc-checkout-model file) 'locking) (if (eq (vc-state file) 'edited) - (error + (error "%s" (substitute-command-keys "File is locked--type \\[vc-revert] to discard changes")) - (error + (error "%s" (substitute-command-keys "Unexpected file state (%s)--type \\[vc-next-action] to correct") (vc-state file))) diff --git a/lisp/wdired.el b/lisp/wdired.el index 39d27d57848..2ab9306da43 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -492,7 +492,7 @@ Optional arguments are ignored." (if (and (buffer-modified-p) (not (y-or-n-p "Buffer changed. Discard changes and kill buffer? "))) - (error nil))) + (error "Error."))) (defun wdired-next-line (arg) "Move down lines then position at filename or the current column. diff --git a/lisp/whitespace.el b/lisp/whitespace.el index f6c94534a00..896668fd569 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -789,8 +789,8 @@ This is meant to be added buffer-locally to `write-file-functions'." (whitespace-cleanup-internal) (setq werr (whitespace-buffer))) (if (and whitespace-abort-on-error werr) - (error (concat "Abort write due to whitespaces in " - buffer-file-name)))) + (error "Abort write due to whitespaces in %s" + buffer-file-name))) nil) (defun whitespace-unload-function () -- 2.39.2