* elmo-util.el (elmo-set-work-buf): Use `with-current-buffer'
authorkaoru <kaoru>
Fri, 1 Jan 2010 05:00:56 +0000 (05:00 +0000)
committerkaoru <kaoru>
Fri, 1 Jan 2010 05:00:56 +0000 (05:00 +0000)
instead of `save-excursion' (for suppress compile warnings).
* elmo-pop3.el (elmo-pop3-retrieve-headers): Ditto.
* elmo-nntp.el (elmo-nntp-list-folders-get-cache): Ditto.
(elmo-nntp-post): Ditto.

elmo/ChangeLog
elmo/elmo-nntp.el
elmo/elmo-pop3.el
elmo/elmo-util.el

index 7aa1cf6..c2665b7 100644 (file)
@@ -1,3 +1,11 @@
+2010-01-01  TAKAHASHI Kaoru  <kaoru@kaisei.org>
+
+       * elmo-util.el (elmo-set-work-buf): Use `with-current-buffer'
+       instead of `save-excursion' (for suppress compile warnings).
+       * elmo-pop3.el (elmo-pop3-retrieve-headers): Ditto.
+       * elmo-nntp.el (elmo-nntp-list-folders-get-cache): Ditto.
+       (elmo-nntp-post): Ditto.
+
 2009-08-01  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * utf7.el (utf7-get-u16char-converter): Revert BOM workaround for
index f297f95..7d87353 100644 (file)
@@ -454,8 +454,7 @@ Don't cache if nil.")
     (let* ((cache-time (car elmo-nntp-list-folders-cache)))
       (unless (elmo-time-expire cache-time
                                elmo-nntp-list-folders-use-cache)
-       (save-excursion
-         (set-buffer buf)
+       (with-current-buffer buf
          (erase-buffer)
          (insert (nth 3 elmo-nntp-list-folders-cache))
          (goto-char (point-min))
@@ -981,8 +980,7 @@ Don't cache if nil.")
                   (elmo-get-network-stream-type
                    elmo-nntp-default-stream-type))))
        response has-message-id)
-    (save-excursion
-      (set-buffer content-buf)
+    (with-current-buffer content-buf
       (goto-char (point-min))
       (if (search-forward mail-header-separator nil t)
          (delete-region (match-beginning 0)(match-end 0)))
index 321af6b..0f05663 100644 (file)
@@ -639,8 +639,7 @@ until the login delay period has expired"))
     nil)))
 
 (defun elmo-pop3-retrieve-headers (process tobuffer articles)
-  (save-excursion
-    (set-buffer (process-buffer process))
+  (with-current-buffer (process-buffer process)
     (erase-buffer)
     (let ((count 0)
          (received 0)
index b796432..e206ebd 100644 (file)
@@ -71,8 +71,7 @@
 
 (defmacro elmo-set-work-buf (&rest body)
   "Execute BODY on work buffer.  Work buffer remains."
-  `(save-excursion
-     (set-buffer (get-buffer-create elmo-work-buf-name))
+  `(with-current-buffer (get-buffer-create elmo-work-buf-name)
      (set-buffer-multibyte default-enable-multibyte-characters)
      (erase-buffer)
      ,@body))