From dc79e8a12609d5b8c38b1c86ae124678fe0ae0c3 Mon Sep 17 00:00:00 2001 From: yoichi Date: Fri, 28 Feb 2003 14:29:37 +0000 Subject: [PATCH] * wl-draft.el (wl-draft-send-confirm): Rewritten. Invoke preview when `wl-draft-send-confirm-with-preview' is non-nil. You can scroll up/down by j/k. (wl-draft-send-confirm-with-preview): New variable (default=t). --- wl/ChangeLog | 7 +++++++ wl/wl-draft.el | 54 ++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index d8cac23..baf193b 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,10 @@ +2003-02-28 Yoichi NAKAYAMA + + * wl-draft.el (wl-draft-send-confirm): Rewritten. Invoke preview + when `wl-draft-send-confirm-with-preview' is non-nil. + You can scroll up/down by j/k. + (wl-draft-send-confirm-with-preview): New variable (default=t). + 2003-02-26 Yoichi NAKAYAMA * wl-fldmgr.el (wl-fldmgr-folders-header): Add more comment. diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 43b4d8c..a572663 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1237,21 +1237,47 @@ If FORCE-MSGID, insert message-id regardless of `wl-insert-message-id'." (setq locals (cdr locals))) result)) +(defcustom wl-draft-send-confirm-with-preview t + "Non-nil to invoke preview through confirmation of sending. +This variable is valid when `wl-interactive-send' has non-nil value." + :type 'boolean + :group 'wl-draft) + (defun wl-draft-send-confirm () - (let (result answer) - (save-excursion - (goto-char (point-min)) ; to show recipients in header - (message "Send current draft? ") - (setq answer (let ((cursor-in-echo-area t)) (read-char)))) - (cond - ((or (eq answer (string-to-char "y")) - (eq answer (string-to-char "Y")) - (eq answer (string-to-char " "))) - (setq result t)) - ((or (eq answer (string-to-char "p")) - (eq answer (string-to-char "P"))) - (wl-draft-preview-message))) - result)) + (let (answer) + (unwind-protect + (condition-case quit + (progn + (when wl-draft-send-confirm-with-preview + (wl-draft-preview-message)) + (save-excursion + (goto-char (point-min)) ; to show recipients in header + (catch 'done + (while t + (message "Send current draft? ") + (setq answer (let ((cursor-in-echo-area t)) (read-char))) + (cond + ((or (eq answer ?y) + (eq answer ?Y) + (eq answer ? )) + (throw 'done t)) + ((or (eq answer ?v) + (eq answer ?j) + (eq answer ?J)) + (condition-case err + (scroll-up) + (error nil))) + ((or (eq answer ?^) + (eq answer ?k) + (eq answer ?K)) + (condition-case err + (scroll-down) + (error nil))) + (t + (throw 'done nil))))))) + (quit nil)) + (when wl-draft-send-confirm-with-preview + (mime-preview-quit))))) (defun wl-draft-send (&optional kill-when-done mes-string) "Send current draft message. -- 1.7.10.4