From: teranisi Date: Mon, 23 Jul 2001 07:49:18 +0000 (+0000) Subject: * wl-summary.el (wl-summary-open-folder): New function. X-Git-Tag: wl-2_7_2~15 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1561a33376e661835c8ecd34063681a7b7e77dc;p=elisp%2Fwanderlust.git * wl-summary.el (wl-summary-open-folder): New function. (wl-summary-goto-folder-subr): Use it. (wl-summary-mark-as-important): Fix; Encache only when no cache exists. * elmo.el (elmo-generic-folder-open): Bind inhibit-quit as t while loading msgdb. * elmo-shimbun.el (elmo-shimbun-folder-setup): New function. (elmo-folder-open-internal): Rewrite. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 23b47c6..db47aa1 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,11 @@ +2001-07-23 Yuuichi Teranishi + + * elmo.el (elmo-generic-folder-open): Bind inhibit-quit as t + while loading msgdb. + + * elmo-shimbun.el (elmo-shimbun-folder-setup): New function. + (elmo-folder-open-internal): Rewrite. + 2001-07-17 Yuuichi Teranishi * elmo-mime.el (elmo-mime-display-as-is-internal): diff --git a/elmo/elmo-shimbun.el b/elmo/elmo-shimbun.el index 9fcab2d..e75718f 100644 --- a/elmo/elmo-shimbun.el +++ b/elmo/elmo-shimbun.el @@ -119,6 +119,20 @@ See `shimbun-headers' for more detail about RANGE." 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) @@ -137,6 +151,7 @@ See `shimbun-headers' for more detail about RANGE." (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))))) @@ -181,11 +196,19 @@ See `shimbun-headers' for more detail about RANGE." 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) diff --git a/elmo/elmo.el b/elmo/elmo.el index d5dbfef..cebcd65 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -597,11 +597,12 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") (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)) diff --git a/wl/ChangeLog b/wl/ChangeLog index 14593b4..214715b 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,10 @@ +2001-07-23 Yuuichi Teranishi + + * wl-summary.el (wl-summary-open-folder): New function. + (wl-summary-goto-folder-subr): Use it. + (wl-summary-mark-as-important): Fix; + Encache only when no cache exists. + 2001-07-17 Yuuichi Teranishi * wl-draft.el (wl-draft-yank-from-mail-reply-buffer): diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 7f11f43..928c25f 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -2482,6 +2482,14 @@ If ARG, without confirm." (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." @@ -2529,12 +2537,6 @@ If ARG, without confirm." (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 @@ -2551,17 +2553,19 @@ If ARG, without confirm." (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) @@ -4015,6 +4019,7 @@ If ARG, exit virtual folder." (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) @@ -4114,9 +4119,10 @@ If ARG, exit virtual folder." (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))) @@ -4153,10 +4159,11 @@ If ARG, exit virtual folder." (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)))