* wl.el (wl-plugged-change): Suppress compile warnings; Use
authorkaoru <kaoru>
Fri, 1 Jan 2010 08:06:39 +0000 (08:06 +0000)
committerkaoru <kaoru>
Fri, 1 Jan 2010 08:06:39 +0000 (08:06 +0000)
`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
wl/wl-action.el
wl/wl-address.el
wl/wl-message.el
wl/wl-template.el
wl/wl-util.el
wl/wl.el

index 9ccbd73..0f45a89 100644 (file)
@@ -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 <ljz@asfast.com>
 
        * wl-summary.el (wl-summary-detect-mark-position): Force
index 008649e..b6e45e9 100644 (file)
@@ -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)
index 69abb20..3f7dbb9 100644 (file)
@@ -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))))
index c7c22cd..c49281e 100644 (file)
@@ -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)
index cac3404..a17c4a7 100644 (file)
@@ -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--"))
index d5288a0..a27671e 100644 (file)
@@ -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))
index ccc8269..c7d0ac6 100644 (file)
--- 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))