From: teranisi Date: Tue, 11 Sep 2001 10:16:29 +0000 (+0000) Subject: * elmo-pop3.el (elmo-pop3-list-location): Sort locations by original number. X-Git-Tag: wl-2_7_4~31 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f09bc0dfb7e7b2b8cbd5d386ec7decd09b69cda2;p=elisp%2Fwanderlust.git * elmo-pop3.el (elmo-pop3-list-location): Sort locations by original number. (elmo-folder-status): Call `elmo-folder-open-internal'; Call `elmo-folder-close-internal' instead of `elmo-folder-close'. (elmo-folder-close-internal): Set location-alist as nil. (elmo-folder-clear): Define. (elmo-folder-check): Don't set location-alist as nil. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7f701ce..deaab95 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,13 @@ 2001-09-11 Yuuichi Teranishi + * elmo-pop3.el (elmo-pop3-list-location): Sort locations + by original number. + (elmo-folder-status): Call `elmo-folder-open-internal'; + Call `elmo-folder-close-internal' instead of `elmo-folder-close'. + (elmo-folder-close-internal): Set location-alist as nil. + (elmo-folder-clear): Define. + (elmo-folder-check): Don't set location-alist as nil. + * elmo-dop.el (elmo-dop-queue-method-name-alist): Fixed symbols. 2001-09-10 Yuuichi Teranishi diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 84a32fc..92340b4 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -494,14 +494,17 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (with-current-buffer (process-buffer (elmo-network-session-process-internal (elmo-pop3-get-session folder))) - (let (list) + (let (locations) (if elmo-pop3-uidl-done (progn (mapatoms (lambda (atom) - (setq list (cons (symbol-name atom) list))) + (setq locations (cons (symbol-name atom) locations))) elmo-pop3-uidl-number-hash) - (nreverse list)) + (sort locations + (lambda (loc1 loc2) + (< (elmo-pop3-uidl-to-number loc1) + (elmo-pop3-uidl-to-number loc2))))) (error "POP3: Error in UIDL"))))) (defun elmo-pop3-list-folder-by-location (folder locations) @@ -566,11 +569,12 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (elmo-pop3-folder-list-messages folder)) (luna-define-method elmo-folder-status ((folder elmo-pop3-folder)) + (elmo-folder-open-internal folder) (elmo-folder-check folder) (if (elmo-pop3-folder-use-uidl-internal folder) (prog1 (elmo-pop3-list-by-uidl-subr folder 'nonsort) - (elmo-folder-close folder)) + (elmo-folder-close-internal folder)) (let* ((process (elmo-network-session-process-internal (elmo-pop3-get-session folder))) @@ -585,7 +589,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (setq total (string-to-int (substring response (match-beginning 1)(match-end 1 )))) - (elmo-folder-close folder) + (elmo-folder-close-internal folder) (cons total total)))))) (defvar elmo-pop3-header-fetch-chop-length 200) @@ -681,7 +685,6 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (defun elmo-pop3-sort-msgdb-by-original-number (folder msgdb) (message "Sorting...") (let ((overview (elmo-msgdb-get-overview msgdb))) - (current-buffer) (setq overview (elmo-pop3-sort-overview-by-original-number overview (elmo-pop3-folder-location-alist-internal folder))) @@ -825,6 +828,8 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") folder)))) (luna-define-method elmo-folder-close-internal ((folder elmo-pop3-folder)) + (elmo-pop3-folder-set-location-alist-internal folder nil) + ;; Just close connection (elmo-folder-check folder)) (luna-define-method elmo-message-fetch-plugged ((folder elmo-pop3-folder) @@ -899,11 +904,16 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (and (elmo-folder-persistent-internal folder) (elmo-pop3-folder-use-uidl-internal folder))) +(luna-define-method elmo-folder-clear :around ((folder elmo-pop3-folder) + &optional keep-killed) + (unless keep-killed + (elmo-pop3-folder-set-location-alist-internal folder nil)) + (luna-call-next-method)) + (luna-define-method elmo-folder-check ((folder elmo-pop3-folder)) (if (elmo-folder-plugged-p folder) (let ((session (elmo-pop3-get-session folder 'if-exists))) (when session - (elmo-pop3-folder-set-location-alist-internal folder nil) (elmo-network-close-session session))))) (require 'product)