+2001-03-07 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * 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 <yamaoka@jpl.org>
* wl-demo.el (wl-demo): Reset `tab-width' and `tab-stop-list' to
(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."
(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."
(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")
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