From 63ea8dd728fab75ceafe73274909e3da6e96a41a Mon Sep 17 00:00:00 2001 From: kaoru Date: Sun, 15 Jun 2003 14:02:35 +0000 Subject: [PATCH] `message' and `error' take format string. --- elmo/ChangeLog | 5 +++++ elmo/acap.el | 9 +++++---- elmo/elmo-imap4.el | 14 +++++++------- elmo/elmo-nntp.el | 2 +- elmo/elmo-util.el | 4 ++-- elmo/pldap.el | 36 ++++++++++++++++++------------------ wl/ChangeLog | 5 +++++ wl/wl-draft.el | 23 +++++++++++++---------- wl/wl-expire.el | 16 ++++++++-------- wl/wl-mime.el | 7 +++---- wl/wl-summary.el | 26 ++++++++++++-------------- wl/wl-util.el | 2 +- 12 files changed, 80 insertions(+), 69 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 98d3ff1..b8a54a4 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2003-06-15 TAKAHASHI Kaoru + + * acap.el, elmo-imap4.el, elmo-nntp.el, elmo-util.el, pldap.el: + `message' and `error' take format string. + 2003-02-01 TAKAHASHI Kaoru * elmo-localdir.el (elmo-folder-rename-internal): Referctoring; diff --git a/elmo/acap.el b/elmo/acap.el index 4948740..df0dbe4 100644 --- a/elmo/acap.el +++ b/elmo/acap.el @@ -550,7 +550,8 @@ ENTRIES is a store-entry list." (when (acap-response-bye-p acap-response) (if acap-logging-out (setq acap-response nil) - (error (prog1 (acap-response-bye-message acap-response) + (error "%s" + (prog1 (acap-response-bye-message acap-response) (setq acap-response nil))))) (or (and (not (memq (process-status process) '(open run))) (sit-for 1)) @@ -814,8 +815,8 @@ ENTRIES is a store-entry list." (acap-forward) (acap-parse-return-data-list))))) (ALERT ;(cons 'alert (acap-parse-resp-body)) - (message (nth 1 (acap-parse-resp-body)))) - ((BYE Bye bye) + (message "%s" (nth 1 (acap-parse-resp-body)))) + ((BYE Bye bye) (cons 'bye (acap-parse-resp-body))) (CHANGE (cons 'change (list (acap-parse-quoted) @@ -837,7 +838,7 @@ ENTRIES is a store-entry list." (NO (cons 'stat-no (acap-parse-resp-body))) (BAD ;(cons 'stat-bad (acap-parse-resp-body)) ;; XXX cyrus-sml-acap does not return tagged bad response? - (error (nth 1 (acap-parse-resp-body)))))) + (error "%s" (nth 1 (acap-parse-resp-body)))))) ((integerp token) ;; tagged response. (setq tag token) diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 41ea9b4..1dacabe 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -354,7 +354,7 @@ TAG is the tag of the command" (elmo-imap4-response-bye-p elmo-imap4-current-response) (when (elmo-imap4-response-garbage-p elmo-imap4-current-response) - (message "Garbage response: %s" + (message "Garbage response: %s" (elmo-imap4-response-value elmo-imap4-current-response 'garbage)) @@ -696,9 +696,9 @@ Returns response value if selecting folder succeed. " (elmo-imap4-response-bye-p response)) (elmo-imap4-process-bye session) (unless no-error - (error (or - (elmo-imap4-response-error-text response) - (format "Select %s failed" mailbox))))))) + (error "%s" + (or (elmo-imap4-response-error-text response) + (format "Select %s failed" mailbox))))))) (and result response)))) (defun elmo-imap4-check-validity (spec validity-file) @@ -2378,9 +2378,9 @@ If optional argument REMOVE is non-nil, remove FLAG." (elmo-imap4-session-set-current-mailbox-internal session nil) (if (elmo-imap4-response-bye-p response) (elmo-imap4-process-bye session) - (error (or - (elmo-imap4-response-error-text response) - (format "Select %s failed" mailbox))))) + (error "%s" + (or (elmo-imap4-response-error-text response) + (format "Select %s failed" mailbox))))) (message "Selecting %s...done" (elmo-folder-name-internal folder)) (elmo-folder-set-msgdb-internal diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index d18689d..7f4e265 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -1048,7 +1048,7 @@ Don't cache if nil.") (if (not (string-match "^2" (setq response (elmo-nntp-read-raw-response session)))) - (error (concat "NNTP error: " response)))))) + (error "NNTP error: %s" response))))) (defsubst elmo-nntp-send-data-line (session line) "Send LINE to SESSION." diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index b468759..c34b7e7 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -765,7 +765,7 @@ the directory becomes empty after deletion." (defun elmo-list-diff (list1 list2 &optional mes) (if mes - (message mes)) + (message "%s" mes)) (let ((clist1 (copy-sequence list1)) (clist2 (copy-sequence list2))) (while list2 @@ -775,7 +775,7 @@ the directory becomes empty after deletion." (setq clist2 (delq (car list1) clist2)) (setq list1 (cdr list1))) (if mes - (message (concat mes "done"))) + (message "%sdone" mes)) (list clist1 clist2))) (defun elmo-list-bigger-diff (list1 list2 &optional mes) diff --git a/elmo/pldap.el b/elmo/pldap.el index e8b944b..1d6d65f 100644 --- a/elmo/pldap.el +++ b/elmo/pldap.el @@ -509,12 +509,12 @@ DN is the distinguished name of the entry to delete." nil (current-buffer) t (append arglist (list dn)))) - (if (integerp ret) - (if (not (zerop ret)) - (error (car (split-string (buffer-string) "\n")))) - (if (and (setq ret (buffer-string)); Nemacs - (string-match "ldap_delete:" ret)) - (error (car (split-string ret "\n")))))))) + (cond ((integerp ret) + (or (zerop ret) + (error "%s" (car (split-string (buffer-string) "\n"))))) + ((and (setq ret (buffer-string)); Nemacs + (string-match "ldap_delete:" ret)) + (error "%s" (car (split-string ret "\n")))))))) (defmacro ldap/ldif-insert-field (attr value) (` (if (not (ldap/ldif-safe-string-p (, value))) @@ -567,12 +567,12 @@ or `replace'. ATTR is the LDAP attribute type to modify." ldap-modify-program t t nil arglist)) - (if (integerp ret) - (if (not (zerop ret)) - (error (car (split-string (buffer-string) "\n")))) - (if (and (setq ret (buffer-string)); Nemacs - (string-match "ldap_modify:" ret)) - (error (car (split-string ret "\n")))))))) + (cond ((integerp ret) + (or (zerop ret) + (error "%s" (car (split-string (buffer-string) "\n"))))) + ((and (setq ret (buffer-string)); Nemacs + (string-match "ldap_modify:" ret)) + (error "%s" (car (split-string ret "\n")))))))) (defun ldap-add (ldap dn entry) "Add an entry to an LDAP directory. @@ -607,12 +607,12 @@ containing attribute/value string pairs." ldap-add-program t t nil arglist)) - (if (integerp ret) - (if (not (zerop ret)) - (error (car (split-string (buffer-string) "\n")))) - (if (and (setq ret (buffer-string)) ; Nemacs - (string-match "ldap_add:" ret)) - (error (car (split-string ret "\n")))))))) + (cond ((integerp ret) + (or (zerop ret) + (error "%s" (car (split-string (buffer-string) "\n"))))) + ((and (setq ret (buffer-string)) ; Nemacs + (string-match "ldap_add:" ret)) + (error "%s" (car (split-string ret "\n")))))))) (defun ldap-search-basic (ldap filter base scope &optional attrs attrsonly withdn verbose) diff --git a/wl/ChangeLog b/wl/ChangeLog index a01b567..8e44e7c 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2003-06-15 TAKAHASHI Kaoru + + * wl-draft.el, wl-expire.el, wl-mime.el, wl-summary.el, wl-util.el: + `message' and `error' take format string. + 2003-04-09 Yoichi NAKAYAMA * wl-util.el (wl-as-coding-system): Define for non-mule too. diff --git a/wl/wl-draft.el b/wl/wl-draft.el index de4dd80..6d4fb08 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1171,7 +1171,7 @@ If FORCE-MSGID, insert message-id regardless of `wl-insert-message-id'." "Send the message in the current buffer. Not modified the header fields." (let (delimline mime-bcc) (if (and wl-draft-verbose-send mes-string) - (message mes-string)) + (message "%s" mes-string)) ;; get fcc folders. (setq delimline (wl-draft-get-header-delimiter t)) (unless wl-draft-fcc-list @@ -1229,10 +1229,11 @@ If FORCE-MSGID, insert message-id regardless of `wl-insert-message-id'." (setq wl-draft-verbose-msg (format "Sending%s and Queuing%s..." sent-via unplugged-via)) - (message (concat wl-draft-verbose-msg "done"))) + (message "%sdone" wl-draft-verbose-msg)) (if mes-string - (message (concat mes-string - (if sent-via "done" "failed"))))))))) + (message "%s%s" + mes-string + (if sent-via "done" "failed")))))))) (not wl-sent-message-modified)) ;; return value (defun wl-draft-raw-send (&optional kill-when-done force-pre-hook mes-string) @@ -1278,11 +1279,12 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (wl-draft-verbose-msg nil) err) (unwind-protect - (save-excursion (set-buffer sending-buffer) + (save-excursion + (set-buffer sending-buffer) (if (and (not (wl-message-mail-p)) (not (wl-message-news-p))) (error "No recipient is specified")) - (expand-abbrev) ; for mail-abbrevs + (expand-abbrev) ; for mail-abbrevs (let ((mime-header-encode-method-alist (append '((wl-draft-eword-encode-address-list @@ -1293,7 +1295,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" ) ;; (if wl-draft-verbose-send - (message (or mes-string "Sending..."))) + (message "%s" mes-string "Sending...")) (funcall wl-draft-send-function editing-buffer kill-when-done) ;; Now perform actions on successful sending. (while mail-send-actions @@ -1303,9 +1305,10 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (error)) (setq mail-send-actions (cdr mail-send-actions))) (if wl-draft-verbose-send - (message (concat (or wl-draft-verbose-msg - mes-string "Sending...") - "done")))) + (message "%sdone" + (or wl-draft-verbose-msg + mes-string + "Sending...")))) ;; kill sending buffer, anyway. (and (buffer-live-p sending-buffer) (kill-buffer sending-buffer)))))) diff --git a/wl/wl-expire.el b/wl/wl-expire.el index 165e07e..829f8d3 100644 --- a/wl/wl-expire.el +++ b/wl/wl-expire.el @@ -115,8 +115,8 @@ (wl-expire-append-log (elmo-folder-name-internal folder) delete-list nil 'delete) - (message "%s" (concat mess "done"))) - (error (concat mess "failed!"))))) + (message "%sdone" mess)) + (error "%sfailed!" mess)))) (cons delete-list (length delete-list))) (defun wl-expire-refile (folder refile-list msgdb dst-folder @@ -157,8 +157,8 @@ refile-list (elmo-folder-name-internal dst-folder) (if copy 'copy 'move)) - (message "%s" (concat mess "done"))) - (error (concat mess "failed!")))))) + (message "%sdone" mess)) + (error "%sfailed!" mess))))) (cons refile-list (length refile-list)))) (defun wl-expire-refile-with-copy-reserve-msg @@ -233,8 +233,8 @@ If REFILE-LIST includes reserve mark message, so copy." (elmo-folder-name-internal dst-folder) (length refile-list)))) (if ret-val - (message (concat mes "done")) - (error (concat mes "failed!"))))) + (message "%sdone" mes) + (error "%sfailed!" mes)))) (cons refile-list copy-len)))) (defun wl-expire-archive-get-folder (src-folder &optional fmt dst-folder-arg) @@ -591,11 +591,11 @@ ex. +ml/wl/1999_11/, +ml/wl/1999_12/." (wl-expire-delete-reserve-marked-msgs-from-list hide-list (elmo-msgdb-get-mark-alist msgdb)))) (let ((mess (format "Hiding %s msgs..." (length hide-list)))) - (message mess) + (message "%s" mess) (elmo-msgdb-delete-msgs (elmo-folder-msgdb folder) hide-list) (elmo-msgdb-append-to-killed-list folder hide-list) (elmo-folder-commit folder) - (message (concat mess "done")) + (message "%sdone" mess) (cons hide-list (length hide-list)))) (defsubst wl-expire-folder-p (entity) diff --git a/wl/wl-mime.el b/wl/wl-mime.el index bcd10d9..e7370ad 100644 --- a/wl/wl-mime.el +++ b/wl/wl-mime.el @@ -128,9 +128,8 @@ It calls following-method selected from variable (if (functionp f) (funcall f new-buf) (message - (format - "Sorry, following method for %s is not implemented yet." - mode)) + "Sorry, following method for %s is not implemented yet." + mode) )) ))) @@ -187,7 +186,7 @@ It calls following-method selected from variable (when wl-highlight-body-too (wl-highlight-body)) (run-hooks 'wl-draft-preview-message-hook)) - (message recipients-message))) + (message "%s" recipients-message))) (defalias 'wl-draft-caesar-region 'mule-caesar-region) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 24ad93a..6a00eec 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -406,7 +406,6 @@ See also variable `wl-use-petname'." (define-key wl-summary-mode-map "g" 'wl-summary-goto-folder) (define-key wl-summary-mode-map "G" 'wl-summary-goto-folder-sticky) (define-key wl-summary-mode-map "c" 'wl-summary-mark-as-read-all) -; (define-key wl-summary-mode-map "D" 'wl-summary-drop-unsync) (define-key wl-summary-mode-map "a" 'wl-summary-reply) (define-key wl-summary-mode-map "A" 'wl-summary-reply-with-citation) @@ -825,7 +824,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (wl-mode-line-buffer-identification '(wl-summary-buffer-mode-line)) (easy-menu-add wl-summary-mode-menu) (when wl-summary-lazy-highlight - (if wl-on-xemacs + (if wl-on-xemacs (progn (make-local-variable 'pre-idle-hook) (add-hook 'pre-idle-hook 'wl-highlight-summary-window)) @@ -1949,7 +1948,7 @@ If ARG is non-nil, checking is omitted." (while diffs (wl-summary-mark-as-unread (car diffs) 'no-server 'no-modeline) (setq diffs (cdr diffs))) - (if (interactive-p) (message mes))))) + (if (interactive-p) (message "%s" mes))))) (defun wl-summary-sync-update (&optional unset-cursor sync-all no-check) "Update the summary view to the newest folder status." @@ -3127,14 +3126,13 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." (wl-summary-toggle-disp-msg 'off) (setq wl-message-buffer nil)) (set-buffer-modified-p nil) - (message (concat "Executing...done" - (if (> refile-failures 0) - (format " (%d refiling failed)" refile-failures) - "") - (if (> copy-failures 0) - (format " (%d copying failed)" copy-failures) - "") - ".")))))) + (message "Executing...done%s%s" + (if (> refile-failures 0) + (format " (%d refiling failed)" refile-failures) + "") + (if (> copy-failures 0) + (format " (%d copying failed)" copy-failures) + "")))))) (defun wl-summary-read-folder (default &optional purpose ignore-error no-create init) @@ -4707,7 +4705,7 @@ Return t if message exists." (wl-summary-buffer-folder-name) original 'no-sync)) (cond ((eq wl-summary-search-via-nntp 'confirm) (require 'elmo-nntp) - (message "Search message in nntp server \"%s\" ?" + (message "Search message in nntp server \"%s\" ? " elmo-nntp-default-server) (setq schar (read-char)) (cond ((eq schar ?y) @@ -4717,12 +4715,12 @@ Return t if message exists." msgid (read-from-minibuffer "NNTP Server: "))) (t - (message errmsg) + (message "%s" errmsg) nil))) (wl-summary-search-via-nntp (wl-summary-jump-to-msg-by-message-id-via-nntp msgid)) (t - (message errmsg) + (message "%s" errmsg) nil)))))) (defun wl-summary-jump-to-msg-by-message-id-via-nntp (&optional id server-spec) diff --git a/wl/wl-util.el b/wl/wl-util.el index 9f8714b..6f86ff3 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -154,7 +154,7 @@ If HACK-ADDRESSES is t, then the strings are considered to be mail addresses, (cmd (if (featurep 'xemacs) (event-to-character last-command-event) (string-to-char (format "%s" (this-command-keys)))))) - (message mes-string) + (message "%s" mes-string) (setq key (car (setq keve (wl-read-event-char)))) (if (or (equal key ?\ ) (and cmd -- 1.7.10.4