From ab79cbf40d798f74389b39a04aba343300953282 Mon Sep 17 00:00:00 2001 From: kaoru Date: Wed, 7 Mar 2001 07:06:28 +0000 Subject: [PATCH] * wl-draft.el (wl-draft-random-alphabet): Removed. (wl-draft-confirm): Don't use conditonal statement in `format' argument; Use gettext style. (wl-draft-insert-x-face-field): Refactoring; Use guard statement for error case. --- wl/ChangeLog | 8 ++++++++ wl/wl-draft.el | 36 ++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 34ea19b..f6309d4 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,11 @@ +2001-03-07 TAKAHASHI Kaoru + + * wl-draft.el (wl-draft-random-alphabet): Removed. + (wl-draft-confirm): Don't use conditonal statement + in `format' argument; Use gettext style. + (wl-draft-insert-x-face-field): Refactoring; Use guard statement + for error case. + 2001-03-05 Katsumi Yamaoka * wl-demo.el (wl-demo): Reset `tab-width' and `tab-stop-list' to diff --git a/wl/wl-draft.el b/wl/wl-draft.el index a52f558..6ff5675 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -174,13 +174,13 @@ (defun wl-draft-insert-x-face-field () "Insert X-Face header." (interactive) - (if (not (file-exists-p wl-x-face-file)) - (error "File %s does not exist" wl-x-face-file) - (beginning-of-buffer) - (search-forward mail-header-separator nil t) - (beginning-of-line) - (wl-draft-insert-x-face-field-here) - (run-hooks 'wl-draft-insert-x-face-field-hook))) ; highlight it if you want. + (unless (file-exists-p wl-x-face-file) + (error "File %s does not exist" wl-x-face-file)) + (beginning-of-buffer) + (search-forward mail-header-separator nil t) + (beginning-of-line) + (wl-draft-insert-x-face-field-here) + (run-hooks 'wl-draft-insert-x-face-field-hook)) ; highlight it if you want. (defun wl-draft-insert-x-face-field-here () "Insert X-Face field at point." @@ -453,15 +453,11 @@ Reply to author if WITH-ARG is non-nil." (defun wl-draft-confirm () "Confirm send message." (interactive) - (y-or-n-p (format "Send current draft as %s? " - (cond ((and (wl-message-mail-p) (wl-message-news-p)) - "Mail and News") - ((wl-message-mail-p) "Mail") - ((wl-message-news-p) "News"))))) - -(defun wl-message-news-p () - "If exist valid Newsgroups field, return non-nil." - (std11-field-body "Newsgroups")) + (y-or-n-p + (cond ((and (wl-message-mail-p) (wl-message-news-p)) + "Send current draft as Mail and News? ") + ((wl-message-mail-p) "Send current draft as Mail? ") + ((wl-message-news-p) "Send current draft as News? ")))) (defun wl-message-field-exists-p (field) "If FIELD exist and FIELD value is not empty, return non-nil." @@ -469,6 +465,10 @@ Reply to author if WITH-ARG is non-nil." (and value (not (string= value ""))))) +(defun wl-message-news-p () + "If exist valid Newsgroups field, return non-nil." + (std11-field-body "Newsgroups")) + (defun wl-message-mail-p () "If exist To, Cc or Bcc field, return non-nil." (or (wl-message-field-exists-p "To") @@ -1270,10 +1270,6 @@ If optional argument is non-nil, current draft buffer is killed" nil (if (re-search-forward ":" pos t) nil t))))))) -(defun wl-draft-random-alphabet () - (let ((alphabet '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z))) - (nth (abs (% (random) 26)) alphabet))) - ;;;###autoload (defun wl-draft (&optional to subject in-reply-to cc references newsgroups mail-followup-to -- 1.7.10.4