From: Stefan Monnier Date: Sat, 18 Sep 2010 10:28:44 +0000 (+0000) Subject: pop3.el (pop3-open-server, pop3-read-response, pop3-list, pop3-retr, pop3-quit):... X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=e30eea990653d6353d56ab877b739aeab7be195d pop3.el (pop3-open-server, pop3-read-response, pop3-list, pop3-retr, pop3-quit): Use with-current-buffer. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 76e9b4b35..0ab1ae82c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -98,6 +98,13 @@ * gnus-int.el (gnus-finish-retrieve-group-infos) (gnus-retrieve-group-data-early): New functions. +2010-09-17 Stefan Monnier + + * nnrss.el (nnrss-retrieve-headers, nnrss-request-list-newsgroups) + (nnrss-retrieve-groups): + * pop3.el (pop3-open-server, pop3-read-response, pop3-list, pop3-retr) + (pop3-quit): Use with-current-buffer. + 2010-09-17 Katsumi Yamaoka * pop3.el (pop3-wait-for-messages): Use pop3-accept-process-output diff --git a/lisp/pop3.el b/lisp/pop3.el index 63ed8004a..950cae25c 100644 --- a/lisp/pop3.el +++ b/lisp/pop3.el @@ -279,9 +279,9 @@ Returns the process associated with the connection." (let ((coding-system-for-read 'binary) (coding-system-for-write 'binary) process) - (save-excursion - (set-buffer (get-buffer-create (concat " trace of POP session to " - mailhost))) + (with-current-buffer + (get-buffer-create (concat " trace of POP session to " + mailhost)) (erase-buffer) (setq pop3-read-point (point-min)) (setq process @@ -353,8 +353,7 @@ Returns the process associated with the connection." Return the response string if optional second argument is non-nil." (let ((case-fold-search nil) match-end) - (save-excursion - (set-buffer (process-buffer process)) + (with-current-buffer (process-buffer process) (goto-char pop3-read-point) (while (and (memq (process-status process) '(open run)) (not (search-forward "\r\n" nil t))) @@ -511,8 +510,7 @@ Otherwise, return the size of the message-id MSG" (if msg (string-to-number (nth 2 (split-string response " "))) (let ((start pop3-read-point) end) - (save-excursion - (set-buffer (process-buffer process)) + (with-current-buffer (process-buffer process) (while (not (re-search-forward "^\\.\r\n" nil t)) (pop3-accept-process-output process) (goto-char start)) @@ -530,8 +528,7 @@ Otherwise, return the size of the message-id MSG" (pop3-send-command process (format "RETR %s" msg)) (pop3-read-response process) (let ((start pop3-read-point) end) - (save-excursion - (set-buffer (process-buffer process)) + (with-current-buffer (process-buffer process) (while (not (re-search-forward "^\\.\r\n" nil t)) (pop3-accept-process-output process) (goto-char start)) @@ -547,8 +544,7 @@ Otherwise, return the size of the message-id MSG" (setq end (point-marker)) (pop3-clean-region start end) (pop3-munge-message-separator start end) - (save-excursion - (set-buffer crashbuf) + (with-current-buffer crashbuf (erase-buffer)) (copy-to-buffer crashbuf start end) (delete-region start end) @@ -585,8 +581,7 @@ and close the connection." (pop3-send-command process "QUIT") (pop3-read-response process t) (if process - (save-excursion - (set-buffer (process-buffer process)) + (with-current-buffer (process-buffer process) (goto-char (point-max)) (delete-process process))))