From 1eeb5c75f7004e46e6d802fba50891f754a84316 Mon Sep 17 00:00:00 2001 From: teranisi Date: Mon, 18 Jun 2001 15:35:55 +0000 Subject: [PATCH] * elmo-pop3.el (elmo-network-close-session): Removed 3rd argument. (elmo-network-setup-session): Ditto. (elmo-message-fetch-plugged): Ditto. (elmo-pop3-send-command): Don't call elmo-pop3-lock. (elmo-network-initialize-session): Ditto. (elmo-pop3-read-response): Abolish 3rd argument. (elmo-pop3-read-response): Don't call elmo-pop3-unlock. (elmo-pop3-read-contents): Ditto. (elmo-pop3-read-body): Ditto. (elmo-pop3-max-of-folder): Call elmo-pop3-commit. (elmo-pop3-lock): Abolish. (elmo-pop3-unlock): Ditto. (elmo-pop3-locked-p): Ditto. (elmo-folder-check): Don't call elmo-pop3-locked-p. * wl-util.el (wl-biff-check-folder): Use own buffer for pop3 biff process. (wl-biff-check-folder-async): Enclose wl-biff-check-folder with unwind-protect. --- elmo/ChangeLog | 17 +++++++++++++++++ elmo/elmo-pop3.el | 45 ++++++++++----------------------------------- wl/ChangeLog | 7 +++++++ wl/wl-util.el | 16 ++++++++-------- 4 files changed, 42 insertions(+), 43 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 4f4e4d7..14e22e3 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,20 @@ +2001-06-18 Yuuichi Teranishi + + * elmo-pop3.el (elmo-network-close-session): Removed 3rd argument. + (elmo-network-setup-session): Ditto. + (elmo-message-fetch-plugged): Ditto. + (elmo-pop3-send-command): Don't call elmo-pop3-lock. + (elmo-network-initialize-session): Ditto. + (elmo-pop3-read-response): Abolish 3rd argument. + (elmo-pop3-read-response): Don't call elmo-pop3-unlock. + (elmo-pop3-read-contents): Ditto. + (elmo-pop3-read-body): Ditto. + (elmo-pop3-max-of-folder): Call elmo-pop3-commit. + (elmo-pop3-lock): Abolish. + (elmo-pop3-unlock): Ditto. + (elmo-pop3-locked-p): Ditto. + (elmo-folder-check): Don't call elmo-pop3-locked-p. + 2001-06-15 Yuuichi Teranishi * elmo-version.el (elmo-version): Up to 2.6.0. diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 05033f2..6016b36 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -70,15 +70,13 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (defvar elmo-pop3-size-hash nil) ; number -> size (defvar elmo-pop3-uidl-done nil) (defvar elmo-pop3-list-done nil) -(defvar elmo-pop3-lock nil) (defvar elmo-pop3-local-variables '(elmo-pop3-read-point elmo-pop3-uidl-number-hash elmo-pop3-number-uidl-hash elmo-pop3-uidl-done elmo-pop3-size-hash - elmo-pop3-list-done - elmo-pop3-lock)) + elmo-pop3-list-done)) (luna-define-method elmo-network-close-session ((session elmo-pop3-session)) (when (elmo-network-session-process-internal session) @@ -111,12 +109,11 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (erase-buffer)) (goto-char (point-min)) (setq elmo-pop3-read-point (point)) - (elmo-pop3-lock) (elmo-pop3-debug "SEND: %s\n" command) (process-send-string process command) (process-send-string process "\r\n"))) -(defun elmo-pop3-read-response (process &optional not-command keep-lock) +(defun elmo-pop3-read-response (process &optional not-command) (with-current-buffer (process-buffer process) (let ((case-fold-search nil) (response-string nil) @@ -153,8 +150,6 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (concat return-value "\n" response-string) response-string))) (setq elmo-pop3-read-point match-end))) - (unless keep-lock - (elmo-pop3-unlock)) return-value))) (defun elmo-pop3-process-filter (process output) @@ -217,7 +212,6 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (let ((process (elmo-network-session-process-internal session)) response mechanism) (with-current-buffer (process-buffer process) - (elmo-pop3-lock) (set-process-filter process 'elmo-pop3-process-filter) (setq elmo-pop3-read-point (point-min)) ;; Skip garbage output from process before greeting. @@ -326,7 +320,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (setq elmo-pop3-size-hash (elmo-make-hash 31)) ;; To get obarray of uidl and size (elmo-pop3-send-command process "list") - (if (null (elmo-pop3-read-response process nil 'keep-lock)) + (if (null (elmo-pop3-read-response process)) (error "POP LIST command failed")) (if (null (setq response (elmo-pop3-read-contents @@ -340,7 +334,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (setq elmo-pop3-number-uidl-hash (elmo-make-hash (* count 2))) ;; UIDL (elmo-pop3-send-command process "uidl") - (unless (elmo-pop3-read-response process nil 'keep-lock) + (unless (elmo-pop3-read-response process) (error "POP UIDL failed")) (unless (setq response (elmo-pop3-read-contents (current-buffer) process)) @@ -356,7 +350,6 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (accept-process-output process) (goto-char elmo-pop3-read-point)) (setq match-end (point)) - (elmo-pop3-unlock) (elmo-delete-cr (buffer-substring elmo-pop3-read-point (- match-end 3)))))) @@ -474,7 +467,9 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (defun elmo-pop3-max-of-folder (spec) (elmo-pop3-commit spec) (if elmo-pop3-use-uidl - (elmo-pop3-list-by-uidl-subr spec 'nonsort) + (prog1 + (elmo-pop3-list-by-uidl-subr spec 'nonsort) + (elmo-pop3-commit spec)) (let* ((process (elmo-network-session-process-internal (elmo-pop3-get-session spec))) @@ -489,6 +484,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (setq total (string-to-int (substring response (match-beginning 1)(match-end 1 )))) + (elmo-pop3-commit spec) (cons total total)))))) (defvar elmo-pop3-header-fetch-chop-length 200) @@ -506,23 +502,6 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (t nil))) -(defun elmo-pop3-lock () - "Lock pop3 process." - (setq elmo-pop3-lock t)) - -(defun elmo-pop3-unlock () - "Unlock pop3 process." - (setq elmo-pop3-lock nil)) - -(defun elmo-pop3-locked-p (process) - "Return t if pop3 PROCESS is locked." - (with-current-buffer (process-buffer process) - (if elmo-pop3-lock - (progn - (elmo-pop3-debug "POP3 is LOCKED!") - t) - nil))) - (defun elmo-pop3-retrieve-headers (buffer tobuffer process articles) (save-excursion (set-buffer buffer) @@ -731,7 +710,6 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (accept-process-output process) (goto-char start)) (setq end (point)) - (elmo-pop3-unlock) (with-current-buffer outbuf (erase-buffer) (insert-buffer-substring (process-buffer process) start (- end 3)) @@ -765,7 +743,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (unwind-protect (progn (when (null (setq response (elmo-pop3-read-response - process t 'keep-lock))) + process t))) (error "Fetching message failed")) (setq response (elmo-pop3-read-body process outbuf))) (setq elmo-pop3-total-size nil)) @@ -848,11 +826,8 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (defun elmo-pop3-commit (spec) (if (elmo-pop3-plugged-p spec) (let ((session (elmo-pop3-get-session spec 'if-exists))) - (when (and session - (not (elmo-pop3-locked-p - (elmo-network-session-process-internal session)))) + (when session (elmo-network-close-session session))))) - (require 'product) (product-provide (provide 'elmo-pop3) (require 'elmo-version)) diff --git a/wl/ChangeLog b/wl/ChangeLog index f89d6c3..a98ee1f 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,10 @@ +2001-06-18 Yuuichi Teranishi + + * wl-util.el (wl-biff-check-folder): Use own buffer for pop3 biff + process. + (wl-biff-check-folder-async): Enclose wl-biff-check-folder + with unwind-protect. + 2001-06-15 Yuuichi Teranishi * Version number is increased to 2.6.0. diff --git a/wl/wl-util.el b/wl/wl-util.el index d949fe1..d238ccb 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -843,11 +843,10 @@ This function is imported from Emacs 20.7." (defun wl-biff-check-folder (folder) (if (eq (elmo-folder-get-type folder) 'pop3) - ;; pop3 biff should share the session. - (prog2 - (elmo-commit folder) ; Close session. - (wl-folder-check-one-entity folder) - (elmo-commit folder)) + (unless (elmo-pop3-get-session (elmo-folder-get-spec folder) 'if-exists) + ;; Currently no main pop3 process. + (let ((elmo-network-session-name-prefix "BIFF-")) + (wl-folder-check-one-entity folder))) (let ((elmo-network-session-name-prefix "BIFF-")) (wl-folder-check-one-entity folder)))) @@ -876,9 +875,10 @@ This function is imported from Emacs 20.7." notify-minibuf)) (let ((elmo-network-session-name-prefix "BIFF-")) (elmo-folder-diff-async folder))) - (wl-biff-notify (car (wl-biff-check-folder folder)) - notify-minibuf) - (setq wl-biff-check-folders-running nil))))) + (unwind-protect + (wl-biff-notify (car (wl-biff-check-folder folder)) + notify-minibuf) + (setq wl-biff-check-folders-running nil)))))) (if (and (fboundp 'regexp-opt) (not (featurep 'xemacs))) -- 1.7.10.4