(if wl-summary-buffer-disp-msg
(wl-summary-redisplay)))
-(defun wl-summary-count-unread (mark-alist)
- (let ((new 0)
- (unread 0)
- mark)
- (while mark-alist
- (setq mark (cadr (car mark-alist)))
- (and mark
- (cond
- ((string= mark wl-summary-new-mark)
- (setq new (+ 1 new)))
- ((or (string= mark wl-summary-unread-uncached-mark)
- (string= mark wl-summary-unread-cached-mark))
- (setq unread (+ 1 unread)))))
- (setq mark-alist (cdr mark-alist)))
+(defun wl-summary-count-unread ()
+ (let ((pair
+ (elmo-msgdb-count-marks (wl-summary-buffer-msgdb)
+ wl-summary-new-mark
+ (list wl-summary-unread-uncached-mark
+ wl-summary-unread-cached-mark))))
(if (eq major-mode 'wl-summary-mode)
- (setq wl-summary-buffer-new-count new
- wl-summary-buffer-unread-count unread))
- (cons new unread)))
+ (setq wl-summary-buffer-new-count (car pair)
+ wl-summary-buffer-unread-count (cdr pair)))
+ pair))
(defun wl-summary-message-string (&optional use-cache)
"Return full body string of current message.
(msgdb (wl-summary-buffer-msgdb))
(overview (elmo-msgdb-get-overview msgdb))
(number-alist (elmo-msgdb-get-number-alist msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
(elmo-mime-charset wl-summary-buffer-mime-charset)
i percent num
gc-message entity
(setq expunged (wl-summary-score-update-all-lines)))
(message "%d message(s) are expunged by scoring." (length expunged))))
(wl-summary-set-message-modified)
- (wl-summary-count-unread
- (elmo-msgdb-get-mark-alist
- (elmo-folder-msgdb wl-summary-buffer-elmo-folder)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline)
(goto-char (point-max))
(forward-line -1)
;; prefetching procedure.
(save-excursion
(let* ((msgdb (wl-summary-buffer-msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
(number-alist (elmo-msgdb-get-number-alist msgdb))
(message-id (cdr (assq number number-alist)))
(ov (elmo-msgdb-overview-get-entity message-id msgdb))
"??")))))) " ]")
size))))
(message "")) ; flush.
- (setq mark (cadr (assq number mark-alist)))
+ (setq mark (elmo-msgdb-get-mark msgdb number))
(if force-read
(save-excursion
(save-match-data
((string= mark wl-summary-read-uncached-mark)
nil)
(t mark)))
- (setq mark-alist (elmo-msgdb-mark-set
- mark-alist number new-mark))
+ (elmo-msgdb-set-mark msgdb number new-mark)
(or new-mark (setq new-mark " "))
- (elmo-msgdb-set-mark-alist msgdb mark-alist)
(wl-summary-set-mark-modified)
(wl-summary-update-modeline)
(wl-folder-update-unread
(if (and sticky wl-summary-highlight)
(wl-highlight-summary-current-line))))))
-(defun wl-summary-delete-all-marks (mark-alist mark)
- "Delete all MARKs in MARK-ALIST."
- (let ((malist mark-alist)
- (ret-val mark-alist)
- entity)
- (while malist
- (setq entity (car malist))
- (if (string= (cadr entity) mark)
- ;; delete this entity
- (setq ret-val (delete entity ret-val)))
- (setq malist (cdr malist)))
- ret-val))
-
;; Does not work correctly...
(defun wl-summary-mark-as-read-region (beg end)
(interactive "r")
(while (not (eobp))
(wl-summary-mark-as-read t)
(forward-line 1)))))
- (wl-summary-count-unread (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline))
(defun wl-summary-mark-as-unread-region (beg end)
(while (not (eobp))
(wl-summary-mark-as-unread)
(forward-line 1)))))
- (wl-summary-count-unread (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline))
(defun wl-summary-mark-as-important-region (beg end)
(while (not (eobp))
(wl-summary-mark-as-important)
(forward-line 1)))))
- (wl-summary-count-unread (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline))
(defun wl-summary-mark-as-read-all ()
(let* ((folder wl-summary-buffer-elmo-folder)
(cur-buf (current-buffer))
(msgdb (wl-summary-buffer-msgdb))
-;;; (number-alist (elmo-msgdb-get-number-alist msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
- (malist mark-alist)
(inhibit-read-only t)
(buffer-read-only nil)
(case-fold-search nil)
(string= mark wl-summary-unread-cached-mark))
(progn
(insert " ")
- (setq mark-alist
- (elmo-msgdb-mark-set
- mark-alist
- msg
-;;; Use msg instead of (cdr (assq msg number-alist)).
-;;; (cdr (assq msg number-alist))
- nil)))
+ (elmo-msgdb-set-mark msgdb msg nil))
;; New mark and unread-uncached mark
(insert wl-summary-read-uncached-mark)
- (setq mark-alist
- (elmo-msgdb-mark-set mark-alist
- msg
-;;; (cdr (assq msg number-alist))
- wl-summary-read-uncached-mark)))
+ (elmo-msgdb-set-mark
+ msgdb msg wl-summary-read-uncached-mark))
(if wl-summary-highlight
(wl-highlight-summary-current-line nil nil t)))))
- (setq mark-alist (wl-summary-set-as-read-mark-alist mark-alist))
+ (elmo-folder-replace-marks
+ folder
+ (list (cons wl-summary-unread-cached-mark
+ nil)
+ (cons wl-summary-unread-uncached-mark
+ wl-summary-read-uncached-mark)
+ (cons wl-summary-new-mark
+ wl-summary-read-uncached-mark)))
(wl-summary-set-mark-modified)
- (set-buffer cur-buf); why is this needed???
- (elmo-msgdb-set-mark-alist msgdb mark-alist)
(wl-folder-update-unread (wl-summary-buffer-folder-name) 0)
(setq wl-summary-buffer-unread-count 0)
(setq wl-summary-buffer-new-count 0)
(buffer-read-only nil)
(folder wl-summary-buffer-elmo-folder)
(msgdb (wl-summary-buffer-msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
(number-alist (elmo-msgdb-get-number-alist msgdb))
(case-fold-search nil)
mark number unread new-mark)
(elmo-message-field wl-summary-buffer-elmo-folder
number
'message-id)))
- (setq mark-alist
- (elmo-msgdb-mark-set mark-alist number new-mark))
- (elmo-msgdb-set-mark-alist msgdb mark-alist)
+ (elmo-msgdb-set-mark msgdb number new-mark)
(wl-summary-set-mark-modified)
(if wl-summary-highlight
(wl-highlight-summary-current-line nil nil t))
(cur-buf (current-buffer))
(msgdb (wl-summary-buffer-msgdb))
(number-alist (elmo-msgdb-get-number-alist msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
(inhibit-read-only t)
(buffer-read-only nil)
(case-fold-search nil)
(setq msg (string-to-int
(wl-match-buffer 1)))
(setq mark (wl-match-buffer 2))
- (setq msgid (cdr (assq msg number-alist)))
+ (setq msgid (elmo-msgdb-get-field msgdb msg 'message-id))
(setq set-mark nil)
(if (elmo-file-cache-exists-p msgid)
(if (or
(when set-mark
(delete-region (match-beginning 2) (match-end 2))
(insert set-mark)
- (setq mark-alist
- (elmo-msgdb-mark-set
- mark-alist msg ; msgid
- (if (string= set-mark " ") nil set-mark)))
+ (elmo-msgdb-set-mark msgdb msg
+ (if (string= set-mark " ") nil set-mark))
(if wl-summary-highlight
(wl-highlight-summary-current-line))))
(wl-summary-set-mark-modified)
- (set-buffer cur-buf); why is this needed???
- (elmo-msgdb-set-mark-alist msgdb mark-alist)
- (wl-summary-count-unread mark-alist)
+ (wl-summary-count-unread)
(wl-summary-update-modeline)
(message "Resuming cache status...done")
(set-buffer-modified-p nil))))
-(defun wl-summary-resume-marks-and-highlight ()
- (let* ((msgdb (wl-summary-buffer-msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
-;;; (number-alist (elmo-msgdb-get-number-alist msgdb))
- (count (count-lines (point-min)(point-max)))
- (i 0)
- msg-num percent smark)
- (save-excursion
- (goto-char (point-min))
- (message "Resuming all marks...")
- (while (not (eobp))
- (setq msg-num (wl-summary-message-number))
- (setq smark (car (cdr (assq msg-num mark-alist))))
- (if (looking-at (format "^ *%s \\( \\)" msg-num))
- (progn
- (goto-char (match-end 1))
- (delete-region (match-beginning 1) (match-end 1))
- (insert (or smark " "))))
- (wl-highlight-summary-current-line smark)
- (when (> count elmo-display-progress-threshold)
- (setq i (+ i 1))
- (setq percent (/ (* i 100) count))
- (elmo-display-progress
- 'wl-summary-resume-marks-and-highlight "Resuming all marks..."
- percent))
- (forward-line 1)))
- (message "Resuming all marks...done")))
-
-(defun wl-summary-resume-marks ()
- (let* ((msgdb (wl-summary-buffer-msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
- (number-alist (elmo-msgdb-get-number-alist msgdb))
- (count (length mark-alist))
- (i 0)
- entity msg-num percent)
- (save-excursion
- (message "Resuming all marks...")
- (while mark-alist
- (setq entity (car mark-alist))
- (if (setq msg-num (car (rassoc (car entity) number-alist)))
- (progn
-;;; (goto-char (point-min))
- (if (re-search-forward (format "^ *%s \\( \\)" msg-num) nil t)
- (progn
- (delete-region (match-beginning 1) (match-end 1))
- (insert (or (cadr entity)
- " ")))
- (if (re-search-backward (format "^ *%s \\( \\)" msg-num) nil t)
- (progn
- (goto-char (match-end 1))
- (delete-region (match-beginning 1) (match-end 1))
- (insert (or (cadr entity)
- " ")))))))
- (when (> count elmo-display-progress-threshold)
- (setq i (+ i 1))
- (setq percent (/ (* i 100) count))
- (elmo-display-progress
- 'wl-summary-resume-marks "Resuming all marks..."
- percent))
- (setq mark-alist (cdr mark-alist)))
- (message "Resuming all marks...done"))))
-
(defun wl-summary-delete-messages-on-buffer (msgs &optional deleting-info)
(interactive)
(save-excursion
(wl-thread-update-line-msgs (elmo-uniq-list update-list)
(unless deleting-info 'no-msg))
(wl-thread-cleanup-symbols msgs2))
- (wl-summary-count-unread
- (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline)
(wl-folder-update-unread
(wl-summary-buffer-folder-name)
(+ wl-summary-buffer-unread-count wl-summary-buffer-new-count)))))
-(defun wl-summary-set-as-read-mark-alist (mark-alist)
- (let ((marks (list (cons wl-summary-unread-cached-mark
- nil)
- (cons wl-summary-unread-uncached-mark
- wl-summary-read-uncached-mark)
- (cons wl-summary-new-mark
- wl-summary-read-uncached-mark)))
- (ret-val mark-alist)
- entity pair)
- (while mark-alist
- (setq entity (car mark-alist))
- (when (setq pair (assoc (cadr entity) marks))
- (if (elmo-message-use-cache-p wl-summary-buffer-elmo-folder
- (caar mark-alist))
- (if (cdr pair)
- (setcar (cdr entity) (cdr pair))
- (setq ret-val (delete entity ret-val)))
- (setq ret-val (delete entity ret-val))))
- (setq mark-alist (cdr mark-alist)))
- ret-val))
-
-(defun wl-summary-set-status-marks (mark-alist before after)
- "Set the BEFORE marks to AFTER."
- (let ((ret-val mark-alist)
- entity)
- (while mark-alist
- (setq entity (car mark-alist))
- (when (string= (cadr entity) before)
- (if after
- (setcar (cdr entity) after)
- (setq ret-val (delete entity ret-val))))
- (setq mark-alist (cdr mark-alist)))
- ret-val))
-
(defun wl-summary-set-status-marks-on-buffer (before after)
"Set the MARKS marks on buffer."
(interactive)
(error "Trash Folder is not created"))))
wl-trash-folder)))))
-(defun wl-summary-delete-important-msgs-from-list (delete-list
- mark-alist)
- (let ((dlist delete-list))
- (while dlist
- (if (string= wl-summary-important-mark
- (car (cdr (assq (car dlist) mark-alist))))
- (setq delete-list (delete (car dlist) delete-list)))
- (setq dlist (cdr dlist)))
- delete-list))
-
-(defun wl-summary-delete-canceled-msgs-from-list (delete-list msgdb)
- (let ((dlist delete-list))
- (while dlist
- (if (null (cdr (assq (car dlist) (cadr msgdb))))
- (setq delete-list (delete (car dlist) delete-list)))
- (setq dlist (cdr dlist)))
- delete-list))
-
(defun wl-summary-get-append-message-func ()
(if (eq wl-summary-buffer-view 'thread)
'wl-summary-insert-thread-entity
(interactive)
(let ((last-progress 0)
(i 0)
- mark-alist unread-marks importants unreads
+ unread-marks importants unreads
importants-in-db unreads-in-db diff diffs
- mes num-ma progress)
+ mes progress)
;; synchronize marks.
(when (not (eq (elmo-folder-type-internal
wl-summary-buffer-elmo-folder)
(setq unread-marks (list wl-summary-unread-cached-mark
wl-summary-unread-uncached-mark
wl-summary-new-mark)
- mark-alist (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb))
- num-ma (length mark-alist)
+ importants-in-db (elmo-folder-list-messages-mark-match
+ wl-summary-buffer-elmo-folder
+ (regexp-quote wl-summary-important-mark))
+ unreads-in-db (elmo-folder-list-messages-mark-match
+ wl-summary-buffer-elmo-folder
+ (wl-regexp-opt unread-marks))
importants (elmo-folder-list-importants
wl-summary-buffer-elmo-folder
wl-summary-important-mark)
unreads (elmo-folder-list-unreads
wl-summary-buffer-elmo-folder
unread-marks))
- (while mark-alist
- (if (string= (cadr (car mark-alist))
- wl-summary-important-mark)
- (setq importants-in-db (cons (car (car mark-alist))
- importants-in-db))
- (if (member (cadr (car mark-alist)) unread-marks)
- (setq unreads-in-db (cons (car (car mark-alist))
- unreads-in-db))))
- (setq mark-alist (cdr mark-alist))
- (when (> num-ma elmo-display-progress-threshold)
- (setq i (1+ i)
- progress (/ (* i 100) num-ma))
- (if (not (eq progress last-progress))
- (elmo-display-progress 'wl-summary-sync-marks
- "Updating marks..."
- progress))
- (setq last-progress progress)))
(setq diff (elmo-list-diff importants importants-in-db))
(setq diffs (cadr diff)) ; important-deletes
(setq mes (format "Updated (-%d" (length diffs)))
(inhibit-read-only t)
(buffer-read-only nil)
gc-message
- overview number-alist mark-alist
+ overview number-alist
curp num i new-msgdb
append-list delete-list crossed
update-thread update-top-list
(setq num (length curp))
(when append-list
(setq i 0)
+
;; set these value for append-message-func
(setq overview (elmo-msgdb-get-overview
(elmo-folder-msgdb folder)))
(setq number-alist (elmo-msgdb-get-number-alist
(elmo-folder-msgdb folder)))
- (setq mark-alist (elmo-msgdb-get-mark-alist
- (elmo-folder-msgdb folder)))
+
(setq wl-summary-delayed-update nil)
(elmo-kill-buffer wl-summary-search-buf-name)
(while curp
(wl-folder-set-folder-updated
(elmo-folder-name-internal folder)
(list 0
- (let ((pair (wl-summary-count-unread
- (elmo-msgdb-get-mark-alist
- (elmo-folder-msgdb folder)))))
+ (let ((pair (wl-summary-count-unread)))
(+ (car pair) (cdr pair)))
(elmo-folder-messages folder)))
(wl-summary-update-modeline)
(setq copy-variables (cdr copy-variables)))
(switch-to-buffer buf)
(kill-buffer cur-buf)
- (wl-summary-count-unread
- (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline)
(if msg
(if (eq wl-summary-buffer-view 'thread)
(defun wl-summary-auto-select-msg-p (unread-msg)
(and unread-msg
(not (string=
- (cadr (assoc unread-msg
- (elmo-msgdb-get-mark-alist
- (wl-summary-buffer-msgdb))))
+ (elmo-msgdb-get-mark
+ (wl-summary-buffer-msgdb)
+ unread-msg)
wl-summary-important-mark))))
(defsubst wl-summary-open-folder (folder)
(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-count-unread)
(wl-summary-update-modeline)))
(unless (eq wl-summary-buffer-view 'thread)
(wl-summary-make-number-list))
(defun wl-summary-insert-thread-entity (entity msgdb update
&optional force-insert)
(let* ((overview (elmo-msgdb-get-overview msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
this-id
parent-entity
parent-number
parent-entity) ""))))
(setq parent-number nil))
(setq retval
- (wl-thread-insert-message entity mark-alist
+ (wl-thread-insert-message entity
number parent-number update linked))
(and retval
(wl-append update-list (list retval)))
update-list))
(defun wl-summary-update-thread (entity
- mark-alist
thr-entity
parent-entity)
(let* ((this-id (elmo-msgdb-overview-entity-get-id entity))
(wl-summary-insert-line
(wl-summary-create-line
entity
- parent-entity
+ parent-entity
nil
(wl-thread-maybe-get-children-num msg)
(wl-thread-make-indent-string thr-entity)
(buffer-read-only nil)
(folder wl-summary-buffer-elmo-folder)
(msgdb (wl-summary-buffer-msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
;;; (number-alist (elmo-msgdb-get-number-alist msgdb))
new-mark visible mark)
(if number
(progn
(setq visible (wl-summary-jump-to-msg number))
- (unless (setq mark (cadr (assq number mark-alist)))
+ (unless (setq mark (elmo-msgdb-get-mark msgdb number))
(setq mark " ")))
;; interactive
(setq visible t))
(when visible
(delete-region (match-beginning 2) (match-end 2))
(insert new-mark))
- (setq mark-alist
- (elmo-msgdb-mark-set mark-alist
- number
- new-mark))
- (elmo-msgdb-set-mark-alist msgdb mark-alist)
+ (elmo-msgdb-set-mark msgdb number new-mark)
(unless no-modeline-update
(setq wl-summary-buffer-unread-count
(+ 1 wl-summary-buffer-unread-count))
(wl-summary-prev)
(wl-summary-next)))
-(defsubst wl-summary-no-auto-refile-message-p (msg mark-alist)
- (member (cadr (assq msg mark-alist)) wl-summary-auto-refile-skip-marks))
+(defsubst wl-summary-no-auto-refile-message-p (msg)
+ (member (elmo-msgdb-get-mark (wl-summary-buffer-msgdb) msg)
+ wl-summary-auto-refile-skip-marks))
(defun wl-summary-auto-refile (&optional open-all)
"Set refile mark automatically according to 'wl-refile-guess-by-rule'."
open-all)
(wl-thread-open-all))
(let* ((spec (wl-summary-buffer-folder-name))
- (mark-alist (elmo-msgdb-get-mark-alist
- (wl-summary-buffer-msgdb)))
checked-dsts
(count 0)
number dst thr-entity)
(wl-thread-get-entity number))))
(wl-thread-entity-get-descendant
thr-entity))))
- (when (and (not (wl-summary-no-auto-refile-message-p number
- mark-alist))
+ (when (and (not (wl-summary-no-auto-refile-message-p
+ number))
(setq dst
(wl-folder-get-realname
(wl-refile-guess-by-rule
(setq wl-summary-buffer-target-mark-list
(delq (car mlist) wl-summary-buffer-target-mark-list))
(setq mlist (cdr mlist)))
- (wl-summary-count-unread
- (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline))))
(defun wl-summary-target-mark-mark-as-unread ()
(setq wl-summary-buffer-target-mark-list
(delq (car mlist) wl-summary-buffer-target-mark-list))
(setq mlist (cdr mlist)))
- (wl-summary-count-unread
- (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline))))
(defun wl-summary-target-mark-mark-as-important ()
(setq wl-summary-buffer-target-mark-list
(delq (car mlist) wl-summary-buffer-target-mark-list))
(setq mlist (cdr mlist)))
- (wl-summary-count-unread
- (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
+ (wl-summary-count-unread)
(wl-summary-update-modeline))))
(defun wl-summary-target-mark-save ()
(buffer-read-only nil)
(folder wl-summary-buffer-elmo-folder)
(msgdb (wl-summary-buffer-msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
;;; (number-alist (elmo-msgdb-get-number-alist msgdb))
(case-fold-search nil)
mark stat visible uncached new-mark marked)
(if number
(progn
(setq visible (wl-summary-jump-to-msg number))
- (setq mark (cadr (assq number mark-alist))))
+ (setq mark (elmo-msgdb-get-mark msgdb number)))
;; interactive
(setq visible t))
(beginning-of-line)
(goto-char (match-end 2))
(delete-region (match-beginning 2) (match-end 2))
(insert (or new-mark " ")))
- (setq mark-alist
- (elmo-msgdb-mark-set mark-alist number new-mark))
- (elmo-msgdb-set-mark-alist msgdb mark-alist)
+ (elmo-msgdb-set-mark msgdb number new-mark)
(wl-summary-set-mark-modified))
(if (and visible wl-summary-highlight)
(wl-highlight-summary-current-line nil nil t)))
(buffer-read-only nil)
(folder wl-summary-buffer-elmo-folder)
(msgdb (wl-summary-buffer-msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
(number-alist (elmo-msgdb-get-number-alist msgdb))
message-id visible)
(if number
(progn
(setq visible (wl-summary-jump-to-msg number))
- (setq mark (or mark (cadr (assq number mark-alist)))))
+ (setq mark (or mark (elmo-msgdb-get-mark msgdb number))))
(setq visible t))
(when visible
(if (null (setq number (wl-summary-message-number)))
(when visible
(delete-region (match-beginning 2) (match-end 2))
(insert " "))
- (setq mark-alist
- (elmo-msgdb-mark-set mark-alist
- number
- nil)))
+ (elmo-msgdb-set-mark msgdb number nil))
;; server side mark
(save-match-data
(unless no-server-update
(when visible
(delete-region (match-beginning 2) (match-end 2))
(insert wl-summary-important-mark))
- (setq mark-alist
- (elmo-msgdb-mark-set mark-alist
- number
- wl-summary-important-mark))
+ (elmo-msgdb-set-mark msgdb number
+ wl-summary-important-mark)
(if (eq (elmo-file-cache-exists-p message-id) 'entire)
(elmo-folder-mark-as-read folder (list number))
;; Force cache message.
(unless no-server-update
(elmo-msgdb-global-mark-set message-id
wl-summary-important-mark)))
- (elmo-msgdb-set-mark-alist msgdb mark-alist)
(wl-summary-set-mark-modified)))
(if (and visible wl-summary-highlight)
(wl-highlight-summary-current-line nil nil t))))
curp curc)
(setq curp to)
(elmo-list-insert wl-summary-buffer-number-list
- (wl-thread-entity-get-number entity)
- (progn
- (while (setq curc
- (wl-thread-entity-get-children curp))
- (setq curp (wl-thread-get-entity
- (nth (- (length curc) 1)
- curc))))
- (wl-thread-entity-get-number curp)))
+ (wl-thread-entity-get-number entity)
+ (progn
+ (while (setq curc
+ (wl-thread-entity-get-children curp))
+ (setq curp (wl-thread-get-entity
+ (nth (- (length curc) 1)
+ curc))))
+ (wl-thread-entity-get-number curp)))
(setcar (cddr to) (wl-append children
(list (car entity))))
(setq wl-thread-entities (cons entity wl-thread-entities))
(defun wl-thread-open-all-unread ()
(interactive)
- (let ((mark-alist (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
- mark)
- (while mark-alist
- (if (setq mark (nth 1 (car mark-alist)))
- (if (or (string= mark wl-summary-unread-uncached-mark)
- (string= mark wl-summary-unread-cached-mark)
- (string= mark wl-summary-new-mark)
- (string= mark wl-summary-important-mark))
- (wl-thread-entity-force-open (wl-thread-get-entity
- (nth 0 (car mark-alist))))))
- (setq mark-alist (cdr mark-alist)))))
+ (dolist (number (elmo-folder-list-messages-mark-match
+ wl-summary-buffer-elmo-folder
+ (wl-regexp-opt (list wl-summary-unread-uncached-mark
+ wl-summary-unread-cached-mark
+ wl-summary-new-mark
+ wl-summary-important-mark))))
+ (wl-thread-entity-force-open (wl-thread-get-entity number))))
(defsubst wl-thread-maybe-get-children-num (msg)
(let ((entity (wl-thread-get-entity msg)))
(let* ((entity (or entity (wl-thread-get-entity msg)))
(parent-msg (or parent-msg (wl-thread-entity-get-parent entity)))
(overview (elmo-msgdb-get-overview (wl-summary-buffer-msgdb)))
- (mark-alist (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
(buffer-read-only nil)
(inhibit-read-only t)
overview-entity temp-mark summary-line invisible-top dest-pair)
(wl-thread-entity-parent-invisible-p entity)))
(wl-summary-update-thread
(elmo-msgdb-overview-get-entity msg (wl-summary-buffer-msgdb))
- mark-alist
entity
(and parent-msg
(elmo-msgdb-overview-get-entity
wl-thread-entity-hashtb))
(setq msgs (cdr msgs)))))
-(defun wl-thread-get-exist-children (msg)
+(defun wl-thread-get-exist-children (msg &optional include-self)
(let ((msgs (list msg))
msgs-stack children
entity ret-val)
(while msgs
(setq children (wl-thread-entity-get-children
(setq entity (wl-thread-get-entity (car msgs)))))
- (when (elmo-msgdb-overview-get-entity (car msgs) (wl-summary-buffer-msgdb))
+ (when (elmo-msgdb-overview-get-entity (car msgs)
+ (wl-summary-buffer-msgdb))
(wl-append ret-val (list (car msgs)))
(setq children nil))
(setq msgs (cdr msgs))
(setq msgs (wl-pop msgs-stack)))
(wl-push msgs msgs-stack)
(setq msgs children)))
+ (unless include-self (setq ret-val (delq msg ret-val)))
ret-val))
(defun wl-thread-delete-message (msg &optional deep update)
(let* (next-top insert-msgs ent e grandchildren)
(if top-child
(progn
- (setq insert-msgs (wl-thread-get-exist-children top-child))
+ (setq insert-msgs (wl-thread-get-exist-children
+ top-child 'include-self))
(setq next-top (car insert-msgs))
(setq ent (wl-thread-get-entity next-top))
(when (and
update-msgs)))) ; return value
(defun wl-thread-insert-message (overview-entity
- mark-alist
msg parent-msg &optional update linked)
"Insert MSG to the entity.
When optional argument UPDATE is non-nil,
(progn
(wl-summary-update-thread
overview-entity
- mark-alist
child-entity
(elmo-msgdb-overview-get-entity
parent-msg (wl-summary-buffer-msgdb)))
(defun wl-thread-msg-mark-as-important (msg)
"Set mark as important for invisible MSG. Modeline is not changed."
- (let* ((msgdb (wl-summary-buffer-msgdb))
- (mark-alist (elmo-msgdb-get-mark-alist msgdb))
- cur-mark)
- (setq cur-mark (cadr (assq msg mark-alist)))
- (setq mark-alist
- (elmo-msgdb-mark-set mark-alist
- msg
- (if (string= cur-mark wl-summary-important-mark)
- nil
- wl-summary-important-mark)))
- (elmo-msgdb-set-mark-alist msgdb mark-alist)
+ (let ((msgdb (wl-summary-buffer-msgdb))
+ cur-mark)
+ (setq cur-mark (elmo-msgdb-get-mark msgdb msg))
+ (elmo-msgdb-set-mark msgdb
+ msg
+ (if (string= cur-mark wl-summary-important-mark)
+ nil
+ wl-summary-important-mark))
(wl-summary-set-mark-modified)))
(defun wl-thread-mark-as-read (&optional arg)
(/ (* cur 100) len)))))))
(defsubst wl-thread-insert-entity-sub (indent entity parent-entity all)
- (let ((mark-alist (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
- msg-num
+ (let (msg-num
overview-entity
temp-mark
summary-line)
(defun wl-thread-get-children-msgs-uncached (msg &optional uncached-marks)
(let ((children-msgs (wl-thread-get-children-msgs msg))
- (mark-alist (elmo-msgdb-get-mark-alist (wl-summary-buffer-msgdb)))
(number-alist (elmo-msgdb-get-number-alist (wl-summary-buffer-msgdb)))
mark
uncached-list)
(while children-msgs
(if (and (not (eq msg (car children-msgs))) ; except itself
(or (and uncached-marks
- (setq mark (cadr (assq (car children-msgs)
- mark-alist)))
+ (setq mark (elmo-msgdb-get-mark
+ (wl-summary-buffer-msgdb)
+ (car children-msgs)))
(member mark uncached-marks))
(and (not uncached-marks)
(null (elmo-file-cache-exists-p