2003-08-22 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+ * elmo.el (elmo-message-cached-p): New method.
+ (elmo-message-accessible-p): Use it instead of msgdb API directly.
+ (elmo-message-flags): New method.
+ (elmo-message-flagged-p): New function.
+
* elmo-version.el (elmo-version): Up to 2.11.9.
2003-08-20 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
folder
(elmo-folder-expand-msgdb-path folder))))
+(luna-define-generic elmo-message-cached-p (folder number)
+ "Return non-nil if the message is cached.")
+
+(luna-define-method elmo-message-cached-p ((folder elmo-folder) number)
+ (elmo-msgdb-get-cached (elmo-folder-msgdb folder) number))
+
(defun elmo-message-accessible-p (folder number)
"Get accessibility of the message.
Return non-nil when message is accessible."
(or (elmo-folder-plugged-p folder)
(elmo-folder-local-p folder)
- (elmo-msgdb-get-cached (elmo-folder-msgdb folder) number)))
+ (elmo-message-cached-p folder number)))
(luna-define-generic elmo-message-set-cached (folder number cached)
"Set cache status of the message in the msgdb.
(incf answered))))
(list new unreads answered)))
+(luna-define-generic elmo-message-flags (folder number)
+ "Return a list of flags.
+FOLDER is a ELMO folder structure.
+NUMBER is a number of the message.")
+
+(luna-define-method elmo-message-flags ((folder elmo-folder) number)
+ ;; This is a provisional implement.
+ (let ((mark (elmo-message-mark folder number)))
+ (append
+ (and (string= mark elmo-msgdb-new-mark)
+ '(new))
+ (and (string= mark elmo-msgdb-important-mark)
+ '(important))
+ (and (member mark (elmo-msgdb-unread-marks))
+ '(unread))
+ (and (member mark (elmo-msgdb-answered-marks))
+ '(answered)))))
+
+(defsubst elmo-message-flagged-p (folder number flag)
+ "Return non-nil if the message is set FLAG.
+FOLDER is a ELMO folder structure.
+NUMBER is a message number to test."
+ (let ((cur-flags (elmo-message-flags folder number)))
+ (case flag
+ (read
+ (not (memq 'unread cur-flags)))
+ (t
+ (memq flag cur-flags)))))
+
(defun elmo-message-set-flag (folder number flag)
"Set message flag.
FOLDER is a ELMO folder structure.
2003-08-22 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+ * wl-vars.el (wl-summary-new-mark, wl-summary-important-mark,
+ wl-summary-unread-uncached-mark, wl-summary-unread-cached-mark,
+ wl-summary-read-uncached-mark): Revive.
+ (wl-summary-answered-cached-mark,
+ wl-summary-answered-uncached-mark): New user option.
+ (wl-summary-score-marks): Follow the change above.
+ (wl-summary-auto-refile-skip-marks): Ditto.
+ (wl-summary-incorporate-marks): Ditto.
+ (wl-summary-expire-reserve-marks): Ditto.
+ (wl-summary-flag-priority-list): New user option.
+
+ * wl-summary.el (wl-summary-sync-marks): Follow the variable name
+ changes.
+ (wl-summary-auto-select-msg-p): Use elmo-message-flagged-p instead
+ of elmo-message-mark.
+ (wl-summary-mark-as-read-internal): Ditto.
+ (wl-summary-mark-as-answered): Ditto.
+ (wl-summary-mark-as-important): Ditto.
+ (wl-summary-redisplay-internal): Ditto.
+ (wl-summary-redisplay-no-mime-internal): Ditto.
+ (wl-summary-message-mark): New function.
+ (wl-summary-insert-sequential): Use wl-summary-message-mark
+ instead of elmo-message-mark.
+ (wl-summary-update-thread): Ditto.
+ (wl-summary-persistent-mark): Ditto.
+ (wl-summary-cursor-move-surface): Use elmo-message-accessible-p
+ instead of elmo-message-mark.
+
+ * wl-thread.el (wl-thread-update-line-on-buffer-sub): Use
+ wl-summary-message-mark instead of elmo-message-mark.
+ (wl-thread-insert-entity-sub): Ditto.
+ (wl-thread-get-children-msgs-uncached): Ditto.
+
+ * wl-highlight.el (wl-highlight-summary-line-string): Follow the
+ variable name changes.
+ (wl-highlight-summary-current-line): Ditto.
+
+ * wl-action.el (wl-summary-no-auto-refile-message-p): Use
+ wl-summary-message-mark instead of elmo-message-mark.
+
+ * wl-expire.el (wl-expire-message-p): Ditto.
+
+ * wl-score.el (wl-score-headers): Ditto.
+
* Version number is increased to 2.11.9.
* wl-summary.el (wl-summary-buffer-msgdb): Abolish.
(wl-summary-next)))
(defsubst wl-summary-no-auto-refile-message-p (number)
- (member (elmo-message-mark wl-summary-buffer-elmo-folder number)
+ (member (wl-summary-message-mark wl-summary-buffer-elmo-folder number)
wl-summary-auto-refile-skip-marks))
(defun wl-summary-auto-refile (&optional open-all)
(defsubst wl-expire-message-p (folder number)
"Return non-nil when a message in the FOLDER with NUMBER can be expired."
(cond ((consp wl-summary-expire-reserve-marks)
- (let ((mark (elmo-message-mark folder number)))
+ (let ((mark (wl-summary-message-mark folder number)))
(not (or (member mark wl-summary-expire-reserve-marks)
(and wl-summary-buffer-disp-msg
(eq number wl-summary-buffer-current-msg))))))
((eq wl-summary-expire-reserve-marks 'all)
- (not (or (elmo-message-mark folder number)
+ (not (or (wl-summary-message-mark folder number)
(and wl-summary-buffer-disp-msg
(eq number wl-summary-buffer-current-msg)))))
((eq wl-summary-expire-reserve-marks 'none)
(defun wl-highlight-summary-line-string (line mark temp-mark indent)
(let (fsymbol action)
(cond ((and (string= temp-mark wl-summary-score-over-mark)
- (member mark (list elmo-msgdb-unread-cached-mark
- elmo-msgdb-unread-uncached-mark
- elmo-msgdb-new-mark)))
+ (member mark (list wl-summary-unread-cached-mark
+ wl-summary-unread-uncached-mark
+ wl-summary-new-mark)))
(setq fsymbol 'wl-highlight-summary-high-unread-face))
((and (string= temp-mark wl-summary-score-below-mark)
- (member mark (list elmo-msgdb-unread-cached-mark
- elmo-msgdb-unread-uncached-mark
- elmo-msgdb-new-mark)))
+ (member mark (list wl-summary-unread-cached-mark
+ wl-summary-unread-uncached-mark
+ wl-summary-new-mark)))
(setq fsymbol 'wl-highlight-summary-low-unread-face))
((setq action (assoc temp-mark wl-summary-mark-action-list))
(setq fsymbol (nth 5 action)))
- ((string= mark elmo-msgdb-new-mark)
+ ((string= mark wl-summary-new-mark)
(setq fsymbol 'wl-highlight-summary-new-face))
- ((member mark (list elmo-msgdb-unread-cached-mark
- elmo-msgdb-unread-uncached-mark))
+ ((member mark (list wl-summary-unread-cached-mark
+ wl-summary-unread-uncached-mark))
(setq fsymbol 'wl-highlight-summary-unread-face))
- ((member mark (list elmo-msgdb-answered-cached-mark
- elmo-msgdb-answered-uncached-mark))
+ ((member mark (list wl-summary-answered-cached-mark
+ wl-summary-answered-uncached-mark))
(setq fsymbol 'wl-highlight-summary-answered-face))
- ((or (string= mark elmo-msgdb-important-mark))
+ ((or (string= mark wl-summary-important-mark))
(setq fsymbol 'wl-highlight-summary-important-face))
((string= temp-mark wl-summary-score-below-mark)
(setq fsymbol 'wl-highlight-summary-low-read-face))
(if (not fsymbol)
(cond
((and (string= temp-mark wl-summary-score-over-mark)
- (member status-mark (list elmo-msgdb-unread-cached-mark
- elmo-msgdb-unread-uncached-mark
- elmo-msgdb-new-mark)))
+ (member status-mark (list wl-summary-unread-cached-mark
+ wl-summary-unread-uncached-mark
+ wl-summary-new-mark)))
(setq fsymbol 'wl-highlight-summary-high-unread-face))
((and (string= temp-mark wl-summary-score-below-mark)
- (member status-mark (list elmo-msgdb-unread-cached-mark
- elmo-msgdb-unread-uncached-mark
- elmo-msgdb-new-mark)))
+ (member status-mark (list wl-summary-unread-cached-mark
+ wl-summary-unread-uncached-mark
+ wl-summary-new-mark)))
(setq fsymbol 'wl-highlight-summary-low-unread-face))
- ((string= status-mark elmo-msgdb-new-mark)
+ ((string= status-mark wl-summary-new-mark)
(setq fsymbol 'wl-highlight-summary-new-face))
- ((member status-mark (list elmo-msgdb-unread-cached-mark
- elmo-msgdb-unread-uncached-mark))
+ ((member status-mark (list wl-summary-unread-cached-mark
+ wl-summary-unread-uncached-mark))
(setq fsymbol 'wl-highlight-summary-unread-face))
- ((member status-mark (list elmo-msgdb-answered-cached-mark
- elmo-msgdb-answered-uncached-mark))
+ ((member status-mark (list wl-summary-answered-cached-mark
+ wl-summary-answered-uncached-mark))
(setq fsymbol 'wl-highlight-summary-answered-face))
- ((string= status-mark elmo-msgdb-important-mark)
+ ((string= status-mark wl-summary-important-mark)
(setq fsymbol 'wl-highlight-summary-important-face))
;; score mark
((string= temp-mark wl-summary-score-below-mark)
(setq num (elmo-message-entity-number entity))
(when (and (not (assq num wl-summary-scored))
(or (memq num force-msgs)
- (member (elmo-message-mark folder num)
+ (member (wl-summary-message-mark folder num)
wl-summary-score-marks)))
(setq wl-scores-messages
(cons (cons entity (or wl-summary-default-score 0))
(setq mes (format "Updated (-%d" (length diffs)))
(while diffs
(wl-summary-mark-as-important (car diffs)
- elmo-msgdb-important-mark
+ wl-summary-important-mark
'no-server)
(setq diffs (cdr diffs)))
(setq diffs (car diff)) ; important-appends
(defun wl-summary-auto-select-msg-p (unread-msg)
(and unread-msg
- (not (string=
- (elmo-message-mark
- wl-summary-buffer-elmo-folder
- unread-msg)
- elmo-msgdb-important-mark))))
+ (not (elmo-message-flagged-p wl-summary-buffer-elmo-folder
+ unread-msg
+ 'important))))
(defsubst wl-summary-open-folder (folder)
;; Select folder
(goto-char (point-max))
(wl-summary-insert-line
(wl-summary-create-line entity nil nil
- (elmo-message-mark
+ (wl-summary-message-mark
folder
(elmo-message-entity-number
entity))))
entity
parent-entity
nil
- (elmo-message-mark wl-summary-buffer-elmo-folder number)
+ (wl-summary-message-mark wl-summary-buffer-elmo-folder number)
(wl-thread-maybe-get-children-num number)
(wl-thread-make-indent-string thr-entity)
(wl-thread-entity-get-linked thr-entity)))))))
(wl-summary-get-score-mark number)
" ")))
+(defsubst wl-summary-message-mark (folder number)
+ "Return mark of the message."
+ (ignore-errors
+ (let ((priorities wl-summary-flag-priority-list)
+ (cachedp (elmo-message-cached-p folder number))
+ (flags (elmo-message-flags folder number))
+ mark)
+ (while (and (null mark) priorities)
+ (when (memq (car priorities) flags)
+ (setq mark
+ (case (car priorities)
+ (new
+ wl-summary-new-mark)
+ (important
+ wl-summary-important-mark)
+ (answered
+ (if cachedp
+ wl-summary-answered-cached-mark
+ wl-summary-answered-uncached-mark))
+ (unread
+ (if cachedp
+ wl-summary-unread-cached-mark
+ wl-summary-unread-uncached-mark)))))
+ (setq priorities (cdr priorities)))
+ (or mark
+ (if (or cachedp (elmo-folder-local-p folder))
+ nil
+ wl-summary-read-uncached-mark)))))
+
(defsubst wl-summary-persistent-mark ()
"Return persistent-mark string of current line."
- (or (ignore-errors
- (elmo-message-mark wl-summary-buffer-elmo-folder
- (wl-summary-message-number)))
+ (or (wl-summary-message-mark wl-summary-buffer-elmo-folder
+ (wl-summary-message-number))
" "))
(defun wl-summary-put-temp-mark (mark)
number-list visible)
(setq number-list (cond ((numberp number-or-numbers)
(setq unread-message
- (member (elmo-message-mark
- folder
- number-or-numbers)
- (elmo-msgdb-unread-marks)))
+ (elmo-message-flagged-p
+ folder
+ number-or-numbers
+ 'unread))
(list number-or-numbers))
((and (not (null number-or-numbers))
(listp number-or-numbers))
((setq number (wl-summary-message-number))
;; interactive
(setq unread-message
- (member (elmo-message-mark folder number)
- (elmo-msgdb-unread-marks)))
+ (elmo-message-flagged-p
+ folder
+ number
+ 'unread))
(list number))))
(if (null number-list)
(message "No message.")
(interactive)
(wl-summary-mark-as-answered-internal
(and (interactive-p)
- (member (elmo-message-mark wl-summary-buffer-elmo-folder
- (wl-summary-message-number))
- (elmo-msgdb-answered-marks)))
+ (elmo-message-flagged-p wl-summary-buffer-elmo-folder
+ (wl-summary-message-number)
+ 'answered))
number-or-numbers
no-modeline-update))
(cond (number
(setq visible (wl-summary-jump-to-msg number))
(setq cur-mark (or mark
- (elmo-message-mark
+ (wl-summary-message-mark
wl-summary-buffer-elmo-folder number)
" ")))
((setq number (wl-summary-message-number))
wl-summary-buffer-elmo-folder
number
'message-id))
- (if (string= cur-mark elmo-msgdb-important-mark)
+ (if (string= cur-mark wl-summary-important-mark)
(progn
;; server side mark
(save-match-data
(skip-tmark-regexp (wl-regexp-opt wl-summary-skip-mark-list))
(skip t)
(column (current-column))
- skip-pmark-regexp goto-next next-entity finfo)
- (if (elmo-folder-plugged-p wl-summary-buffer-elmo-folder)
- ()
- (setq skip-pmark-regexp
- (wl-regexp-opt (list " "
- elmo-msgdb-unread-cached-mark
- elmo-msgdb-answered-cached-mark
- elmo-msgdb-important-mark))))
+ goto-next next-entity finfo)
(beginning-of-line)
(while (and skip
(not (if downward (eobp) (bobp))))
(forward-line 1)
(forward-line -1))
(setq skip (or (string-match skip-tmark-regexp
- (save-excursion
- (wl-summary-temp-mark)))
- (and skip-pmark-regexp
- (not (string-match
- skip-pmark-regexp
- (save-excursion
- (wl-summary-persistent-mark))))))))
+ (wl-summary-temp-mark))
+ (not (elmo-message-accessible-p
+ wl-summary-buffer-elmo-folder
+ (wl-summary-message-number))))))
(if (if downward (eobp) (and (bobp) skip)) (setq goto-next t))
(if (or (eobp) (and (bobp) skip))
(goto-char start))
(when (elmo-message-use-cache-p folder num)
(elmo-message-set-cached folder num t))
(ignore-errors
- (if (member (elmo-message-mark wl-summary-buffer-elmo-folder
- num)
- (elmo-msgdb-unread-marks))
+ (if (elmo-message-flagged-p wl-summary-buffer-elmo-folder
+ num
+ 'unread)
(wl-summary-mark-as-read num no-folder-mark)
(wl-summary-update-persistent-mark)))
(setq wl-summary-buffer-current-msg num)
(string= (elmo-folder-name-internal fld)
wl-draft-folder))
(ignore-errors
- (if (member (elmo-message-mark fld num)
- (elmo-msgdb-unread-marks))
+ (if (elmo-message-flagged-p fld num 'unread)
(wl-summary-mark-as-read num); no-folder-mark)
(wl-summary-update-persistent-mark)))
(setq wl-summary-buffer-current-msg num)
(elmo-message-entity wl-summary-buffer-elmo-folder
parent-msg)
temp-mark
- (elmo-message-mark wl-summary-buffer-elmo-folder msg)
+ (wl-summary-message-mark wl-summary-buffer-elmo-folder msg)
(if wl-thread-insert-force-opened
nil
(wl-thread-maybe-get-children-num msg))
(elmo-message-entity wl-summary-buffer-elmo-folder
(nth 0 parent-entity))
temp-mark
- (elmo-message-mark wl-summary-buffer-elmo-folder msg-num)
+ (wl-summary-message-mark wl-summary-buffer-elmo-folder msg-num)
(if wl-thread-insert-force-opened
nil
(wl-thread-maybe-get-children-num msg-num))
(while children-msgs
(if (and (not (eq msg (car children-msgs))) ; except itself
(or (and uncached-marks
- (setq mark (elmo-message-mark
+ (setq mark (wl-summary-message-mark
wl-summary-buffer-elmo-folder
(car children-msgs)))
(member mark uncached-marks))
:type 'boolean
:group 'wl-folder)
+(defcustom wl-summary-flag-priority-list '(new important answered unread)
+ "List of flags reflected with the priority to a persistent mark."
+ :type '(repeat (radio (const :format "%v " new)
+ (const :format "%v " important)
+ (const :format "%v " answered)
+ (const :format "%v " unread)))
+ :group 'wl-summary)
+
+(defcustom wl-summary-new-mark "N"
+ "Mark for new message."
+ :type '(string :tag "Mark")
+ :group 'wl-summary-marks)
+
+(defcustom wl-summary-unread-uncached-mark "U"
+ "Mark for unread and uncached message."
+ :type '(string :tag "Mark")
+ :group 'wl-summary-marks)
+
+(defcustom wl-summary-unread-cached-mark "!"
+ "Mark for unread but already cached message."
+ :type '(string :tag "Mark")
+ :group 'wl-summary-marks)
+
+(defcustom wl-summary-read-uncached-mark "u"
+ "Mark for read but uncached message."
+ :type '(string :tag "Mark")
+ :group 'wl-summary-marks)
+
+(defcustom wl-summary-answered-cached-mark "&"
+ "Mark for answered and cached message."
+ :type '(string :tag "Mark")
+ :group 'wl-summary-marks)
+
+(defcustom wl-summary-answered-uncached-mark "A"
+ "Mark for answered but cached message."
+ :type '(string :tag "Mark")
+ :group 'wl-summary-marks)
+
+(defcustom wl-summary-important-mark "$"
+ "Mark for important message."
+ :type '(string :tag "Mark")
+ :group 'wl-summary-marks)
+
(defcustom wl-summary-score-over-mark "+"
"Score mark used for messages with high scores."
:type '(string :tag "Mark")
:group 'wl-score)
(defcustom wl-summary-score-marks
- (list elmo-msgdb-new-mark)
+ (list wl-summary-new-mark)
"Persistent marks to scoring."
:type '(repeat (string :tag "Mark"))
:group 'wl-score)
:group 'wl-pref)
(defcustom wl-summary-auto-refile-skip-marks
- (list elmo-msgdb-new-mark
- elmo-msgdb-unread-uncached-mark
- elmo-msgdb-unread-cached-mark)
+ (list wl-summary-new-mark
+ wl-summary-unread-uncached-mark
+ wl-summary-unread-cached-mark)
"Persistent marks to skip auto-refiling."
:type '(repeat (string :tag "Mark"))
:group 'wl-summary)
:group 'wl-summary)
(defcustom wl-summary-incorporate-marks
- (list elmo-msgdb-new-mark
- elmo-msgdb-unread-uncached-mark)
+ (list wl-summary-new-mark
+ wl-summary-unread-uncached-mark)
"Persistent marks to prefetch at `wl-summary-incorporate'."
:type '(repeat (string :tag "Mark"))
:group 'wl-summary)
:group 'wl-expire)
(defcustom wl-summary-expire-reserve-marks
- (list elmo-msgdb-important-mark
- elmo-msgdb-new-mark
- elmo-msgdb-unread-uncached-mark
- elmo-msgdb-unread-cached-mark)
+ (list wl-summary-important-mark
+ wl-summary-new-mark
+ wl-summary-unread-uncached-mark
+ wl-summary-unread-cached-mark)
"Permanent marks of reserved message when expire.
Don't reserve temporary mark message.