From 93025ed9d6792ef40793910e2a2b7ac46029b5cb Mon Sep 17 00:00:00 2001 From: kaoru Date: Sun, 6 Jul 2008 06:40:48 +0000 Subject: [PATCH] 2008-07-06 YAMASHITA Junji * elmo-pop3.el (elmo-pop3-read-contents): improving performance: goto the previous end-point insead of the head-point, and use `search-forward' instead of `re-search-forward'. --- elmo/ChangeLog | 6 ++++++ elmo/elmo-pop3.el | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 4f7bb6a..2594f79 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,9 @@ +2008-07-06 YAMASHITA Junji + + * elmo-pop3.el (elmo-pop3-read-contents): improving performance: + goto the previous end-point insead of the head-point, and use + `search-forward' instead of `re-search-forward'. + 2008-06-30 Tetsurou Okazaki * elmo-imap4.el (elmo-imap4-parse-status): Use `case' instead of `cond'. diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 85bb096..5538f50 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -469,15 +469,14 @@ until the login delay period has expired")) (defun elmo-pop3-read-contents (process) (with-current-buffer (process-buffer process) (let ((case-fold-search nil) - match-end) - (goto-char elmo-pop3-read-point) - (while (not (re-search-forward "^\\.\r\n" nil t)) - (accept-process-output process 1) - (goto-char elmo-pop3-read-point)) - (setq match-end (point)) + (point elmo-pop3-read-point)) + (while (and (goto-char (max (- point 2) (point-min))) + (not (search-forward "\r\n.\r\n" nil t))) + (setq point (goto-char (point-max))) + (accept-process-output process 1)) (elmo-delete-cr (buffer-substring elmo-pop3-read-point - (- match-end 3)))))) + (- (point) 3)))))) (luna-define-method elmo-folder-expand-msgdb-path ((folder elmo-pop3-folder)) (convert-standard-filename -- 1.7.10.4