From 9eadbe460e8fd478bc73a9c72114d1681c87297a Mon Sep 17 00:00:00 2001 From: kaoru Date: Fri, 1 Jan 2010 08:06:39 +0000 Subject: [PATCH] * wl.el (wl-plugged-change): Suppress compile warnings; Use `with-current-buffer' instead of `save-excursion' & `set-buffer'. * wl-action.el (wl-summary-exec-action-resend-subr): Ditto. * wl-address.el (wl-complete-window-show): Ditto. * wl-message.el (wl-message-select-buffer): Ditto. * wl-template.el (wl-template-show): Ditto. * wl-util.el (wl-collect-summary): Ditto. --- wl/ChangeLog | 8 ++++++++ wl/wl-action.el | 3 +-- wl/wl-address.el | 3 +-- wl/wl-message.el | 4 ++-- wl/wl-template.el | 3 +-- wl/wl-util.el | 3 +-- wl/wl.el | 3 +-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 9ccbd73..0f45a89 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -8,6 +8,14 @@ * wl-util.el (wl-collect-summary): Use `eq' instead of `equal' for symbol. + * wl.el (wl-plugged-change): Suppress compile warnings; Use + `with-current-buffer' instead of `save-excursion' & `set-buffer'. + * wl-action.el (wl-summary-exec-action-resend-subr): Ditto. + * wl-address.el (wl-complete-window-show): Ditto. + * wl-message.el (wl-message-select-buffer): Ditto. + * wl-template.el (wl-template-show): Ditto. + * wl-util.el (wl-collect-summary): Ditto. + 2009-12-16 Lloyd Zusman * wl-summary.el (wl-summary-detect-mark-position): Force diff --git a/wl/wl-action.el b/wl/wl-action.el index 008649e..b6e45e9 100644 --- a/wl/wl-action.el +++ b/wl/wl-action.el @@ -544,9 +544,8 @@ Return number if put mark succeed" "Resend the message with NUMBER to ADDRESS." (message "Resending message to %s..." address) (let ((folder wl-summary-buffer-elmo-folder)) - (save-excursion + (with-current-buffer (get-buffer-create " *wl-draft-resend*") ;; We first set up a normal mail buffer. - (set-buffer (get-buffer-create " *wl-draft-resend*")) (set-buffer-multibyte nil) (erase-buffer) (setq wl-sent-message-via nil) diff --git a/wl/wl-address.el b/wl/wl-address.el index 69abb20..3f7dbb9 100644 --- a/wl/wl-address.el +++ b/wl/wl-address.el @@ -365,8 +365,7 @@ Matched address lists are append to CL." (if (and (get-buffer-window wl-completion-buf-name) (equal wl-complete-candidates all)) (let ((win (get-buffer-window wl-completion-buf-name))) - (save-excursion - (set-buffer wl-completion-buf-name) + (with-current-buffer wl-completion-buf-name (if (pos-visible-in-window-p (point-max) win) (set-window-start win 1) (scroll-other-window)))) diff --git a/wl/wl-message.el b/wl/wl-message.el index c7c22cd..c49281e 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -208,8 +208,8 @@ Return its cache buffer." (mes (cdr wl-message-window-size)) whi) (when (and window - (not (eq (save-excursion (set-buffer (window-buffer window)) - wl-message-buffer-cur-summary-buffer) + (not (eq (with-current-buffer (window-buffer window) + wl-message-buffer-cur-summary-buffer) (current-buffer)))) (delete-window window) (run-hooks 'wl-message-window-deleted-hook) diff --git a/wl/wl-template.el b/wl/wl-template.el index cac3404..a17c4a7 100644 --- a/wl/wl-template.el +++ b/wl/wl-template.el @@ -135,8 +135,7 @@ Entering WL-Template mode calls the value of `wl-template-mode-hook'." (defun wl-template-show (&optional arg) "Show reference INDEX in `wl-template-alist'. ARG is ignored." ; ARG ignored this version (?) - (save-excursion - (set-buffer wl-template-buffer-name) + (with-current-buffer wl-template-buffer-name (let ((buffer-read-only nil) (wl-template-preview t) (mail-header-separator "--header separater--")) diff --git a/wl/wl-util.el b/wl/wl-util.el index d5288a0..a27671e 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -519,8 +519,7 @@ that `read' can handle, whenever this is possible." (function (lambda (x) (if (and (string-match "^Summary" (buffer-name x)) - (save-excursion - (set-buffer x) + (with-current-buffer x (eq major-mode 'wl-summary-mode))) (setq result (nconc result (list x)))))) (buffer-list)) diff --git a/wl/wl.el b/wl/wl.el index ccc8269..c7d0ac6 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -460,8 +460,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (/ (frame-height) 2) (window-height))) window-lines lines) - (save-excursion - (set-buffer (get-buffer-create wl-plugged-buf-name)) + (with-current-buffer (get-buffer-create wl-plugged-buf-name) (wl-plugged-mode) (buffer-disable-undo (current-buffer)) (delete-windows-on (current-buffer)) -- 1.7.10.4