From 332062b141b5fcdd259d1041bab1d7bdb82f60c7 Mon Sep 17 00:00:00 2001 From: kaoru Date: Fri, 1 Jan 2010 08:44:31 +0000 Subject: [PATCH] * wl-draft.el (wl-draft-send, wl-draft-do-fcc): Suppress compile warnings; Use `with-current-buffer' instead of `save-excursion' & `set-buffer'. * wl-draft.el (wl-draft-do-fcc): Use `with-temp-buffer'. --- wl/ChangeLog | 5 +++++ wl/wl-draft.el | 18 ++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 91d3bc2..db33950 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -16,6 +16,11 @@ * wl-template.el (wl-template-show): Ditto. * wl-util.el (wl-collect-summary): Ditto. * wl-draft.el (wl-draft-add-in-reply-to, wl-draft-delete): Ditto. + * wl-draft.el (wl-draft-send-mail-with-smtp, wl-draft-send) + (wl-draft-do-fcc): Ditto. + + * wl-draft.el (wl-draft-do-fcc): Use `with-temp-buffer'. + 2009-12-16 Lloyd Zusman diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 4153269..828b50a 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1068,8 +1068,7 @@ non-nil." (newline)) (run-hooks 'wl-mail-send-pre-hook) ;; X-PGP-Sig, Cancel-Lock (if mail-interactive - (save-excursion - (set-buffer errbuf) + (with-current-buffer errbuf (erase-buffer))) (wl-draft-delete-field "bcc" delimline) (wl-draft-delete-field "resent-bcc" delimline) @@ -1319,8 +1318,7 @@ 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) + (with-current-buffer sending-buffer (if (and (not (wl-message-mail-p)) (not (wl-message-news-p))) (error "No recipient is specified")) @@ -1556,15 +1554,12 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (defun wl-draft-do-fcc (header-end &optional fcc-list) (let ((send-mail-buffer (current-buffer)) - (tembuf (generate-new-buffer " fcc output")) (case-fold-search t) beg end) (or (markerp header-end) (error "HEADER-END must be a marker")) - (save-excursion - (unless fcc-list - (setq fcc-list (wl-draft-get-fcc-list header-end))) - (set-buffer tembuf) - (erase-buffer) + (unless fcc-list + (setq fcc-list (wl-draft-get-fcc-list header-end))) + (with-temp-buffer ;; insert just the headers to avoid moving the gap more than ;; necessary (the message body could be arbitrarily huge.) (insert-buffer-substring send-mail-buffer 1 header-end) @@ -1585,8 +1580,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (or (equal (car fcc-list) (car wl-read-folder-history)) (setq wl-read-folder-history (append (list (car fcc-list)) wl-read-folder-history)))) - (setq fcc-list (cdr fcc-list))))) - (kill-buffer tembuf))) + (setq fcc-list (cdr fcc-list))))))) (defun wl-draft-on-field-p () (if (< (point) -- 1.7.10.4