headers))))
(nreverse headers)))
+(defun elmo-shimbun-folder-setup (folder)
+ ;; Resume headers from existing msgdb.
+ (elmo-shimbun-folder-set-headers-internal
+ folder
+ (elmo-shimbun-msgdb-to-headers folder nil))
+ (elmo-shimbun-folder-set-header-hash-internal
+ folder
+ (elmo-make-hash
+ (length (elmo-shimbun-folder-headers-internal folder))))
+ (dolist (header (elmo-shimbun-folder-headers-internal folder))
+ (elmo-set-hash-val
+ (shimbun-header-id header) header
+ (elmo-shimbun-folder-header-hash-internal folder))))
+
(defun elmo-shimbun-get-headers (folder)
(shimbun-open-group
(elmo-shimbun-folder-shimbun-internal folder)
(shimbun-header-id x)
(elmo-folder-msgdb folder))
x))
+ ;; This takes much time.
(shimbun-headers
(elmo-shimbun-folder-shimbun-internal folder)
(elmo-shimbun-folder-range-internal folder)))))
elmo-shimbun-default-index-range))
folder))
-(luna-define-method elmo-folder-open-internal :before ((folder
- elmo-shimbun-folder))
+(luna-define-method elmo-folder-open-internal ((folder elmo-shimbun-folder))
+ (let ((inhibit-quit t))
+ (elmo-map-folder-location-setup
+ folder
+ (elmo-msgdb-location-load (elmo-folder-msgdb-path folder)))
+ ;; Resume headers from existing msgdb.
+ (elmo-shimbun-folder-setup folder))
(when (elmo-folder-plugged-p folder)
(if (elmo-shimbun-headers-check-p folder)
- (elmo-shimbun-get-headers folder))))
+ (elmo-shimbun-get-headers folder))
+ (elmo-map-folder-update-locations
+ folder
+ (elmo-map-folder-list-message-locations folder))))
(luna-define-method elmo-folder-reserve-status-p ((folder elmo-shimbun-folder))
t)
(elmo-generic-folder-open folder load-msgdb))
(defun elmo-generic-folder-open (folder load-msgdb)
- (if load-msgdb
- (elmo-folder-set-msgdb-internal folder (elmo-msgdb-load folder)))
- (elmo-folder-set-killed-list-internal
- folder
- (elmo-msgdb-killed-list-load (elmo-folder-msgdb-path folder)))
+ (let ((inhibit-quit t))
+ (if load-msgdb
+ (elmo-folder-set-msgdb-internal folder (elmo-msgdb-load folder)))
+ (elmo-folder-set-killed-list-internal
+ folder
+ (elmo-msgdb-killed-list-load (elmo-folder-msgdb-path folder))))
(elmo-folder-open-internal folder))
(luna-define-method elmo-folder-open-internal ((folder elmo-folder))
(wl-summary-buffer-msgdb))))
wl-summary-important-mark))))
+(defsubst wl-summary-open-folder (folder)
+ ;; Select folder
+ (unwind-protect
+ (elmo-folder-open folder 'load-msgdb)
+ ;; For compatibility
+ (setq wl-summary-buffer-msgdb (elmo-folder-msgdb folder))
+ (setq wl-summary-buffer-folder-name (elmo-folder-name-internal folder))))
+
(defun wl-summary-goto-folder-subr (&optional name scan-type other-window
sticky interactive scoring)
"Display target folder on summary."
(let ((case-fold-search nil)
(inhibit-read-only t)
(buffer-read-only nil))
- ;; Select folder
- (elmo-folder-open folder 'load-msgdb)
- ;; For compatibility
- (setq wl-summary-buffer-msgdb (elmo-folder-msgdb folder))
- (setq wl-summary-buffer-folder-name (elmo-folder-name-internal
- folder))
(erase-buffer)
;; Resume summary view
(if wl-summary-cache-use
(when (file-exists-p view)
(setq wl-summary-buffer-view
(wl-summary-load-file-object view)))
- (if (eq wl-summary-buffer-view 'thread)
- (wl-thread-resume-entity folder)
- (wl-summary-make-number-list)))
+ (wl-thread-resume-entity folder)
+ (wl-summary-open-folder folder))
(setq wl-summary-buffer-view
(wl-summary-load-file-object
(expand-file-name wl-summary-view-file
(elmo-folder-msgdb-path folder))))
+ (wl-summary-open-folder folder)
(wl-summary-rescan))
(wl-summary-count-unread
(elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
(wl-summary-update-modeline)))
+ (unless (eq wl-summary-buffer-view 'thread)
+ (wl-summary-make-number-list))
(wl-summary-buffer-number-column-detect t)
(wl-summary-toggle-disp-msg (if wl-summary-buffer-disp-msg 'on 'off))
(unless (and reuse-buf keep-cursor)
(progn
(setq visible (wl-summary-jump-to-msg number))
(setq mark (cadr (assq number mark-alist))))
+ ;; interactive
(setq visible t))
(beginning-of-line)
(if (or (not visible)
(setq eol (point))
(re-search-backward (concat "^" wl-summary-buffer-number-regexp
"..../..") nil t)) ; set cursor line
- )
- (beginning-of-line)
- (if (re-search-forward "^ *\\(-?[0-9]+\\)[^0-9]\\([^0-9]\\)" eol t)
+ (beginning-of-line))
+ (if (or (and (not visible)
+ (assq number (elmo-msgdb-get-number-alist msgdb)))
+ (re-search-forward "^ *\\(-?[0-9]+\\)[^0-9]\\([^0-9]\\)" eol t))
(progn
(setq number (or number (string-to-int (wl-match-buffer 1))))
(setq mark (or mark (wl-match-buffer 2)))
(insert wl-summary-important-mark))
(setq mark-alist
(elmo-msgdb-mark-set mark-alist
- (string-to-int (wl-match-buffer 1))
+ number
wl-summary-important-mark))
- ;; Force cache message!!
- (elmo-message-encache folder number)
+ (unless (elmo-file-cache-exists-p message-id)
+ ;; Force cache message.
+ (elmo-message-encache folder number))
(unless no-server-update
(elmo-msgdb-global-mark-set message-id
wl-summary-important-mark)))