From: teranisi Date: Mon, 16 Apr 2001 02:51:21 +0000 (+0000) Subject: * utils/bbdb-wl.el (bbdb-wl-get-update-record): Use `with-current-buffer'. X-Git-Tag: wl-2_6-root^3~48 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=128355c8176a1d297595a55df09de22b11bf2715;p=elisp%2Fwanderlust.git * utils/bbdb-wl.el (bbdb-wl-get-update-record): Use `with-current-buffer'. * wl.el (wl-plugged-change): Use '<' instead of '<='. * wl-folder.el (wl-folder-check-one-entity): Fixed last change again. * elmo-shimbun.el (elmo-folder-open-internal): Do nothing if unplugged. (elmo-folder-plugged-p): Define. (elmo-folder-set-plugged): Ditto. (elmo-shimbun-msgdb-create-entity): Do nothing if there's no header. (elmo-folder-list-messages-internal): Return t if unplugged. * elmo-multi.el (elmo-folder-list-messages-internal): Fixed problem when elmo-folder-list-messages-internal method of children returns t. * elmo-map.el (elmo-map-folder-update-locations): Fixed problem when pair is nil. (elmo-folder-open-internal): Don't update if unplugged status. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index e7e1ace..40e5db7 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,18 @@ +2001-04-16 Yuuichi Teranishi + + * elmo-shimbun.el (elmo-folder-open-internal): Do nothing if unplugged. + (elmo-folder-plugged-p): Define. + (elmo-folder-set-plugged): Ditto. + (elmo-shimbun-msgdb-create-entity): Do nothing if there's no header. + (elmo-folder-list-messages-internal): Return t if unplugged. + + * elmo-multi.el (elmo-folder-list-messages-internal): Fixed problem + when elmo-folder-list-messages-internal method of children returns t. + + * elmo-map.el (elmo-map-folder-update-locations): Fixed problem when + pair is nil. + (elmo-folder-open-internal): Don't update if unplugged status. + 2001-04-13 Yuuichi Teranishi * elmo.el (elmo-folder-synchronize): Fixed problem when there's no diff --git a/elmo/elmo-map.el b/elmo/elmo-map.el index 6b74027..d36d1b0 100644 --- a/elmo/elmo-map.el +++ b/elmo/elmo-map.el @@ -190,12 +190,13 @@ (elmo-map-folder-location-hash-internal folder))) location-alist)) - (elmo-clear-hash-val (concat "#" (int-to-string (car pair))) - (elmo-map-folder-location-hash-internal - folder)) - (elmo-clear-hash-val location - (elmo-map-folder-location-hash-internal - folder))) + (when pair + (elmo-clear-hash-val (concat "#" (int-to-string (car pair))) + (elmo-map-folder-location-hash-internal + folder)) + (elmo-clear-hash-val location + (elmo-map-folder-location-hash-internal + folder)))) (setq i (elmo-map-folder-number-max-internal folder)) (dolist (location new-locs) (setq i (1+ i)) @@ -219,9 +220,10 @@ (elmo-map-folder-location-setup folder (elmo-msgdb-location-load (elmo-folder-msgdb-path folder))) - (elmo-map-folder-update-locations - folder - (elmo-map-folder-list-message-locations folder))) + (if (elmo-folder-plugged-p folder) + (elmo-map-folder-update-locations + folder + (elmo-map-folder-list-message-locations folder)))) (luna-define-method elmo-folder-commit :after ((folder elmo-map-folder)) (when (elmo-folder-persistent-p folder) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 6039f46..37eee2b 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -425,18 +425,32 @@ ((folder elmo-multi-folder) &optional nohide) (let* ((flds (elmo-multi-folder-children-internal folder)) (cur-number 0) - numbers) + list numbers) (while flds (setq cur-number (+ cur-number 1)) - (setq numbers (append - numbers - (mapcar - (function - (lambda (x) - (+ - (* (elmo-multi-folder-divide-number-internal - folder) cur-number) x))) - (elmo-folder-list-messages-internal (car flds))))) + (setq list (elmo-folder-list-messages-internal (car flds))) + (setq numbers + (append + numbers + (if (listp list) + (mapcar + (function + (lambda (x) + (+ + (* (elmo-multi-folder-divide-number-internal + folder) cur-number) x))) + list) + ;; Use current list. + (elmo-delete-if + (lambda (num) + (not + (eq cur-number (/ num + (elmo-multi-folder-divide-number-internal + folder))))) + (mapcar + 'car + (elmo-msgdb-get-number-alist + (elmo-folder-msgdb folder))))))) (setq flds (cdr flds))) numbers)) diff --git a/elmo/elmo-shimbun.el b/elmo/elmo-shimbun.el index e0caf68..1fb7e0e 100644 --- a/elmo/elmo-shimbun.el +++ b/elmo/elmo-shimbun.el @@ -53,20 +53,21 @@ (luna-define-method elmo-folder-open-internal :before ((folder elmo-shimbun-folder)) - (shimbun-open-group - (elmo-shimbun-folder-shimbun-internal folder) - (elmo-shimbun-folder-group-internal folder)) - (elmo-shimbun-folder-set-headers-internal - folder (shimbun-headers - (elmo-shimbun-folder-shimbun-internal folder))) - (elmo-shimbun-folder-set-header-hash-internal - folder - (elmo-make-hash (length (elmo-shimbun-folder-headers-internal folder)))) - ;; Set up header hash. - (dolist (header (elmo-shimbun-folder-headers-internal folder)) - (elmo-set-hash-val - (shimbun-header-id header) header - (elmo-shimbun-folder-header-hash-internal folder)))) + (when (elmo-folder-plugged-p folder) + (shimbun-open-group + (elmo-shimbun-folder-shimbun-internal folder) + (elmo-shimbun-folder-group-internal folder)) + (elmo-shimbun-folder-set-headers-internal + folder (shimbun-headers + (elmo-shimbun-folder-shimbun-internal folder))) + (elmo-shimbun-folder-set-header-hash-internal + folder + (elmo-make-hash (length (elmo-shimbun-folder-headers-internal folder)))) + ;; Set up header hash. + (dolist (header (elmo-shimbun-folder-headers-internal folder)) + (elmo-set-hash-val + (shimbun-header-id header) header + (elmo-shimbun-folder-header-hash-internal folder))))) (luna-define-method elmo-folder-close-internal :after ((folder elmo-shimbun-folder)) @@ -77,6 +78,24 @@ (elmo-shimbun-folder-set-header-hash-internal folder nil)) +(luna-define-method elmo-folder-plugged-p ((folder elmo-shimbun-folder)) + (elmo-plugged-p + "shimbun" + (shimbun-server-internal (elmo-shimbun-folder-shimbun-internal folder)) + nil nil + (shimbun-server-internal (elmo-shimbun-folder-shimbun-internal folder)))) + +(luna-define-method elmo-folder-set-plugged ((folder elmo-shimbun-folder) + plugged &optional add) + (elmo-set-plugged plugged + "shimbun" + (shimbun-server-internal + (elmo-shimbun-folder-shimbun-internal folder)) + nil nil nil + (shimbun-server-internal + (elmo-shimbun-folder-shimbun-internal folder)) + add)) + (luna-define-method elmo-folder-check :after ((folder elmo-shimbun-folder)) (when (shimbun-current-group-internal (elmo-shimbun-folder-shimbun-internal folder)) @@ -94,12 +113,13 @@ (expand-file-name "shimbun" elmo-msgdb-dir))) (defun elmo-shimbun-msgdb-create-entity (folder number) - (with-temp-buffer - (shimbun-header-insert - (elmo-get-hash-val - (elmo-map-message-location folder number) - (elmo-shimbun-folder-header-hash-internal folder))) - (elmo-msgdb-create-overview-from-buffer number))) + (let ((header (elmo-get-hash-val + (elmo-map-message-location folder number) + (elmo-shimbun-folder-header-hash-internal folder)))) + (when header + (with-temp-buffer + (shimbun-header-insert header) + (elmo-msgdb-create-overview-from-buffer number))))) (luna-define-method elmo-folder-msgdb-create ((folder elmo-shimbun-folder) numlist new-mark @@ -166,6 +186,12 @@ (elmo-shimbun-folder-header-hash-internal folder))) (buffer-string)))) +(luna-define-method elmo-folder-list-messages-internal :around + ((folder elmo-shimbun-folder) &optional nohide) + (if (elmo-folder-plugged-p folder) + (luna-call-next-method) + t)) + (luna-define-method elmo-map-folder-list-message-locations ((folder elmo-shimbun-folder)) (mapcar diff --git a/utils/bbdb-wl.el b/utils/bbdb-wl.el index 8f99292..e0ef325 100644 --- a/utils/bbdb-wl.el +++ b/utils/bbdb-wl.el @@ -63,9 +63,9 @@ (bbdb-save-db t)) (defun bbdb-wl-get-update-record () - (set-buffer (wl-message-get-original-buffer)) - (bbdb-wl-update-record) - (run-hooks 'bbdb-wl-get-update-record-hook)) + (with-current-buffer (wl-message-get-original-buffer) + (bbdb-wl-update-record) + (run-hooks 'bbdb-wl-get-update-record-hook))) (defun bbdb-wl-hide-bbdb-buffer () (let (bbdb-buf bbdb-win) diff --git a/wl/ChangeLog b/wl/ChangeLog index f02f064..6d69529 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,9 @@ +2001-04-16 Yuuichi Teranishi + + * wl.el (wl-plugged-change): Use '<' instead of '<='. + + * wl-folder.el (wl-folder-check-one-entity): Fixed last change again. + 2001-04-14 Hiroya Murata * wl-folder.el (wl-folder-check-one-entity): Fixed last change. diff --git a/wl/wl-folder.el b/wl/wl-folder.el index bd6a274..bd3bd1a 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -837,7 +837,7 @@ Optional argument ARG is repeart count." (wl-summary-count-unread (elmo-msgdb-mark-load (elmo-folder-msgdb-path folder))))) - (setq unread (min unread (cdr nums))) + (setq unread (min unread (- (or (cdr nums) 0) (or (car nums) 0)))) (wl-folder-entity-hashtb-set wl-folder-entity-hashtb entity (list (car nums) unread diff --git a/wl/wl.el b/wl/wl.el index fbccd34..ac33a30 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -450,7 +450,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (enlarge-window (- window-lines (window-height))) (when (fboundp 'pos-visible-in-window-p) (goto-char (point-min)) - (while (and (<= (window-height) max-lines) + (while (and (< (window-height) max-lines) (not (pos-visible-in-window-p (1- (point-max))))) (enlarge-window 2)))) (error))