Function: pop3-wait-for-messages

pop3-wait-for-messages is a byte-compiled function defined in pop3.el.gz.

Signature

(pop3-wait-for-messages PROCESS COUNT TOTAL-SIZE START-POINT)

Source Code

;; Defined in /usr/src/emacs/lisp/net/pop3.el.gz
(defun pop3-wait-for-messages (process count total-size start-point)
  (while (> count 0)
    (goto-char start-point)
    (while (or (and (re-search-forward "^\\+OK" nil t)
		    (or (not total-size)
			(re-search-forward "^\\.\r?\n" nil t)))
	       (re-search-forward "^-ERR " nil t))
      (cl-decf count)
      (setq start-point (point)))
    (unless (memq (process-status process) '(open run))
      (error "pop3 process died"))
    (when total-size
      (let ((size 0))
	(goto-char (point-min))
	(while (re-search-forward "^\\+OK.*\n" nil t)
	  (setq size (+ size (- (point))
			(if (re-search-forward "^\\.\r?\n" nil 'move)
			    (match-beginning 0)
			  (point)))))
	(message "pop3 retrieved %dKB (%d%%)"
		 (truncate (/ size 1000))
		 (truncate (* (/ (* size 1.0) total-size) 100)))))
    (pop3-accept-process-output process))
  start-point)