;;; wl-summary.el -- Summary mode for Wanderlust.
-;; Copyright 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
+;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
+;; Copyright (C) 1998,1999,2000 Masahiro MURATA <muse@ba2.so-net.ne.jp>
+;; Copyright (C) 1999,2000 TSUMURA Tomoaki <tsumura@kuis.kyoto-u.ac.jp>
+;; Copyright (C) 1999,2000 Kenichi OKADA <okada@opaopa.org>
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
+;; Masahiro MURATA <muse@ba2.so-net.ne.jp>
+;; TSUMURA Tomoaki <tsumura@kuis.kyoto-u.ac.jp>
+;; Kenichi OKADA <okada@opaopa.org>
;; Keywords: mail, net news
;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen).
(defvar wl-summary-buffer-saved-message nil)
(defvar wl-summary-buffer-prev-folder-func nil)
(defvar wl-summary-buffer-next-folder-func nil)
+(defvar wl-summary-buffer-next-message-func nil)
(defvar wl-summary-buffer-exit-func nil)
+(defvar wl-summary-buffer-number-list nil)
+
(defvar wl-thread-indent-level-internal nil)
(defvar wl-thread-have-younger-brother-str-internal nil)
(defvar wl-thread-youngest-child-str-internal nil)
(defvar wl-summary-search-buf-name " *wl-search-subject*")
(defvar wl-summary-delayed-update nil)
+(defvar wl-summary-get-petname-func 'wl-address-get-petname-1)
+
(defvar wl-summary-message-regexp "^ *\\([0-9]+\\)")
(defvar wl-summary-shell-command-last "")
(make-variable-buffer-local 'wl-thread-space-str-internal)
(make-variable-buffer-local 'wl-summary-buffer-prev-folder-func)
(make-variable-buffer-local 'wl-summary-buffer-next-folder-func)
+(make-variable-buffer-local 'wl-summary-buffer-next-message-func)
(make-variable-buffer-local 'wl-summary-buffer-exit-func)
+(make-variable-buffer-local 'wl-summary-buffer-number-list)
;; internal functions (dummy)
(unless (fboundp 'wl-summary-append-message-func-internal)
(eword-decode-string
(if wl-use-petname
(or
- (wl-address-get-petname-1 to)
+ (funcall wl-summary-get-petname-func to)
(car
(std11-extract-address-components to))
to)
entity "newsgroups"))
(setq retval (concat "Ng:" ng)))))
(if wl-use-petname
- (setq retval (or (wl-address-get-petname-1 from)
+ (setq retval (or (funcall wl-summary-get-petname-func from)
(car (std11-extract-address-components from))
from))
(setq retval from)))
(defun wl-summary-simple-from (string)
(if wl-use-petname
- (or (wl-address-get-petname-1 string)
+ (or (funcall wl-summary-get-petname-func string)
(car (std11-extract-address-components string))
string)
string))
(define-key wl-summary-mode-map "p" 'wl-summary-prev)
(define-key wl-summary-mode-map "N" 'wl-summary-down)
(define-key wl-summary-mode-map "P" 'wl-summary-up)
-; (define-key wl-summary-mode-map "w" 'wl-draft)
+;;;(define-key wl-summary-mode-map "w" 'wl-draft)
(define-key wl-summary-mode-map "w" 'wl-summary-write)
- (define-key wl-summary-mode-map "W" 'wl-summary-write-current-newsgroup)
-; (define-key wl-summary-mode-map "e" 'wl-draft-open-file)
+ (define-key wl-summary-mode-map "W" 'wl-summary-write-current-folder)
+;;;(define-key wl-summary-mode-map "e" 'wl-draft-open-file)
(define-key wl-summary-mode-map "e" 'wl-summary-save)
(define-key wl-summary-mode-map "\C-c\C-o" 'wl-jump-to-draft-buffer)
(define-key wl-summary-mode-map "H" 'wl-summary-redisplay-all-header)
(if wl-summary-buffer-disp-msg
(wl-summary-redisplay)))
-(defun wl-summary-collect-unread (mark-alist &optional folder)
- (let (mark ret-val)
- (while mark-alist
- (setq mark (cadr (car mark-alist)))
- (and mark
- (or (string= mark wl-summary-new-mark)
- (string= mark wl-summary-unread-uncached-mark)
- (string= mark wl-summary-unread-cached-mark))
- (setq ret-val (cons (car (car mark-alist)) ret-val)))
- (setq mark-alist (cdr mark-alist)))
- ret-val))
-
(defun wl-summary-count-unread (mark-alist &optional folder)
(let ((new 0)
(unread 0)
(defun wl-summary-reedit (&optional arg)
"Re-edit current message.
-If optional argument is non-nil, Supersedes message"
+If ARG is non-nil, Supersedes message"
(interactive "P")
(if arg
(wl-summary-supersedes-message)
(cond
((and
(re-search-forward
- (concat "^\\($\\|[Cc]ontent-[Tt]ype:[ \t]+multipart/report\\)") nil t)
+ (concat "^\\($\\|[Cc]ontent-[Tt]ype:[ \t]+multipart/\\(report\\|mixed\\)\\)") nil t)
(not (bolp))
(re-search-forward "boundary=\"\\([^\"]+\\)\"" nil t))
(let ((boundary (buffer-substring (match-beginning 1) (match-end 1)))
(cond
((and (setq start (re-search-forward
(concat "^--" boundary "\n"
+ "\\([Cc]ontent-[Dd]escription:.*\n\\)?"
"[Cc]ontent-[Tt]ype:[ \t]+"
"\\(message/rfc822\\|text/rfc822-headers\\)\n"
"\\(.+\n\\)*\n") nil t))
(message "Resending message to %s...done" address))))
(defun wl-summary-msgdb-load-async (folder)
- "Loading msgdb and selecting folder is executed asynchronously in IMAP4."
+ "Loading msgdb and selecting FOLDER is executed asynchronously in IMAP4."
(if (and (elmo-folder-plugged-p folder)
(eq (elmo-folder-get-type folder) 'imap4))
(let ((spec (elmo-folder-get-spec folder))
(defun wl-summary-mode ()
"Major mode for reading threaded messages.
-The keys that are defined for this mode are:\\<wl-summary-mode-map>
-
-SPC Read messages.
-DEL Back-scroll this message.
-. Force to display this message.
-RET Make this message scroll up with one line.
-M-RET - Make this message scroll down with one line.
-
-C-n Go to the next line.
-C-p Go to the previous line.
-n Move to below then display.
-N Move to next unread.
-p Move to above then display.
-P Move to previous unread.
-s Sync current folder.
-t Same as 's' but force update.
-g Go to the folder which you input.
-w Write a message. A new draft is prepared.
-a Answer to this message. A new draft is prepared in Draft mode.
-f Forward this message to a third person. A new draft is prepared in
- Draft mode and this message is automatically attached.
-v Toggle \"Summary and Folder view\".
- You can quickly put the delete marks since the next message is not
- displayed.
-i Prefetch message if uncached.
-o Put the refile mark('o') on this message.
-! Mark current message as unread.
-$ Toggle mark current message as important.
-d Put the delete mark('D') on this message.
-c Check all messages as read.
-* Put the temporal mark('*') on this message.
-u Cancel the mark on this message.
-x Process marked messages.
-
-mo Put the refile mark onto all messages marked with '*'.
- This is very convenient to refile all messages picked by '?'.
-md Put the delete mark onto all messages marked with '*'.
-mi Prefetch all messages marked with '*'.
-mu Unmark all target-marked messages.
-mt Put the '*' mark onto all messages which belong to th current thread.
-ma Put the '*' mark onto all messages.
-? Pick messages according to a pick pattern which you input,
- then put the '*' mark onto them.
-q Goto folder mode.
-"
+See Info under Wanderlust for full documentation.
+
+Special commands:
+\\{wl-summary-mode-map}
+
+Entering Folder mode calls the value of `wl-summary-mode-hook'."
(interactive)
(unless (interactive-p) (kill-all-local-variables))
(setq major-mode 'wl-summary-mode)
(setq mode-name "Summary")
(use-local-map wl-summary-mode-map)
-;; (setq default-directory (or wl-tmp-dir (expand-file-name "~/")))
+;;;(setq default-directory (or wl-tmp-dir (expand-file-name "~/")))
(setq buffer-read-only t)
(setq truncate-lines t)
-;; (make-local-variable 'tab-width)
-;; (setq tab-width 1)
+;;;(make-local-variable 'tab-width)
+;;;(setq tab-width 1)
(buffer-disable-undo (current-buffer))
(if wl-use-semi
(setq wl-summary-buffer-message-redisplay-func
wl-summary-buffer-folder-indicator
wl-summary-buffer-unread-status))
(easy-menu-add wl-summary-mode-menu)
+ (when wl-summary-lazy-highlight
+ (make-local-hook 'window-scroll-functions)
+ (add-hook 'window-scroll-functions 'wl-highlight-summary-window nil t))
;; This hook may contain the function `wl-setup-summary' for reasons
;; of system internal to accord facilities for the Emacs variants.
(run-hooks 'wl-summary-mode-hook))
(defun wl-summary-overview-entity-compare-by-date (x y)
- "Compare entity by date"
+ "Compare entity X and Y by date."
(condition-case nil
(string<
(timezone-make-date-sortable
(error))) ;; ignore error.
(defun wl-summary-overview-entity-compare-by-number (x y)
- "Compare entity by number"
+ "Compare entity X and Y by number."
(<
(elmo-msgdb-overview-entity-get-number x)
(elmo-msgdb-overview-entity-get-number y)))
(defun wl-summary-overview-entity-compare-by-from (x y)
- "Compare entity by from"
+ "Compare entity X and Y by from."
(string<
(wl-address-header-extract-address
(or (elmo-msgdb-overview-entity-get-from-no-decode x)
wl-summary-no-from-message))))
(defun wl-summary-overview-entity-compare-by-subject (x y)
- "Compare entity by subject"
+ "Compare entity X and Y by subject."
(string< (elmo-msgdb-overview-entity-get-subject-no-decode x)
(elmo-msgdb-overview-entity-get-subject-no-decode y)))
expunged)
(fset 'wl-summary-append-message-func-internal
(wl-summary-get-append-message-func))
+ (wl-summary-buffer-number-column-detect nil)
(erase-buffer)
(message "Re-scanning...")
(setq i 0)
(setq wl-thread-entity-hashtb (elmo-make-hash (* (length overview) 2)))
(setq wl-thread-entity-list nil)
(setq wl-thread-entities nil)
+ (setq wl-summary-buffer-number-list nil)
(setq wl-summary-buffer-target-mark-list nil)
(setq wl-summary-buffer-refile-list nil)
(setq wl-summary-buffer-delete-list nil)
(cdar wl-summary-delayed-update)
overview mark-alist nil t)
(setq wl-summary-delayed-update (cdr wl-summary-delayed-update))))
- (message "Constructing summary structure...done.")
+ (message "Constructing summary structure...done")
(set-buffer cur-buf)
- (when (eq wl-summary-buffer-view 'thread)
- (message "Inserting thread...")
- (wl-thread-insert-top)
- (message "Inserting thread...done."))
+ (if (eq wl-summary-buffer-view 'thread)
+ (progn
+ (message "Inserting thread...")
+ (wl-thread-insert-top)
+ (message "Inserting thread...done"))
+ (wl-summary-make-number-list))
(when wl-use-scoring
(setq wl-summary-scored nil)
(wl-summary-score-headers nil msgdb
(elmo-msgdb-mark-save
path
(elmo-msgdb-get-mark-alist wl-summary-buffer-msgdb))
-;; (elmo-folder-set-info-hashtb
-;; (elmo-string wl-summary-buffer-folder-name)
-;; nil nil
-;; 0
-;; (+ wl-summary-buffer-new-count wl-summary-buffer-unread-count))
-;; (setq wl-folder-info-alist-modified t)
+;;; (elmo-folder-set-info-hashtb
+;;; (elmo-string wl-summary-buffer-folder-name)
+;;; nil nil
+;;; 0
+;;; (+ wl-summary-buffer-new-count wl-summary-buffer-unread-count))
+;;; (setq wl-folder-info-alist-modified t)
(setq wl-summary-buffer-mark-modified nil)
(run-hooks 'wl-summary-buffer-mark-saved-hook))))))
(if (or wl-summary-buffer-refile-list
wl-summary-buffer-copy-list
wl-summary-buffer-delete-list)
- (if (y-or-n-p "Marks remain to be executed. Execute them?")
+ (if (y-or-n-p "Marks remain to be executed. Execute them? ")
(progn
(wl-summary-exec)
(if (or wl-summary-buffer-refile-list
(wl-summary-msgdb-save)))
(defun wl-summary-force-exit ()
- "Exit current summary. Buffer is deleted even the buffer is sticky"
+ "Exit current summary. Buffer is deleted even the buffer is sticky."
(interactive)
(wl-summary-exit 'force-exit))
(defun wl-summary-exit (&optional force-exit)
- "Exit current summary. if FORCE-EXIT, exits even the summary is sticky."
+ "Exit current summary. if FORCE-EXIT, exits even the summary is sticky."
(interactive "P")
(let ((summary-buf (current-buffer))
(sticky (wl-summary-sticky-p))
(if (setq message-buf (get-buffer wl-message-buf-name))
(if (setq message-win (get-buffer-window message-buf))
(delete-window message-win)))
+ (if (and wl-summary-use-frame
+ (> (length (visible-frame-list)) 1))
+ (delete-frame))
(if (setq folder-buf (get-buffer wl-folder-buffer-name))
- (if (setq folder-win (get-buffer-window folder-buf))
- ;; folder win is already displayed.
- (select-window folder-win)
- ;; folder win is not displayed.
- (switch-to-buffer folder-buf))
+ (if wl-summary-use-frame
+ (let (select-frame)
+ (save-selected-window
+ (dolist (frame (visible-frame-list))
+ (select-frame frame)
+ (if (get-buffer-window folder-buf)
+ (setq select-frame frame))))
+ (if select-frame
+ (select-frame select-frame)
+ (switch-to-buffer folder-buf)))
+ (if (setq folder-win (get-buffer-window folder-buf))
+ ;; folder win is already displayed.
+ (select-window folder-win)
+ ;; folder win is not displayed.
+ (switch-to-buffer folder-buf)))
;; currently no folder buffer
(wl-folder))
(and wl-folder-move-cur-folder
(let* ((msgdb wl-summary-buffer-msgdb)
(number-alist (elmo-msgdb-get-number-alist msgdb)))
(elmo-mark-as-read wl-summary-buffer-folder-name
- (mapcar
+ (mapcar
(lambda (msgid)
(car (rassoc msgid number-alist)))
seen-list) msgdb)))
(message "%s" ret-val))
ret-val))
+(defsubst wl-summary-sync-all-init ()
+ (wl-summary-cleanup-temp-marks)
+ (erase-buffer)
+ (wl-summary-set-message-modified)
+ (wl-summary-set-mark-modified)
+ (setq wl-thread-entity-hashtb (elmo-make-hash
+ (* (length (elmo-msgdb-get-number-alist
+ wl-summary-buffer-msgdb)) 2)))
+ (setq wl-summary-buffer-msgdb (elmo-msgdb-clear)) ;;'(nil nil nil nil))
+ (setq wl-thread-entity-list nil)
+ (setq wl-thread-entities nil)
+ (setq wl-summary-buffer-number-list nil)
+ (setq wl-summary-buffer-target-mark-list nil)
+ (setq wl-summary-buffer-refile-list nil)
+ (setq wl-summary-buffer-copy-list nil)
+ (setq wl-summary-buffer-delete-list nil)
+ (wl-summary-buffer-number-column-detect nil))
+
(defun wl-summary-sync (&optional unset-cursor force-range)
(interactive)
(let* ((folder wl-summary-buffer-folder-name)
(msgdb-dir (elmo-msgdb-expand-path
folder))
(range (or force-range (wl-summary-input-range folder)))
- mes seen-list)
- (cond ((string= range "all")
+ mes seen-list killed-list)
+ (cond ((or (string= range "all")
+ (string= range "all-visible"))
;; initialize buffer local databases.
(unless (elmo-folder-plugged-p folder) ; forbidden
(error "Unplugged"))
- (wl-summary-cleanup-temp-marks)
(setq seen-list
(nconc
(elmo-msgdb-mark-alist-to-seen-list
(concat wl-summary-important-mark
wl-summary-read-uncached-mark))
(elmo-msgdb-seen-load msgdb-dir)))
- (setq wl-thread-entity-hashtb (elmo-make-hash
- (* (length (elmo-msgdb-get-number-alist
- wl-summary-buffer-msgdb)) 2)))
- (setq wl-summary-buffer-msgdb (elmo-msgdb-clear)) ;;'(nil nil nil nil))
- (setq wl-thread-entity-list nil)
- (setq wl-thread-entities nil)
- (setq wl-summary-buffer-target-mark-list nil)
- (setq wl-summary-buffer-refile-list nil)
- (setq wl-summary-buffer-copy-list nil)
- (setq wl-summary-buffer-delete-list nil)
- (wl-summary-buffer-number-column-detect nil)
- (elmo-clear-killed folder)
- (setq mes (wl-summary-sync-update3 seen-list unset-cursor))
+ (setq killed-list (elmo-msgdb-killed-list-load msgdb-dir))
+ (elmo-clear-killed wl-summary-buffer-folder-name)
+ (condition-case nil
+ (setq mes (wl-summary-sync-update3 seen-list unset-cursor
+ (string= range "all")))
+ (quit
+ ;; Resume killed-list if quit.
+ (message "") ; clear minibuffer.
+ (elmo-msgdb-killed-list-save msgdb-dir killed-list)))
(elmo-msgdb-seen-save msgdb-dir nil) ; delete all seen.
(if mes (message "%s" mes)))
-; (wl-summary-sync-all folder t))
+;;; (wl-summary-sync-all folder t))
((string= range "rescan")
(let ((msg (wl-summary-message-number)))
(wl-summary-rescan)
the-email
(elmo-get-hash-val the-email wl-address-petname-hash)
(wl-address-header-extract-realname
- (cdr (assoc (downcase the-email)
- wl-address-completion-list))) t)
+ (cdr (assoc
+ (let ((completion-ignore-case t) comp)
+ (setq comp
+ (try-completion the-email wl-address-completion-list))
+ (if (equal comp t) the-email comp))
+ wl-address-completion-list))) t)
"edited")
((eq char ?d)
;; Delete Addresses
(nth 1 address)
(nth 0 address)
result)))
- ;; i'd like to update summary-buffer, but...
- ;;(wl-summary-rescan)
+;;; i'd like to update summary-buffer, but...
+;;; (wl-summary-rescan)
(run-hooks 'wl-summary-edit-addresses-hook)))))
(defun wl-summary-incorporate (&optional arg)
"Check and prefetch all uncached messages.
-If optional argument is non-nil, checking is omitted."
+If ARG is non-nil, checking is omitted."
(interactive "P")
(unless arg
(save-excursion
(widen)
(y-or-n-p
(format
- "Message from %s has %d bytes. Prefetch it?"
+ "Message from %s has %d bytes. Prefetch it? "
(concat
"[ "
(save-match-data
wl-summary-buffer-new-count)))
new-mark))))))))
-;(defvar wl-summary-message-uncached-marks
-; (list wl-summary-new-mark
-; wl-summary-unread-uncached-mark
-; wl-summary-read-uncached-mark))
+;;(defvar wl-summary-message-uncached-marks
+;; (list wl-summary-new-mark
+;; wl-summary-unread-uncached-mark
+;; wl-summary-read-uncached-mark))
(defun wl-summary-prefetch-region (beg end &optional prefetch-marks)
(interactive "r")
(wl-highlight-summary-current-line))))))
(defun wl-summary-delete-all-marks (mark-alist mark)
- "Delete all MARKs in MARK-ALIST"
+ "Delete all MARKs in MARK-ALIST."
(let ((malist mark-alist)
(ret-val mark-alist)
entity)
(interactive "r")
(save-excursion
(save-restriction
- (narrow-to-region beg end);(save-excursion (goto-char end)
- ; (end-of-line) (point)))
+ (narrow-to-region beg end)
+;;; use narrowing.
+;;; (save-excursion (goto-char end)
+;;; (end-of-line) (point)))
(goto-char (point-min))
(if (eq wl-summary-buffer-view 'thread)
(progn
(interactive "r")
(save-excursion
(save-restriction
- (narrow-to-region beg end);(save-excursion (goto-char end)
- ; (end-of-line) (point)))
+ (narrow-to-region beg end)
+;;; use narrowing.
+;;; (save-excursion (goto-char end)
+;;; (end-of-line) (point)))
(goto-char (point-min))
(if (eq wl-summary-buffer-view 'thread)
(progn
(defun wl-summary-mark-as-read-all ()
(interactive)
(if (or (not (interactive-p))
- (y-or-n-p "Mark all messages as read?"))
+ (y-or-n-p "Mark all messages as read? "))
(let* ((folder wl-summary-buffer-folder-name)
(cur-buf (current-buffer))
(msgdb wl-summary-buffer-msgdb)
- ;;(number-alist (elmo-msgdb-get-number-alist msgdb))
+ (number-alist (elmo-msgdb-get-number-alist msgdb))
(mark-alist (elmo-msgdb-get-mark-alist msgdb))
(malist mark-alist)
(inhibit-read-only t)
(case-fold-search nil)
msg mark)
(message "Setting all msgs as read...")
- (elmo-mark-as-read folder (wl-summary-collect-unread mark-alist)
+ (elmo-mark-as-read folder
+ (elmo-list-folder-unread
+ folder
+ number-alist
+ mark-alist
+ (list wl-summary-unread-cached-mark
+ wl-summary-unread-uncached-mark
+ wl-summary-new-mark))
msgdb)
(save-excursion
(goto-char (point-min))
(setq mark-alist
(elmo-msgdb-mark-set
mark-alist
- msg ;(cdr (assq msg number-alist))
+ msg
+;;; Use msg instead of (cdr (assq msg number-alist)).
+;;; (cdr (assq msg number-alist))
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))
+;;; (cdr (assq msg number-alist))
wl-summary-read-uncached-mark)))
(if wl-summary-highlight
(wl-highlight-summary-current-line nil nil t)))))
(setq wl-summary-buffer-unread-count 0)
(setq wl-summary-buffer-new-count 0)
(wl-summary-update-modeline)
- (message "Setting all msgs as read...done.")
+ (message "Setting all msgs as read...done")
(set-buffer-modified-p nil))))
(defun wl-summary-delete-cache ()
(number-alist (elmo-msgdb-get-number-alist msgdb))
(case-fold-search nil)
mark number unread new-mark)
-; (re-search-backward "^ *[0-9]+..[0-9]+/[0-9]+" nil t) ; set cursor line
+;;; (re-search-backward "^ *[0-9]+..[0-9]+/[0-9]+" nil t) ; set cursor line
(beginning-of-line)
(when (looking-at "^ *\\([0-9]+\\)[^0-9]\\([^0-9]\\)")
(progn
(elmo-msgdb-set-mark-alist msgdb mark-alist)
(wl-summary-count-unread mark-alist)
(wl-summary-update-modeline)
- (message "Resuming cache status...done.")
+ (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))
+;;; (number-alist (elmo-msgdb-get-number-alist msgdb))
(count (count-lines (point-min)(point-max)))
(i 0)
msg-num percent smark)
'wl-summary-resume-marks-and-highlight "Resuming all marks..."
percent))
(forward-line 1)))
- (message "Resuming all marks...done.")))
+ (message "Resuming all marks...done")))
(defun wl-summary-resume-marks ()
(let* ((msgdb wl-summary-buffer-msgdb)
(while mark-alist
(setq entity (car mark-alist))
(if (setq msg-num (car (rassoc (car entity) number-alist)))
- (progn ;(goto-char (point-min))
+ (progn
+;;; (goto-char (point-min))
(if (re-search-forward (format "^ *%s \\( \\)" msg-num) nil t)
(progn
(delete-region (match-beginning 1) (match-end 1))
'wl-summary-resume-marks "Resuming all marks..."
percent))
(setq mark-alist (cdr mark-alist)))
- (message "Resuming all marks...done."))))
+ (message "Resuming all marks...done"))))
(defun wl-summary-delete-messages-on-buffer (msgs &optional deleting-info)
(interactive)
(progn
(delete-region (match-beginning 0) (match-end 0))
(delete-char 1) ; delete '\n'
- )))
+ (setq wl-summary-buffer-number-list
+ (delq (car msgs) wl-summary-buffer-number-list)))))
(when (and deleting-info
(> len elmo-display-progress-threshold))
(setq i (1+ i))
ret-val))
(defun wl-summary-set-status-marks (mark-alist before after)
- "Set the BEFORE marks to AFTER"
+ "Set the BEFORE marks to AFTER."
(let ((ret-val mark-alist)
entity)
(while mark-alist
ret-val))
(defun wl-summary-set-status-marks-on-buffer (before after)
- "Set the MARKS marks on buffer"
+ "Set the MARKS marks on buffer."
(interactive)
(save-excursion
(goto-char (point-min))
(defun wl-summary-get-append-message-func ()
(if (eq wl-summary-buffer-view 'thread)
'wl-summary-insert-thread-entity
-; 'wl-summary-insert-thread
+;;; 'wl-summary-insert-thread
'wl-summary-insert-summary))
(defun wl-summary-sort ()
(if (interactive-p) (message mes)))))
(defun wl-summary-confirm-appends (appends)
- (condition-case nil
- (let ((len (length appends))
- in)
- (if (> len wl-summary-update-confirm-threshold)
- (if (y-or-n-p (format "Too many messages(%d). Continue?" len))
- appends
- (setq in wl-summary-update-confirm-threshold)
- (catch 'end
- (while t
- (setq in (read-from-minibuffer "Update number: "
- (int-to-string in))
- in (string-to-int in))
- (if (< len in)
- (throw 'end len))
- (if (y-or-n-p (format "%d messages are disappeared. OK?"
- (max (- len in) 0)))
- (throw 'end in))))
- (nthcdr (max (- len in) 0) appends))
- appends))
- (quit nil)
- (error nil))) ;
-
-(defun wl-summary-sync-update3 (&optional seen-list unset-cursor)
+ (let ((len (length appends))
+ in)
+ (if (> len wl-summary-update-confirm-threshold)
+ (if (y-or-n-p (format "Too many messages(%d). Continue? " len))
+ appends
+ (setq in wl-summary-update-confirm-threshold)
+ (catch 'end
+ (while t
+ (setq in (read-from-minibuffer "Update number: "
+ (int-to-string in))
+ in (string-to-int in))
+ (if (< len in)
+ (throw 'end len))
+ (if (y-or-n-p (format "%d messages are disappeared. OK? "
+ (max (- len in) 0)))
+ (throw 'end in))))
+ (nthcdr (max (- len in) 0) appends))
+ appends)))
+
+(defun wl-summary-sync-update3 (&optional seen-list unset-cursor sync-all)
"Update the summary view."
(interactive)
(let* ((folder wl-summary-buffer-folder-name)
(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))
- (overview (elmo-msgdb-get-overview msgdb))
- ;;(location (elmo-msgdb-get-location msgdb))
+ (number-alist (elmo-msgdb-get-number-alist wl-summary-buffer-msgdb))
+ (mark-alist (elmo-msgdb-get-mark-alist wl-summary-buffer-msgdb))
+ (overview (elmo-msgdb-get-overview wl-summary-buffer-msgdb))
+;;; (location (elmo-msgdb-get-location msgdb))
(case-fold-search nil)
(elmo-mime-charset wl-summary-buffer-mime-charset)
(inhibit-read-only t)
in-folder
in-db curp
overview-append
- entity ret-val crossed crossed2 sync-all
+ entity ret-val crossed crossed2
update-thread update-top-list mark
expunged msgs unreads importants)
- ;(setq seen-list nil) ;for debug.
+;;; (setq seen-list nil) ;for debug.
(fset 'wl-summary-append-message-func-internal
(wl-summary-get-append-message-func))
;; Flush pending append operations (disconnected operation).
(wl-folder-confirm-existence folder 'force)
(message "Checking folder diff...")
(elmo-commit folder)
- (setq in-folder (elmo-list-folder folder))
- (setq in-db (sort (mapcar 'car number-alist) '<))
- (when (or (eq msgdb nil) ; trick for unplugged...
- (and (null overview)
- (null number-alist)
- (null mark-alist)))
- (setq sync-all t)
- (wl-summary-set-message-modified)
- (wl-summary-set-mark-modified)
- (erase-buffer))
+ (setq in-folder (elmo-list-folder folder sync-all))
+ (setq in-db (unless sync-all (sort (mapcar 'car number-alist) '<)))
(if (not elmo-use-killed-list)
(setq diff (if (eq (elmo-folder-get-type folder) 'multi)
(elmo-multi-list-bigger-diff in-folder in-db)
(setq diff (elmo-list-diff in-folder in-db)))
(setq initial-append-list (car diff))
(setq delete-list (cadr diff))
- (message "Checking folder diff...done.")
+ (message "Checking folder diff...done")
+ ;; Confirm appended message number.
+ (setq append-list (wl-summary-confirm-appends initial-append-list))
+ (when (and elmo-use-killed-list
+ (not (eq (length initial-append-list)
+ (length append-list)))
+ (setq diff (elmo-list-diff initial-append-list append-list)))
+ (elmo-msgdb-append-to-killed-list folder (car diff)))
+ ;; Setup sync-all
+ (if sync-all (wl-summary-sync-all-init))
;; Don't delete important-marked msgs other than 'internal.
(unless (eq (elmo-folder-get-type folder) 'internal)
(setq delete-list
(elmo-nntp-max-number-precedes-list-active-p))
;; XXX this does not work correctly in rare case.
(setq delete-list
- (wl-summary-delete-canceled-msgs-from-list delete-list msgdb)))
+ (wl-summary-delete-canceled-msgs-from-list
+ delete-list
+ wl-summary-buffer-msgdb)))
(if (or (equal diff '(nil nil))
(equal diff '(nil))
(and (eq (length delete-list) 0)
(progn
;; For max-number update...
(if (and (elmo-folder-contains-type folder 'nntp)
- (elmo-nntp-max-number-precedes-list-active-p)
- (elmo-update-number folder msgdb))
+ (elmo-nntp-max-number-precedes-list-active-p)
+ (elmo-update-number folder wl-summary-buffer-msgdb))
(wl-summary-set-message-modified)
(setq ret-val (format "No update is needed for \"%s\"" folder))))
(when delete-list
(message "Deleting...")
- (elmo-msgdb-delete-msgs folder delete-list msgdb t) ; reserve cache.
- ;;(set-buffer cur-buf)
+ (elmo-msgdb-delete-msgs folder delete-list
+ wl-summary-buffer-msgdb t) ; reserve cache.
+;;; (set-buffer cur-buf)
(wl-summary-delete-messages-on-buffer delete-list "Deleting...")
- (message "Deleting...done."))
- ;;(set-buffer cur-buf)
+ (message "Deleting...done"))
+;;; (set-buffer cur-buf)
;; Change "New" marks to "Uncached Unread" marks.
(wl-summary-set-status-marks mark-alist
wl-summary-new-mark
(wl-summary-set-status-marks-on-buffer
wl-summary-new-mark
wl-summary-unread-uncached-mark)
- ;; Confirm appended message number.
- (setq append-list (wl-summary-confirm-appends initial-append-list))
- (when (and elmo-use-killed-list
- (not (eq (length initial-append-list)
- (length append-list)))
- (setq diff (elmo-list-diff initial-append-list append-list)))
- (elmo-msgdb-append-to-killed-list folder (car diff)))
(setq num (length append-list))
(if append-list
(progn
;; delete duplicated messages.
(when (elmo-folder-contains-multi folder)
(setq crossed (elmo-multi-delete-crossposts
- msgdb result))
+ wl-summary-buffer-msgdb result))
(setq result (cdr crossed))
(setq crossed (car crossed)))
(setq overview-append (car result))
- (setq msgdb (elmo-msgdb-append msgdb result t))
+ (setq wl-summary-buffer-msgdb
+ (elmo-msgdb-append wl-summary-buffer-msgdb result t))
;; set these value for append-message-func
- (setq overview (elmo-msgdb-get-overview msgdb))
- (setq number-alist (elmo-msgdb-get-number-alist msgdb))
- (setq mark-alist (elmo-msgdb-get-mark-alist msgdb))
- ;; (setq location (elmo-msgdb-get-location msgdb))
+ (setq overview (elmo-msgdb-get-overview wl-summary-buffer-msgdb))
+ (setq number-alist (elmo-msgdb-get-number-alist
+ wl-summary-buffer-msgdb))
+ (setq mark-alist (elmo-msgdb-get-mark-alist
+ wl-summary-buffer-msgdb))
+;;; (setq location (elmo-msgdb-get-location msgdb))
(setq curp overview-append)
(setq num (length curp))
(setq wl-summary-delayed-update nil)
update-top-list)
(wl-thread-update-indent-string-thread
(elmo-uniq-list update-top-list)))
- (message "Updating thread...done.")
- ;;(set-buffer cur-buf)
+ (message "Updating thread...done")
+;;; (set-buffer cur-buf)
))
+ (unless (eq wl-summary-buffer-view 'thread)
+ (wl-summary-make-number-list))
(wl-summary-set-message-modified)
(wl-summary-set-mark-modified)
- (setq wl-summary-buffer-msgdb msgdb)
(when (and sync-all (eq wl-summary-buffer-view 'thread))
(elmo-kill-buffer wl-summary-search-buf-name)
(message "Inserting thread...")
(setq wl-thread-entity-cur 0)
(wl-thread-insert-top)
- (message "Inserting thread...done."))
+ (message "Inserting thread...done"))
(if elmo-use-database
(elmo-database-close))
(run-hooks 'wl-summary-sync-updated-hook)
;; scoring
(when wl-use-scoring
(setq wl-summary-scored nil)
- (wl-summary-score-headers nil msgdb
+ (wl-summary-score-headers nil wl-summary-buffer-msgdb
(and sync-all
(wl-summary-rescore-msgs number-alist))
sync-all)
(wl-folder-set-folder-updated folder (list 0
(wl-summary-count-unread
(elmo-msgdb-get-mark-alist
- msgdb))
+ wl-summary-buffer-msgdb))
(length in-folder)))
(wl-summary-update-modeline)
(wl-summary-buffer-number-column-detect t)
(elmo-display-progress
'wl-summary-highlight-msgs "Highlighting..."
(/ (* i 100) len)))))
- (message "Highlighting...done."))))
+ (message "Highlighting...done"))))
(defun wl-summary-message-number ()
(save-excursion
(defun wl-summary-move (src dsts-msgs)
(let* ((dsts (car dsts-msgs)) ; (+foo +bar)
-;; (msgs (cdr dsts-msgs)) ; (1 2 3)
-;; (msgdb wl-summary-buffer-msgdb)
-;; result)
+;;; (msgs (cdr dsts-msgs)) ; (1 2 3)
+;;; (msgdb wl-summary-buffer-msgdb)
+;;; result)
)
(while dsts
(setq dsts (cdr dsts)))))
(elmo-msgdb-delete-msgs wl-summary-buffer-folder-name
dels wl-summary-buffer-msgdb t)
(wl-summary-delete-messages-on-buffer dels)
- (message "Resuming summary status...done."))
+ (message "Resuming summary status...done"))
;; delete resume-file
(elmo-dop-append-list-save wl-summary-buffer-folder-name nil t)
(when append-list
(set-buffer cur-buf)
(if (null dels)
(message "No message to delete.")
- (if (y-or-n-p (format "%s has %d message(s). Delete all?"
+ (if (y-or-n-p (format "%s has %d message(s). Delete all? "
wl-summary-buffer-folder-name
(length dels)))
(progn
wl-summary-buffer-msgdb)
(elmo-msgdb-delete-msgs wl-summary-buffer-folder-name
dels wl-summary-buffer-msgdb)
- ;;(elmo-msgdb-save wl-summary-buffer-folder-name nil)
+;;; (elmo-msgdb-save wl-summary-buffer-folder-name nil)
(wl-summary-set-message-modified)
(wl-summary-set-mark-modified)
(wl-folder-set-folder-updated wl-summary-buffer-folder-name
(list 0 0 0))
- ;; for thread.
- ;; (setq wl-thread-top-entity '(nil t nil nil))
+;;; for thread.
+;;; (setq wl-thread-top-entity '(nil t nil nil))
(setq wl-summary-buffer-unread-count 0)
(setq wl-summary-buffer-new-count 0)
(wl-summary-update-modeline)
(let ((inhibit-read-only t)
(buffer-read-only nil))
(erase-buffer))
- ;; (if wl-summary-cache-use (wl-summary-save-view-cache))
- (message "Deleting...done.")
+;;; (if wl-summary-cache-use (wl-summary-save-view-cache))
+ (message "Deleting...done")
t)
nil))))
(defun wl-summary-toggle-thread (&optional arg)
- "Toggle thread status (T)hread and (S)equencial."
+ "Toggle thread status (T)hread and (S)equential.
+If ARG, without confirm."
(interactive "P")
(when (or arg
(y-or-n-p (format "Toggle threading? (y=%s): "
(setq ret-val
(condition-case nil
(read (current-buffer))
- (error (error "reading failed")))))
+ (error (error "Reading failed")))))
(kill-buffer tmp-buffer)
ret-val)))
(interactive "P")
(if (wl-summary-sticky-p)
(message "Current summary buffer is already sticky.")
- (when (or force (y-or-n-p "Stick current summary buffer?"))
+ (when (or force (y-or-n-p "Stick current summary buffer? "))
(wl-summary-toggle-disp-msg 'off)
(wl-summary-switch-to-clone-buffer
(wl-summary-sticky-buffer-name
wl-summary-buffer-folder-name))
;;; ???hang up
-; (rename-buffer (wl-summary-sticky-buffer-name
-; wl-summary-buffer-folder-name)))
+;;; (rename-buffer (wl-summary-sticky-buffer-name
+;;; wl-summary-buffer-folder-name)))
(message "Folder `%s' is now sticky." wl-summary-buffer-folder-name))))
(defun wl-summary-switch-to-clone-buffer (buffer-name)
wl-summary-buffer-number-regexp
wl-summary-buffer-message-modified
wl-summary-buffer-mark-modified
- wl-summary-buffer-thread-modified)
+ wl-summary-buffer-thread-modified
+ wl-summary-buffer-number-list)
(and (eq wl-summary-buffer-view 'thread)
'(wl-thread-entity-hashtb
wl-thread-entities
(delete-window mes-win)
(run-hooks 'wl-summary-toggle-disp-off-hook))))
+(defun wl-summary-make-number-list ()
+ (setq wl-summary-buffer-number-list
+ (mapcar
+ (lambda (x) (elmo-msgdb-overview-entity-get-number x))
+ (elmo-msgdb-get-overview wl-summary-buffer-msgdb))))
+
+(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)))
+ wl-summary-important-mark))))
+
(defun wl-summary-goto-folder-subr (&optional folder scan-type other-window
sticky interactive scoring)
- "Display target folder on summary"
+ "Display target folder on summary."
(interactive)
(let* ((keep-cursor (memq this-command
wl-summary-keep-cursor-command))
(let ((case-fold-search nil)
(inhibit-read-only t)
(buffer-read-only nil))
+ ;; Load msgdb
+ (setq wl-summary-buffer-msgdb nil) ; new msgdb
+ (setq wl-summary-buffer-msgdb
+ (wl-summary-msgdb-load-async fld))
+ (if (null wl-summary-buffer-msgdb)
+ (setq wl-summary-buffer-msgdb
+ (elmo-msgdb-load (elmo-string fld))))
(erase-buffer)
- ;; resume summary cache
+ ;; Resume summary view
(if wl-summary-cache-use
(let* ((dir (elmo-msgdb-expand-path fld))
(cache (expand-file-name wl-summary-cache-file dir))
(view (expand-file-name wl-summary-view-file dir)))
(when (file-exists-p cache)
- (as-binary-input-file
- (insert-file-contents cache))
+ (insert-file-contents-as-binary cache)
(elmo-set-buffer-multibyte
default-enable-multibyte-characters)
(decode-mime-charset-region
(setq wl-summary-buffer-view
(wl-summary-load-file-object view)))
(if (eq wl-summary-buffer-view 'thread)
- (wl-thread-resume-entity fld))))
- ;; Load msgdb
- (setq wl-summary-buffer-msgdb nil) ; new msgdb
- (setq wl-summary-buffer-msgdb
- (wl-summary-msgdb-load-async fld))
- (if (null wl-summary-buffer-msgdb)
- (setq wl-summary-buffer-msgdb
- (elmo-msgdb-load (elmo-string fld))))
+ (wl-thread-resume-entity fld)
+ (wl-summary-make-number-list)))
+ (setq wl-summary-buffer-view
+ (wl-summary-load-file-object
+ (expand-file-name wl-summary-view-file
+ (elmo-msgdb-expand-path fld))))
+ (wl-summary-rescan))
(wl-summary-count-unread
(elmo-msgdb-get-mark-alist wl-summary-buffer-msgdb))
(wl-summary-update-modeline)))
(wl-summary-buffer-number-column-detect t)
(wl-summary-disp-msg fld (and reuse-buf keep-cursor))
(unless (and reuse-buf keep-cursor)
- (setq hilit wl-summary-highlight)
+ ;(setq hilit wl-summary-highlight)
(unwind-protect
(let ((wl-summary-highlight (if reuse-buf wl-summary-highlight))
(wl-use-scoring
(set-buffer-modified-p nil)
(goto-char (point-min))
(if (wl-summary-cursor-down t)
- (let ((unreadp (wl-thread-next-mark-p
- (wl-thread-entity-get-mark
- (wl-summary-message-number))
- wl-summary-move-order)))
- (cond ((and wl-auto-select-first unreadp)
+ (let ((unreadp (wl-summary-next-message
+ (wl-summary-message-number)
+ 'down t)))
+ (cond ((and wl-auto-select-first
+ (wl-summary-auto-select-msg-p unreadp))
+ ;; wl-auto-select-first is non-nil and
+ ;; unreadp is non-nil but not important
(setq retval 'disp-msg))
- ((not unreadp)
+ ((not (wl-summary-auto-select-msg-p unreadp))
+ ;; unreadp is nil or important
(setq retval 'more-next))))
(goto-char (point-max))
(if (elmo-folder-plugged-p folder)
(forward-line -1)
(wl-summary-prev))
(setq retval 'more-next))
- (setq wl-summary-highlight hilit)
+ ;(setq wl-summary-highlight hilit)
(if (and wl-summary-highlight
+ (not wl-summary-lazy-highlight)
(not reuse-buf))
(if (and wl-summary-highlight-partial-threshold
(> (count-lines (point-min) (point-max))
retval))
(defun wl-summary-summary-line-already-exists-p (parent-number buffer)
- "returns the depth."
+ "Return the depth."
(set-buffer buffer)
(goto-char (point-max))
(let ((depth 0))
(defun wl-summary-default-subject-filter (subject)
(let ((case-fold-search t))
- (setq subject (elmo-replace-in-string subject "[ \t]*\\(re\\|was\\):" ""))
+ (setq subject (elmo-replace-in-string subject "[ \t]*\\(re\\|was\\)[:>]" ""))
(setq subject (elmo-replace-in-string subject "[ \t]" ""))
(elmo-replace-in-string subject "^\\[.*\\]" "")))
(let* ((this-id (elmo-msgdb-overview-entity-get-id entity))
(parent-entity
(elmo-msgdb-overview-get-parent-entity entity overview));; temp
- ;;(parent-id (elmo-msgdb-overview-entity-get-id parent-entity))
+;;; (parent-id (elmo-msgdb-overview-entity-get-id parent-entity))
(parent-number (elmo-msgdb-overview-entity-get-number parent-entity))
(case-fold-search t)
msg overview2 cur-entity linked retval delayed-entity)
(folder wl-summary-buffer-folder-name)
(msgdb wl-summary-buffer-msgdb)
(mark-alist (elmo-msgdb-get-mark-alist msgdb))
- ;;(number-alist (elmo-msgdb-get-number-alist msgdb))
+;;; (number-alist (elmo-msgdb-get-number-alist msgdb))
new-mark visible mark)
(if number
(progn
(goto-char start) ; avoid moving cursor to
; the bottom line.
(while dst-msgs
- ;;(elmo-msgdb-add-msgs-to-seen-list
- ;; (car (car dst-msgs)) ;dst-folder
- ;; (cdr (car dst-msgs)) ;msgs
- ;; wl-summary-buffer-msgdb
- ;; (concat wl-summary-important-mark
- ;; wl-summary-read-uncached-mark))
+;;; (elmo-msgdb-add-msgs-to-seen-list
+;;; (car (car dst-msgs)) ;dst-folder
+;;; (cdr (car dst-msgs)) ;msgs
+;;; wl-summary-buffer-msgdb
+;;; (concat wl-summary-important-mark
+;;; wl-summary-read-uncached-mark))
(setq result nil)
(condition-case nil
(setq result (elmo-move-msgs wl-summary-buffer-folder-name
;; begin cOpy...
(setq dst-msgs (wl-inverse-alist copies wl-summary-buffer-copy-list))
(while dst-msgs
- ;;(elmo-msgdb-add-msgs-to-seen-list
- ;; (car (car dst-msgs)) ;dst-folder
- ;; (cdr (car dst-msgs)) ;msgs
- ;; wl-summary-buffer-msgdb
- ;; (concat wl-summary-important-mark
- ;; wl-summary-read-uncached-mark))
+;;; (elmo-msgdb-add-msgs-to-seen-list
+;;; (car (car dst-msgs)) ;dst-folder
+;;; (cdr (car dst-msgs)) ;msgs
+;;; wl-summary-buffer-msgdb
+;;; (concat wl-summary-important-mark
+;;; wl-summary-read-uncached-mark))
(setq result nil)
(condition-case nil
(setq result (elmo-move-msgs wl-summary-buffer-folder-name
wl-folder-entity-hashtb))
nil nil (or init wl-default-spec)
'wl-read-folder-hist)))
- (setq fld (elmo-string (wl-folder-get-realname fld)))
- (if (string-match "\n" fld)
- (error "Not supported folder name: %s" fld))
(if (or (string= fld wl-default-spec)
(string= fld ""))
(setq fld default))
+ (setq fld (elmo-string (wl-folder-get-realname fld)))
+ (if (string-match "\n" fld)
+ (error "Not supported folder name: %s" fld))
(unless no-create
(if ignore-error
(ignore-errors (wl-folder-confirm-existence fld))
(while (< c len)
(forward-char -1)
(setq c (+ c (char-width (following-char)))))
+ (and (> c len) (setq folder (concat " " folder)))
(setq rs (point))
(put-text-property rs re 'invisible t)
(put-text-property rs re 'wl-summary-destination t)
(defun wl-summary-remove-destination ()))
(defsubst wl-summary-get-mark (number)
- "Returns a temporal mark of message specified by NUMBER."
+ "Return a temporal mark of message specified by NUMBER."
(or (and (memq number wl-summary-buffer-delete-list) "D")
(and (assq number wl-summary-buffer-copy-list) "O")
(and (assq number wl-summary-buffer-refile-list) "o")
- (and (assq number wl-summary-buffer-target-mark-list) "*")))
+ (and (memq number wl-summary-buffer-target-mark-list) "*")))
(defsubst wl-summary-reserve-temp-mark-p (mark)
- "Returns t if temporal MARK should be reserved."
+ "Return t if temporal MARK should be reserved."
(member mark wl-summary-reserve-mark-list))
(defun wl-summary-refile (&optional dst number)
(or (wl-refile-guess entity) wl-trash-folder)
(format "for %s" copy-or-refile)))))
;; Cache folder hack by okada@opaopa.org
- (if (and (eq (car (elmo-folder-get-spec folder)) 'cache)
+ (if (and (eq (car (elmo-folder-get-spec
+ (wl-folder-get-realname folder))) 'cache)
(not (string= folder
(setq tmp-folder
(concat "'cache/"
msg-num)))
(defun wl-summary-refile-prev-destination ()
- "Refile message to previously refiled destination"
+ "Refile message to previously refiled destination."
(interactive)
(wl-summary-refile wl-summary-buffer-prev-refile-destination
(wl-summary-message-number))
(wl-summary-next)))
(defun wl-summary-copy-prev-destination ()
- "Refile message to previously refiled destination"
+ "Refile message to previously refiled destination."
(interactive)
(wl-summary-copy wl-summary-buffer-prev-copy-destination
(wl-summary-message-number))
(member (cadr (assq msg mark-alist)) 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."
+ "Set refile mark automatically according to 'wl-refile-guess-by-rule'."
(interactive "P")
(message "Marking...")
(save-excursion
(when (and (not (wl-summary-no-auto-refile-message-p number
mark-alist))
(setq dst
- (wl-refile-guess-by-rule
- (elmo-msgdb-overview-get-entity
- number wl-summary-buffer-msgdb)))
+ (wl-folder-get-realname
+ (wl-refile-guess-by-rule
+ (elmo-msgdb-overview-get-entity
+ number wl-summary-buffer-msgdb))))
(not (equal dst spec)))
(when (not (member dst checked-dsts))
(wl-folder-confirm-existence dst)
(setq beg (point))
(end-of-line)
(wl-summary-goto-bottom-of-current-thread)
-; (forward-line -1)
+;;; (forward-line -1)
(beginning-of-line)
(setq end (point))
(wl-summary-target-mark-region beg end)))
(defun wl-summary-pick (&optional from-list delete-marks)
(interactive)
- (let ((result (elmo-msgdb-search
+ (let ((result (elmo-msgdb-search
wl-summary-buffer-folder-name
(elmo-read-search-condition wl-summary-pick-field-default)
wl-summary-buffer-msgdb)))
(error "This folder is not filtered")))
(defun wl-summary-virtual (&optional arg)
- "Goto virtual folder."
+ "Goto virtual folder.
+If ARG, exit virtual folder."
(interactive "P")
(if arg
(wl-summary-unvirtual)
(while (not (eobp))
(wl-summary-unmark)
(forward-line))
- (message "Unmarking...done.")
+ (message "Unmarking...done")
(setq wl-summary-buffer-target-mark-list nil)
(setq wl-summary-buffer-delete-list nil)
(setq wl-summary-buffer-refile-list nil)
(delq pair wl-summary-buffer-refile-list))))))))
(defun wl-summary-mark-line (mark)
- "Put MARK on current line. Returns message number."
+ "Put MARK on current line. Return message number."
(save-excursion
(beginning-of-line)
(let ((inhibit-read-only t)
(setq cur-mark (wl-match-buffer 2))
(goto-char (match-end 1))
(delete-region (match-beginning 2) (match-end 2))
- ;(wl-summary-delete-mark msg-num)
+;;; (wl-summary-delete-mark msg-num)
(insert mark)
(if wl-summary-highlight
(wl-highlight-summary-current-line nil nil t))
(setq mlist wl-summary-buffer-target-mark-list)
(while mlist
(wl-summary-mark-as-unread (car mlist))
- ;; (wl-thread-msg-mark-as-unread (car mlist))
+;;; (wl-thread-msg-mark-as-unread (car mlist))
(setq wl-summary-buffer-target-mark-list
(delq (car mlist) wl-summary-buffer-target-mark-list))
(setq mlist (cdr mlist)))
(folder wl-summary-buffer-folder-name)
(msgdb wl-summary-buffer-msgdb)
(mark-alist (elmo-msgdb-get-mark-alist msgdb))
- ;;(number-alist (elmo-msgdb-get-number-alist msgdb))
+;;; (number-alist (elmo-msgdb-get-number-alist msgdb))
(case-fold-search nil)
mark stat visible uncached new-mark marked)
(if number
(unless no-server-update
(elmo-unmark-important folder (list number) msgdb)
(elmo-msgdb-global-mark-delete message-id))
+ ;; Remove cache if local folder.
+ (if (elmo-folder-local-p folder)
+ (elmo-cache-delete message-id folder number))
(when visible
(delete-region (match-beginning 2) (match-end 2))
(insert " "))
(wl-match-string 1 wday-str)
(elmo-date-get-week year month mday))))
-(defmacro wl-summary-cursor-move-regex ()
- (` (let ((mark-alist
- (if (elmo-folder-plugged-p wl-summary-buffer-folder-name)
- (cond ((eq wl-summary-move-order 'new)
- (list
- (list
- wl-summary-new-mark)
- (list
- wl-summary-unread-uncached-mark
- wl-summary-unread-cached-mark
- wl-summary-important-mark)))
- ((eq wl-summary-move-order 'unread)
- (list
- (list
- wl-summary-unread-uncached-mark
- wl-summary-unread-cached-mark
- wl-summary-new-mark)
- (list
- wl-summary-important-mark)))
- (t
- (list
- (list
- wl-summary-unread-uncached-mark
- wl-summary-unread-cached-mark
- wl-summary-new-mark
- wl-summary-important-mark))))
- (cond ((eq wl-summary-move-order 'unread)
- (list
- (list
- wl-summary-unread-cached-mark)
- (list
- wl-summary-important-mark)))
- (t
- (list
- (list
- wl-summary-unread-cached-mark
- wl-summary-important-mark)))))))
- (mapcar
- (function
- (lambda (mark-list)
- (concat wl-summary-message-regexp
- ".\\("
- (mapconcat 'regexp-quote
- mark-list
- "\\|")
- "\\)\\|"
- wl-summary-message-regexp "\\*")))
- mark-alist))))
-
-;;
-;; Goto unread or important
-;;
-(defun wl-summary-cursor-up (&optional hereto)
- (interactive "P")
- (if (and (not wl-summary-buffer-target-mark-list)
- (eq wl-summary-buffer-view 'thread))
- (progn
- (if (eobp)
- (forward-line -1))
- (wl-thread-jump-to-prev-unread hereto))
- (if hereto
- (end-of-line)
- (beginning-of-line))
- (let ((case-fold-search nil)
- regex-list)
- (setq regex-list (wl-summary-cursor-move-regex))
- (catch 'done
- (while regex-list
- (when (re-search-backward
- (car regex-list)
- nil t nil)
- (beginning-of-line)
- (throw 'done t))
- (setq regex-list (cdr regex-list)))
- (beginning-of-line)
- (throw 'done nil)))))
-
+(defvar wl-summary-move-spec-plugged-alist
+ (list (cons 'new (list (cons 't nil)
+ (cons 'p wl-summary-new-mark)
+ (cons 'p (wl-regexp-opt
+ (list wl-summary-unread-uncached-mark
+ wl-summary-unread-cached-mark)))
+ (cons 'p (regexp-quote wl-summary-important-mark))))
+ (cons 'unread (list (cons 't nil)
+ (cons 'p (wl-regexp-opt
+ (list wl-summary-new-mark
+ wl-summary-unread-uncached-mark
+ wl-summary-unread-cached-mark)))
+ (cons 'p (regexp-quote
+ wl-summary-important-mark))))))
+
+(defvar wl-summary-move-spec-unplugged-alist
+ (list (cons 'new (list (cons 't nil)
+ (cons 'p wl-summary-unread-cached-mark)
+ (cons 'p (regexp-quote wl-summary-important-mark))))
+ (cons 'unread (list (cons 't nil)
+ (cons 'p wl-summary-unread-cached-mark)
+ (cons 'p (regexp-quote
+ wl-summary-important-mark))))))
+
+(defsubst wl-summary-next-message (num direction hereto)
+ (if wl-summary-buffer-next-message-func
+ (funcall wl-summary-buffer-next-message-func num direction hereto)
+ (let ((cur-spec (cdr (assq wl-summary-move-order
+ (if (elmo-folder-plugged-p
+ wl-summary-buffer-folder-name)
+ wl-summary-move-spec-plugged-alist
+ wl-summary-move-spec-unplugged-alist))))
+ (nums (memq num (if (eq direction 'up)
+ (reverse wl-summary-buffer-number-list)
+ wl-summary-buffer-number-list)))
+ marked-list nums2)
+ (unless hereto (setq nums (cdr nums)))
+ (setq nums2 nums)
+ (if cur-spec
+ (catch 'done
+ (while cur-spec
+ (setq nums nums2)
+ (cond ((eq (car (car cur-spec)) 'p)
+ (if (setq marked-list (elmo-msgdb-list-messages-mark-match
+ wl-summary-buffer-msgdb
+ (cdr (car cur-spec))))
+ (while nums
+ (if (memq (car nums) marked-list)
+ (throw 'done (car nums)))
+ (setq nums (cdr nums)))))
+ ((eq (car (car cur-spec)) 't)
+ (while nums
+ (if (and wl-summary-buffer-target-mark-list
+ (memq (car nums)
+ wl-summary-buffer-target-mark-list))
+ (throw 'done (car nums)))
+ (setq nums (cdr nums)))))
+ (setq cur-spec (cdr cur-spec))))
+ (car nums)))))
+
+(defsubst wl-summary-cursor-move (direction hereto)
+ (when (and (eq direction 'up)
+ (eobp))
+ (forward-line -1)
+ (setq hereto t))
+ (let (num)
+ (when (setq num (wl-summary-next-message (wl-summary-message-number)
+ direction hereto))
+ (if (numberp num)
+ (wl-thread-jump-to-msg num))
+ t)))
;;
;; Goto unread or important
;; returns t if next message exists in this folder.
(defun wl-summary-cursor-down (&optional hereto)
(interactive "P")
- (if (and (null wl-summary-buffer-target-mark-list)
- (eq wl-summary-buffer-view 'thread))
- (wl-thread-jump-to-next-unread hereto)
- (if hereto
- (beginning-of-line)
- (end-of-line))
- (let ((case-fold-search nil)
- regex-list)
- (setq regex-list (wl-summary-cursor-move-regex))
- (catch 'done
- (while regex-list
- (when (re-search-forward
- (car regex-list)
- nil t nil)
- (beginning-of-line)
- (throw 'done t))
- (setq regex-list (cdr regex-list)))
- (beginning-of-line)
- (throw 'done nil)))))
+ (wl-summary-cursor-move 'down hereto))
+
+(defun wl-summary-cursor-up (&optional hereto)
+ (interactive "P")
+ (wl-summary-cursor-move 'up hereto))
(defun wl-summary-save-view-cache ()
(save-excursion
(let* ((dir (elmo-msgdb-expand-path wl-summary-buffer-folder-name))
(cache (expand-file-name wl-summary-cache-file dir))
(view (expand-file-name wl-summary-view-file dir))
- ;;(coding-system-for-write wl-cs-cache)
- ;;(output-coding-system wl-cs-cache)
(save-view wl-summary-buffer-view)
(tmp-buffer (get-buffer-create " *wl-summary-save-view-cache*"))
(charset wl-summary-buffer-mime-charset))
(widen)
(encode-mime-charset-region
(point-min) (point-max) charset)
- (as-binary-output-file
- (write-region (point-min)
- (point-max) cache nil 'no-msg))
- (write-region (point-min) (point-max) cache nil
- 'no-msg)))
+ (write-region-as-binary (point-min)(point-max)
+ cache nil 'no-msg)))
(when (file-writable-p view) ; 'thread or 'sequence
(save-excursion
(set-buffer tmp-buffer)
"returns update or all or rescan."
;; for the case when parts are expanded in the bottom of the folder
(let ((input-range-list '("update" "all" "rescan" "first:" "last:"
- "no-sync" "rescan-noscore"))
+ "no-sync" "rescan-noscore" "all-visible"))
(default (or (wl-get-assoc-list-value
wl-folder-sync-range-alist
folder)
(run-hooks 'wl-summary-toggle-disp-folder-message-resumed-hook)
(select-window (get-buffer-window cur-buf)))
)
- (save-excursion
- ;; hide message window
- (let ((mes-win (get-buffer-window view-message-buffer))
- (wl-stay-folder-window t))
- (if mes-win (delete-window mes-win))
- (select-window (get-buffer-window cur-buf))
- ;; display wl-folder window!!
- (if (setq fld-buf (get-buffer wl-folder-buffer-name))
- (if (setq fld-win (get-buffer-window fld-buf))
- ;; folder win is already displayed.
- (select-window fld-win)
- ;; folder win is not displayed...occupy all.
- (switch-to-buffer fld-buf))
- ;; no folder buf
- (wl-folder))
- (split-window-horizontally wl-folder-window-width)
- (other-window 1)
- (switch-to-buffer cur-buf)
- ;; resume message window.
- (run-hooks 'wl-summary-toggle-disp-folder-on-hook)
- (when mes-win
- (wl-select-buffer view-message-buffer)
- (run-hooks 'wl-summary-toggle-disp-folder-message-resumed-hook)
- (select-window (get-buffer-window cur-buf))))
- )))))
+ ;; hide message window
+ (let ((mes-win (get-buffer-window view-message-buffer))
+ (wl-stay-folder-window t))
+ (if mes-win (delete-window mes-win))
+ (select-window (get-buffer-window cur-buf))
+ ;; display wl-folder window!!
+ (if (setq fld-buf (get-buffer wl-folder-buffer-name))
+ (if (setq fld-win (get-buffer-window fld-buf))
+ ;; folder win is already displayed.
+ (select-window fld-win)
+ ;; folder win is not displayed...occupy all.
+ (switch-to-buffer fld-buf))
+ ;; no folder buf
+ (wl-folder))
+ (split-window-horizontally wl-folder-window-width)
+ (other-window 1)
+ (switch-to-buffer cur-buf)
+ ;; resume message window.
+ (run-hooks 'wl-summary-toggle-disp-folder-on-hook)
+ (when mes-win
+ (wl-select-buffer view-message-buffer)
+ (run-hooks 'wl-summary-toggle-disp-folder-message-resumed-hook)
+ (select-window (get-buffer-window cur-buf))))
+ ))))
(run-hooks 'wl-summary-toggle-disp-folder-hook))
(defun wl-summary-toggle-disp-msg (&optional arg)
(if wl-summary-buffer-disp-msg
(progn
(wl-summary-redisplay)
- ;; hide your folder window
-;; (setq fld-buf (get-buffer wl-folder-buffer-name))
-;; (if (setq fld-win (get-buffer-window fld-buf))
-;; (delete-window fld-win)))
+;;; hide your folder window
+;;; (setq fld-buf (get-buffer wl-folder-buffer-name))
+;;; (if (setq fld-win (get-buffer-window fld-buf))
+;;; (delete-window fld-win)))
(run-hooks 'wl-summary-toggle-disp-on-hook))
(wl-delete-all-overlays)
(save-excursion
(delete-window)
(select-window (get-buffer-window cur-buf))
(run-hooks 'wl-summary-toggle-disp-off-hook))
- ;;(switch-to-buffer cur-buf)
+;;; (switch-to-buffer cur-buf)
)))))
(defun wl-summary-next-line-content ()
(errmsg
(format "No message with id \"%s\" in the folder." msgid)))
(if (setq msg (car (rassoc msgid number-alist)))
- ;;(wl-summary-jump-to-msg-internal
- ;;wl-summary-buffer-folder-name msg 'no-sync)
+;;; (wl-summary-jump-to-msg-internal
+;;; wl-summary-buffer-folder-name msg 'no-sync)
(progn
(wl-thread-jump-to-msg msg)
t)
nil)
((and msg-id (wl-summary-jump-to-msg-by-message-id msg-id))
(wl-summary-redisplay)
- (message "Searching parent message...done.")
+ (message "Searching parent message...done")
t)
((and msg-num (wl-summary-jump-to-msg msg-num))
(wl-summary-redisplay)
- (message "Searching parent message...done.")
+ (message "Searching parent message...done")
t)
(t ; failed.
(message "Parent message was not found.")
(defun wl-summary-reply (&optional arg without-setup-hook)
"Reply to current message. Default is \"wide\" reply.
-Reply to author if invoked with argument."
+Reply to author if invoked with ARG."
(interactive "P")
(let ((folder wl-summary-buffer-folder-name)
(number (wl-summary-message-number))
(split-window-vertically))
(other-window 1)
(when (setq mes-buf (wl-message-get-original-buffer))
- (wl-draft-reply mes-buf (not arg) summary-buf)
+ (wl-draft-reply mes-buf arg summary-buf)
(unless without-setup-hook
(run-hooks 'wl-mail-setup-hook)))
t)))))
(run-hooks 'wl-mail-setup-hook)
(mail-position-on-field "To"))
-(defun wl-summary-write-current-newsgroup (&optional folder)
+(defvar wl-summary-write-current-folder-functions
+ '(wl-folder-get-newsgroups
+ wl-folder-guess-mailing-list-by-refile-rule
+ wl-folder-guess-mailing-list-by-folder-name)
+ "Newsgroups or Mailing List address guess functions list.
+Call from `wl-summary-write-current-folder'")
+
+(defun wl-summary-write-current-folder (&optional folder)
+ "Write message to current FOLDER's newsgroup or mailing-list.
+Use function list is `wl-summary-write-current-folder-functions'."
(interactive)
- (let* ((folder (or folder wl-summary-buffer-folder-name))
- (flist (elmo-folder-get-primitive-folder-list folder))
- newsgroups fld ret)
- (while (setq fld (car flist))
- (if (setq ret
- (cond ((eq 'nntp (elmo-folder-get-type fld))
- (nth 1 (elmo-folder-get-spec fld)))
- ((eq 'localnews (elmo-folder-get-type fld))
- (elmo-replace-in-string
- (nth 1 (elmo-folder-get-spec fld)) "/" "\\."))))
- (setq newsgroups (cond (newsgroups
- (concat newsgroups "," ret))
- (t ret))))
- (setq flist (cdr flist)))
- (if newsgroups
- (progn
- (wl-draft nil nil nil nil nil newsgroups)
- (run-hooks 'wl-mail-setup-hook))
- (error "%s is not newsgroup" folder))))
+ (let (newsgroups to cc)
+ ;; default FOLDER is current buffer folder
+ (setq folder (or folder wl-summary-buffer-folder-name))
+ (let ((flist wl-summary-write-current-folder-functions)
+ guess-list)
+ (while flist
+ (setq guess-list (funcall (car flist) folder))
+ (if (or (nth 0 guess-list) ; To:
+;;; (nth 1 guess-list) ; Cc:
+ (nth 2 guess-list)) ; Newsgroups:
+ (setq flist nil)
+ (setq flist (cdr flist))))
+ (when (null guess-list)
+ (error "Can't guess by folder %s" folder))
+ (wl-draft (nth 0 guess-list) nil nil ; To:
+ (nth 1 guess-list) nil ; Cc:
+ (nth 2 guess-list)) ; Newsgroups:
+ (run-hooks 'wl-mail-setup-hook)
+ (mail-position-on-field "Subject"))))
(defun wl-summary-forward (&optional without-setup-hook)
+ ""
(interactive)
(let ((folder wl-summary-buffer-folder-name)
(number (wl-summary-message-number))
(wl-summary-read))
(defun wl-summary-read ()
+ ""
(interactive)
(let ((folder wl-summary-buffer-folder-name)
(number (wl-summary-message-number))
(progn
(if (wl-summary-next-page)
(wl-summary-down t)))
-; (wl-summary-scroll-up-content)))
+;;; (wl-summary-scroll-up-content)))
(if (wl-summary-no-mime-p folder)
(wl-summary-redisplay-no-mime folder number)
(wl-summary-redisplay-internal folder number)))))
(defun wl-summary-prev (&optional interactive)
+ ""
(interactive)
(if wl-summary-move-direction-toggle
(setq wl-summary-move-direction-downward nil))
(wl-summary-entity-info-msg next-entity finfo))))))))
(defun wl-summary-next (&optional interactive)
+ ""
(interactive)
(if wl-summary-move-direction-toggle
(setq wl-summary-move-direction-downward t))
(wl-summary-entity-info-msg next-entity finfo))))))))
(defun wl-summary-up (&optional interactive skip-no-unread)
+ ""
(interactive)
(if wl-summary-move-direction-toggle
(setq wl-summary-move-direction-downward nil))
(if (setq fld-win (get-buffer-window fld-buf))
(delete-window fld-win)))
(setq wl-current-summary-buffer (current-buffer))
- (if (wl-message-redisplay fld num 'mime msgdb force-reload)
+ (if (wl-message-redisplay fld num 'mime msgdb
+ (or force-reload
+ ;; if draft folder, force reload.
+ (string= fld wl-draft-folder)))
(wl-summary-mark-as-read nil
;; cached, then change server-mark.
(if wl-message-cache-used
(setq wl-summary-buffer-last-displayed-msg
wl-summary-buffer-current-msg)
(setq wl-current-summary-buffer (current-buffer))
- (wl-normal-message-redisplay fld num 'no-mime msgdb)
+ (wl-normal-message-redisplay fld num 'no-mime msgdb
+ ;; if draft folder, force reload.
+ (string= fld wl-draft-folder))
(wl-summary-mark-as-read nil nil t)
(setq wl-summary-buffer-current-msg num)
(when wl-summary-recenter
(setq wl-summary-buffer-last-displayed-msg
wl-summary-buffer-current-msg)
(setq wl-current-summary-buffer (current-buffer))
- (if (wl-message-redisplay fld num 'all-header msgdb); t if displayed.
+ (if (wl-message-redisplay fld num 'all-header msgdb
+ ;; if draft folder, force reload.
+ (string= fld wl-draft-folder))
(wl-summary-mark-as-read nil nil t))
(setq wl-summary-buffer-current-msg num)
(when wl-summary-recenter
(if (setq message-buf (wl-message-get-original-buffer))
(set-buffer message-buf))
(unless (wl-message-news-p)
- (error "This is not a news article; canceling is impossible"))
+ (set-buffer summary-buf)
+ (if (and (eq (elmo-folder-get-type wl-summary-buffer-folder-name)
+ 'nntp)
+ (y-or-n-p "Cannot get Newsgroups. Fetch again? "))
+ (progn
+ (wl-summary-redisplay t)
+ (wl-summary-supersedes-message))
+ (error "This is not a news article; supersedes is impossible")))
(when (yes-or-no-p "Do you really want to cancel this article? ")
(let (from newsgroups message-id distribution buf)
(save-excursion
(if (setq message-buf (wl-message-get-original-buffer))
(set-buffer message-buf))
(unless (wl-message-news-p)
- (error "This is not a news article; supersedes is impossible"))
+ (set-buffer summary-buf)
+ (if (and (eq (elmo-folder-get-type wl-summary-buffer-folder-name)
+ 'nntp)
+ (y-or-n-p "Cannot get Newsgroups. Fetch again? "))
+ (progn
+ (wl-summary-redisplay t)
+ (wl-summary-supersedes-message))
+ (error "This is not a news article; supersedes is impossible")))
(save-excursion
(setq from (std11-field-body "from"))
;; Make sure that this article was written by the user.
(wl-summary-set-message-buffer-or-redisplay)
(set-buffer (wl-message-get-original-buffer))
(if (and (null arg) (file-exists-p filename))
- (if (y-or-n-p "file already exists. override it?")
+ (if (y-or-n-p "File already exists. override it? ")
(write-region (point-min) (point-max) filename))
(write-region (point-min) (point-max) filename)))
(message "No message to save."))
(save-excursion
(wl-summary-set-message-buffer-or-redisplay)
(if (or (not (interactive-p))
- (y-or-n-p "Print ok?"))
+ (y-or-n-p "Print ok? "))
(progn
(let* ((message-buffer (get-buffer wl-message-buf-name))
- ;; (summary-buffer (get-buffer wl-summary-buffer-name))
+;;; (summary-buffer (get-buffer wl-summary-buffer-name))
(buffer (generate-new-buffer " *print*")))
(set-buffer message-buffer)
(copy-to-buffer buffer (point-min) (point-max))
(message "No message.")
(setq filename (ps-print-preprint current-prefix-arg))
(if (or (not (interactive-p))
- (y-or-n-p "Print ok?"))
+ (y-or-n-p "Print ok? "))
(let ((summary-buffer (current-buffer))
wl-break-pages)
(save-excursion
- ;;(wl-summary-set-message-buffer-or-redisplay)
+;;; (wl-summary-set-message-buffer-or-redisplay)
(wl-summary-redisplay-internal)
(let* ((message-buffer (get-buffer wl-message-buf-name))
(buffer (generate-new-buffer " *print*"))
orig-buf tmp-buf t
(= i k)))
nil
- (error "Can't find begin line.")))
+ (error "Can't find begin line")))
((< i k)
(wl-message-uu-substring orig-buf tmp-buf))
(t ; last
wl-prog-uudecode-arg))))
(when (not (= 0 rc))
(setq errmsg (buffer-substring (point-min)(point-max)))
- (error "uudecode error: %s" errmsg))
+ (error "Uudecode error: %s" errmsg))
(if (not wl-prog-uudecode-no-stdout-option)
(let (file-name-handler-alist) ;; void jka-compr
(as-binary-output-file
(if (elmo-folder-pipe-p wl-summary-buffer-folder-name)
(error "You cannot drop unsync messages in this folder"))
(if (or (not (interactive-p))
- (y-or-n-p "Drop all unsync messages?"))
+ (y-or-n-p "Drop all unsync messages? "))
(let* ((folder-list (elmo-folder-get-primitive-folder-list
wl-summary-buffer-folder-name))
(is-multi (elmo-multi-p wl-summary-buffer-folder-name))
(+ wl-summary-buffer-unread-count
wl-summary-buffer-new-count)
sum))
- (message "Dropping...done."))))
+ (message "Dropping...done"))))
(defun wl-summary-default-get-next-msg (msg)
- (let (next)
- (if (and (not wl-summary-buffer-target-mark-list)
- (eq wl-summary-buffer-view 'thread)
- (if (eq wl-summary-move-direction-downward nil)
- (setq next (wl-thread-get-prev-unread msg))
- (setq next (wl-thread-get-next-unread msg))))
- next
- (save-excursion
- (wl-summary-jump-to-msg msg)
- (let (wl-summary-buffer-disp-msg)
- (if (eq wl-summary-move-direction-downward nil)
- (unless (wl-summary-cursor-up)
- (wl-summary-prev))
- (unless (wl-summary-cursor-down)
- (wl-summary-next)))
- (wl-summary-message-number))))))
+ (or (wl-summary-next-message msg
+ (if wl-summary-move-direction-downward 'down
+ 'up)
+ nil)
+ (cadr (memq msg (if wl-summary-move-direction-downward
+ wl-summary-buffer-number-list
+ (reverse wl-summary-buffer-number-list))))))
(defsubst wl-cache-prefetch-p (fld &optional num)
(cond ((and num wl-cache-prefetch-folder-type-list)
(defun wl-cache-prefetch-next (fld msg &optional summary)
(if (wl-cache-prefetch-p fld)
- (if (not elmo-use-buffer-cache)
- ;; (message "`elmo-use-buffer-cache' is nil, cache prefetch is disable.")
+ (if elmo-use-buffer-cache
+;;; (message "`elmo-use-buffer-cache' is nil, cache prefetch is disable.")
(save-excursion
(set-buffer (or summary (get-buffer wl-summary-buffer-name)))
(let ((next (funcall wl-cache-prefetch-get-next-func msg)))
folder next)))))
(if wl-cache-prefetch-debug
(message "Reading %d..." msg))
- (elmo-buffer-cache-message folder next msgdb)
+ (elmo-buffer-cache-message folder next msgdb nil 'unread)
(if wl-cache-prefetch-debug
(message "Reading %d... done" msg))))))))))