(elmo-pop3-msgdb-create-by-header): Ditto.
(elmo-pop3-msgdb-create-message): Ditto.
* elmo-shimbun.el (elmo-folder-msgdb-create): Ditto.
* elmo-sendlog.el (elmo-folder-msgdb-create): Ditto.
* elmo-nmz.el (elmo-folder-msgdb-create): Ditto.
* elmo-nntp.el (elmo-nntp-create-msgdb-from-overview-string): Ditto.
(elmo-folder-msgdb-create): Ditto.
(elmo-nntp-folder-msgdb-create): Ditto.
(elmo-nntp-msgdb-create-by-header): Ditto.
(elmo-nntp-msgdb-create-message): Ditto.
(elmo-folder-list-unreads): Define.
* elmo-pipe.el (elmo-folder-msgdb-create): Ditto.
(elmo-folder-append-messages): Ditto.
(elmo-folder-list-unreads): Define.
(elmo-folder-list-importants): Ditto.
(elmo-folder-list-answereds): Ditto.
* elmo-net.el (elmo-folder-list-unreads): Define.
(elmo-folder-list-importants): Ditto.
(elmo-folder-list-answereds): Ditto.
(elmo-folder-list-answereds-plugged): Ditto.
(elmo-folder-msgdb-create): Follow the API change.
(elmo-folder-msgdb-create-unplugged): Ditto.
(elmo-folder-unmark-answered): Define.
(elmo-folder-mark-as-answered-unplugged): Ditto.
(elmo-folder-unmark-answered-unplugged): Ditto.
* elmo-msgdb.el (elmo-msgdb-new-mark): New user option.
(elmo-msgdb-unread-uncached-mark): Ditto.
(elmo-msgdb-unread-cached-mark): Ditto.
(elmo-msgdb-read-uncached-mark): Ditto.
(elmo-msgdb-answered-cached-mark): Ditto.
(elmo-msgdb-answered-uncached-mark): Ditto.
(elmo-msgdb-important-mark): Ditto.
(elmo-msgdb-set-mark): Rewrite.
(elmo-msgdb-count-marks): Rewrite.
(elmo-msgdb-mark-alist-set): Abolish.
(elmo-msgdb-seen-list): Removed argument `seen-marks'.
(elmo-msgdb-add-msgs-to-seen-list): Likewise.
* elmo-multi.el (elmo-folder-check): Call elmo-folder-synchronize.
(elmo-folder-close): Define.
(elmo-folder-msgdb-create): Follow the API change.
(elmo-folder-list-unreads): Rewrite.
(elmo-folder-mark-as-important): Ditto.
(elmo-folder-unmark-important): Ditto.
(elmo-folder-mark-as-read): Ditto.
(elmo-folder-unmark-read): Ditto.
(elmo-folder-mark-as-answered): Define.
(elmo-folder-unmark-answered): Ditto.
* elmo-localdir.el (elmo-folder-msgdb-create): Follow the API change.
(elmo-folder-append-messages): Ditto.
* elmo-mark.el (elmo-folder-msgdb-create): Ditto.
* elmo-map.el (elmo-folder-list-unreads): Ditto.
(elmo-folder-list-importants): Ditto.
* elmo-maildir.el (elmo-folder-msgdb-create): Ditto.
(elmo-folder-append-messages): Ditto.
(luna-define-method elmo-folder-msgdb-create ((folder elmo-localdir-folder)
numbers
- new-mark
- already-mark
- seen-mark
- important-mark
seen-list)
(when numbers
(let ((dir (elmo-localdir-folder-directory-internal folder))
(if (elmo-file-cache-exists-p message-id) ; XXX
(if seen
nil
- already-mark)
+ elmo-msgdb-unread-cached-mark)
(if seen
nil ;;seen-mark
- new-mark))))
+ elmo-msgdb-new-mark))))
(setq mark-alist
(elmo-msgdb-mark-append
mark-alist
(luna-define-method elmo-folder-append-messages :around
((folder elmo-localdir-folder)
- src-folder numbers unread-marks &optional same-number)
+ src-folder numbers &optional same-number)
(if (elmo-folder-message-file-p src-folder)
(let ((dir (elmo-localdir-folder-directory-internal folder))
(succeeds numbers)
(elmo-maildir-folder-flagged-locations-internal folder))
(luna-define-method elmo-folder-msgdb-create
- ((folder elmo-maildir-folder)
- numbers new-mark already-mark seen-mark important-mark seen-list)
+ ((folder elmo-maildir-folder) numbers seen-list)
(let* ((unread-list (elmo-maildir-folder-unread-locations-internal folder))
(flagged-list (elmo-maildir-folder-flagged-locations-internal folder))
(len (length numbers))
entity)))
(cond
((member location unread-list)
- (setq mark new-mark)) ; unread!
+ (setq mark elmo-msgdb-new-mark)) ; unread!
((member location flagged-list)
- (setq mark important-mark)))
+ (setq mark elmo-msgdb-important-mark)))
(if (setq mark (or (elmo-msgdb-global-mark-get
(elmo-msgdb-overview-entity-get-id
entity))
(luna-define-method elmo-folder-append-messages :around
((folder elmo-maildir-folder)
- src-folder numbers unread-marks &optional same-number)
+ src-folder numbers &optional same-number)
(if (elmo-folder-message-file-p src-folder)
(let ((dir (elmo-maildir-folder-directory-internal folder))
(succeeds numbers)
(elmo-map-message-location folder number)
strategy section unread))
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-map-folder) unread-marks &optional mark-alist)
- (elmo-map-folder-locations-to-numbers
- folder
- (elmo-map-folder-list-unreads folder)))
+(luna-define-method elmo-folder-list-unreads ((folder elmo-map-folder))
+ (let ((locations (elmo-map-folder-list-unreads folder)))
+ (if (listp locations)
+ (elmo-map-folder-locations-to-numbers
+ folder
+ (elmo-map-folder-list-unreads folder)))))
-(luna-define-method elmo-folder-list-importants-internal
- ((folder elmo-map-folder) important-mark)
+(luna-define-method elmo-folder-list-importants ((folder elmo-map-folder))
(let ((locations (elmo-map-folder-list-importants folder)))
(if (listp locations)
- (elmo-map-folder-locations-to-numbers folder locations)
- t)))
+ (elmo-uniq-list
+ (nconc (elmo-map-folder-locations-to-numbers folder locations)
+ (elmo-folder-list-messages-with-global-mark
+ folder elmo-msgdb-important-mark)))
+ (luna-call-next-method))))
(luna-define-method elmo-folder-delete-messages ((folder elmo-map-folder)
numbers)
folder))
(elmo-map-folder-location-alist-internal folder))))
t) ; success
-
(require 'product)
(product-provide (provide 'elmo-map) (require 'elmo-version))
(elmo-map-message-location folder number)))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-mark-folder)
- numbers new-mark
- already-mark seen-mark
- important-mark
- seen-list)
- (elmo-mark-folder-msgdb-create folder numbers new-mark already-mark
- seen-mark important-mark))
-
-(defun elmo-mark-folder-msgdb-create (folder numbers new-mark already-mark
- seen-mark important-mark)
+ numbers seen-list)
+ (elmo-mark-folder-msgdb-create folder numbers))
+
+(defun elmo-mark-folder-msgdb-create (folder numbers)
(let ((i 0)
(len (length numbers))
overview number-alist mark-alist entity message-id
t)
;;; To override elmo-map-folder methods.
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-mark-folder) unread-marks &optional mark-alist)
- t)
-
(luna-define-method elmo-folder-unmark-important ((folder elmo-mark-folder)
numbers)
t)
(require 'std11)
(require 'mime)
+(defcustom elmo-msgdb-new-mark "N"
+ "Mark for new message."
+ :type '(string :tag "Mark")
+ :group 'elmo)
+
+(defcustom elmo-msgdb-unread-uncached-mark "U"
+ "Mark for unread and uncached message."
+ :type '(string :tag "Mark")
+ :group 'elmo)
+
+(defcustom elmo-msgdb-unread-cached-mark "!"
+ "Mark for unread but already cached message."
+ :type '(string :tag "Mark")
+ :group 'elmo)
+
+(defcustom elmo-msgdb-read-uncached-mark "u"
+ "Mark for read but uncached message."
+ :type '(string :tag "Mark")
+ :group 'elmo)
+
+;; Not implemented yet.
+(defcustom elmo-msgdb-answered-cached-mark "&"
+ "Mark for answered and cached message."
+ :type '(string :tag "Mark")
+ :group 'elmo)
+
+(defcustom elmo-msgdb-answered-uncached-mark "A"
+ "Mark for answered but cached message."
+ :type '(string :tag "Mark")
+ :group 'elmo)
+
+(defcustom elmo-msgdb-important-mark"$"
+ "Mark for important message."
+ :type '(string :tag "Mark")
+ :group 'elmo)
+
;;; MSGDB interface.
(defun elmo-load-msgdb (path)
"Load the MSGDB from PATH."
(defsubst elmo-msgdb-set-mark (msgdb number mark)
"Set MARK of the message with NUMBER in the MSGDB.
if MARK is nil, mark is removed."
- (elmo-msgdb-set-mark-alist
- msgdb
- (elmo-msgdb-mark-alist-set (elmo-msgdb-get-mark-alist msgdb)
- number
- mark msgdb))
- (unless mark
- (elmo-clear-hash-val (format "#%d" number)
- (elmo-msgdb-get-mark-hashtb msgdb))))
-
-(defsubst elmo-msgdb-count-marks (msgdb new-mark unread-marks)
+ (let ((elem (elmo-get-hash-val (format "#%d" number)
+ (elmo-msgdb-get-mark-hashtb msgdb))))
+ (if elem
+ (if mark
+ ;; Set mark of the elem
+ (setcar (cdr elem) mark)
+ ;; Delete elem from mark-alist
+ (elmo-msgdb-set-mark-alist
+ msgdb
+ (delq elem (elmo-msgdb-get-mark-alist msgdb)))
+ (elmo-clear-hash-val (format "#%d" number)
+ (elmo-msgdb-get-mark-hashtb msgdb)))
+ (when mark
+ ;; Append new element.
+ (elmo-msgdb-set-mark-alist
+ msgdb
+ (nconc
+ (elmo-msgdb-get-mark-alist msgdb)
+ (list (setq elem (list number mark)))))
+ (elmo-set-hash-val (format "#%d" number) elem
+ (elmo-msgdb-get-mark-hashtb msgdb))))))
+
+(defun elmo-msgdb-set-cached (msgdb number cached)
+ "Set message cache status."
+ (let* ((cur-mark (elmo-msgdb-get-mark msgdb number))
+ (cur-status (cond
+ ((string= cur-mark elmo-msgdb-important-mark)
+ 'important)
+ ((member cur-mark (elmo-msgdb-answered-marks))
+ 'answered)
+ ((not (member cur-mark (elmo-msgdb-unread-marks)))
+ 'read)))
+ (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks)))))
+ (unless (eq (not cached) (not cur-cached))
+ (case cur-status
+ (read
+ (elmo-msgdb-set-mark msgdb number
+ (unless cached
+ elmo-msgdb-read-uncached-mark)))
+ (important nil)
+ (answered
+ (elmo-msgdb-set-mark msgdb number
+ (if cached
+ elmo-msgdb-answered-cached-mark
+ elmo-msgdb-answered-uncached-mark)))
+ (t
+ (elmo-msgdb-set-mark msgdb number
+ (if cached
+ elmo-msgdb-unread-cached-mark
+ elmo-msgdb-unread-uncached-mark)))))))
+
+(defun elmo-msgdb-set-status (msgdb folder number status)
+ "Set message status.
+MSGDB is the ELMO msgdb.
+FOLDER is a ELMO folder structure.
+NUMBER is a message number to be set status.
+STATUS is a symbol which is one of the following:
+`read' ... Messages which are already read.
+`important' ... Messages which are marked as important.
+`answered' ... Messages which are marked as answered."
+ (let* ((cur-mark (elmo-msgdb-get-mark msgdb number))
+ (use-cache (elmo-message-use-cache-p folder number))
+ (cur-status (cond
+ ((string= cur-mark elmo-msgdb-important-mark)
+ 'important)
+ ((member cur-mark (elmo-msgdb-answered-marks))
+ 'answered)
+ ((not (member cur-mark (elmo-msgdb-unread-marks)))
+ 'read)))
+ (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks))))
+ mark-modified)
+ (case status
+ (read
+ (case cur-status
+ ((read important answered))
+ (t (elmo-msgdb-set-mark msgdb number
+ (if (and use-cache cur-cached)
+ (elmo-msgdb-set-mark
+ msgdb number
+ elmo-msgdb-read-uncached-mark)))
+ (setq mark-modified t))))
+ (important
+ (unless (eq cur-status 'important)
+ (elmo-msgdb-set-mark msgdb number elmo-msgdb-important-mark)
+ (setq mark-modified t)))
+ (answered
+ (unless (or (eq cur-status 'answered) (eq cur-status 'important))
+ (elmo-msgdb-set-mark msgdb number
+ (if cur-cached
+ (if use-cache
+ elmo-msgdb-answered-cached-mark
+ elmo-msgdb-answered-uncached-mark)
+ elmo-msgdb-answered-uncached-mark)))
+ (setq mark-modified t)))
+ (if mark-modified (elmo-folder-set-mark-modified-internal folder t))))
+
+(defun elmo-msgdb-unset-status (msgdb folder number status)
+ "Unset message status.
+MSGDB is the ELMO msgdb.
+FOLDER is a ELMO folder structure.
+NUMBER is a message number to be set status.
+STATUS is a symbol which is one of the following:
+`read' ... Messages which are already read.
+`important' ... Messages which are marked as important.
+`answered' ... Messages which are marked as answered."
+ (let* ((cur-mark (elmo-msgdb-get-mark msgdb number))
+ (use-cache (elmo-message-use-cache-p folder number))
+ (cur-status (cond
+ ((string= cur-mark elmo-msgdb-important-mark)
+ 'important)
+ ((member cur-mark (elmo-msgdb-answered-marks))
+ 'answered)
+ ((not (member cur-mark (elmo-msgdb-unread-marks)))
+ 'read)))
+ (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks)))))
+ (case status
+ (read
+ (if (eq cur-status 'read)
+ (elmo-msgdb-set-mark msgdb number
+ (if (and cur-cached use-cache)
+ elmo-msgdb-unread-cached-mark
+ elmo-msgdb-unread-uncached-mark))))
+ (important
+ (if (eq cur-status 'important)
+ (elmo-msgdb-set-mark msgdb number nil)))
+ (answered
+ (if (eq cur-status 'answered)
+ (elmo-msgdb-set-mark msgdb number
+ (if (and cur-cached (not use-cache))
+ elmo-msgdb-read-uncached-mark)))))))
+
+(defvar elmo-msgdb-unread-marks-internal nil)
+(defsubst elmo-msgdb-unread-marks ()
+ "Return an unread mark list"
+ (or elmo-msgdb-unread-marks-internal
+ (setq elmo-msgdb-unread-marks-internal
+ (list elmo-msgdb-new-mark
+ elmo-msgdb-unread-uncached-mark
+ elmo-msgdb-unread-cached-mark))))
+
+(defvar elmo-msgdb-answered-marks-internal nil)
+(defsubst elmo-msgdb-answered-marks ()
+ "Return an answered mark list"
+ (or elmo-msgdb-answered-marks-internal
+ (setq elmo-msgdb-answered-marks-internal
+ (list elmo-msgdb-answered-cached-mark
+ elmo-msgdb-answered-uncached-mark))))
+
+(defvar elmo-msgdb-uncached-marks-internal nil)
+(defsubst elmo-msgdb-uncached-marks ()
+ (or elmo-msgdb-uncached-marks-internal
+ (setq elmo-msgdb-uncached-marks-internal
+ (list elmo-msgdb-answered-uncached-mark
+ elmo-msgdb-unread-uncached-mark
+ elmo-msgdb-read-uncached-mark))))
+
+(defsubst elmo-msgdb-count-marks (msgdb)
(let ((new 0)
- (unreads 0))
+ (unreads 0)
+ (answered 0))
(dolist (elem (elmo-msgdb-get-mark-alist msgdb))
(cond
- ((string= (cadr elem) new-mark)
+ ((string= (cadr elem) elmo-msgdb-new-mark)
(incf new))
- ((member (cadr elem) unread-marks)
- (incf unreads))))
- (cons new unreads)))
+ ((member (cadr elem) (elmo-msgdb-unread-marks))
+ (incf unreads))
+ ((member (cadr elem) (elmo-msgdb-answered-marks))
+ (incf answered))))
+ (list new unreads answered)))
(defsubst elmo-msgdb-get-number (msgdb message-id)
"Get number of the message which corrensponds to MESSAGE-ID from MSGDB."
;;;
;; persistent mark handling
;; (for each folder)
-(defun elmo-msgdb-mark-alist-set (alist id mark msgdb)
- (let ((ret-val alist)
- entity)
- (setq entity (assq id alist))
- (if entity
- (if (eq mark nil)
- ;; delete this entity
- (setq ret-val (delq entity alist))
- ;; set mark
- (setcar (cdr entity) mark))
- (when mark
- (setq ret-val (elmo-msgdb-append-element ret-val
- (setq entity
- (list id mark))))
- (elmo-set-hash-val (format "#%d" id) entity
- (elmo-msgdb-get-mark-hashtb msgdb))))
- ret-val))
(defun elmo-msgdb-mark-append (alist id mark)
"Append mark."
(setq alist (elmo-msgdb-append-element alist
(list id mark))))
-(defun elmo-msgdb-seen-list (msgdb seen-marks)
+(defun elmo-msgdb-seen-list (msgdb)
"Get SEEN-MSGID-LIST from MSGDB."
(let ((ov (elmo-msgdb-get-overview msgdb))
mark seen-list)
(if (setq mark (elmo-msgdb-get-mark
msgdb
(elmo-msgdb-overview-entity-get-number (car ov))))
- (if (and mark (member mark seen-marks))
+ (if (and mark (member mark (list elmo-msgdb-important-mark
+ elmo-msgdb-read-uncached-mark)))
(setq seen-list (cons
(elmo-msgdb-overview-entity-get-id (car ov))
seen-list)))
elmo-msgdb-directory)
alist))
-(defun elmo-msgdb-add-msgs-to-seen-list (msgs msgdb unread-marks seen-list)
+(defun elmo-msgdb-add-msgs-to-seen-list (msgs msgdb seen-list)
;; Add to seen list.
(let (mark)
(while msgs
(if (setq mark (elmo-msgdb-get-mark msgdb (car msgs)))
- (unless (member mark unread-marks) ;; not unread mark
+ (unless (member mark (elmo-msgdb-unread-marks)) ;; not unread mark
(setq seen-list
(cons
(elmo-msgdb-get-field msgdb (car msgs) 'message-id)
(luna-define-method elmo-folder-check ((folder elmo-multi-folder))
(dolist (fld (elmo-multi-folder-children-internal folder))
- (elmo-folder-check fld)))
+ (elmo-folder-synchronize fld)))
(luna-define-method elmo-folder-close-internal ((folder elmo-multi-folder))
(dolist (fld (elmo-multi-folder-children-internal folder))
(elmo-folder-close-internal fld)))
+(luna-define-method elmo-folder-close :around ((folder elmo-multi-folder))
+ (dolist (fld (elmo-multi-folder-children-internal folder))
+ (elmo-folder-close fld)))
+
(luna-define-method elmo-folder-expand-msgdb-path ((folder
elmo-multi-folder))
(expand-file-name (elmo-replace-string-as-filename
numbers-list))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-multi-folder)
- numbers new-mark already-mark
- seen-mark important-mark
- seen-list)
+ numbers seen-list)
(let* ((folders (elmo-multi-folder-children-internal folder))
overview number-alist mark-alist entity
numbers-list
(elmo-multi-msgdb
(elmo-folder-msgdb-create (nth cur-number folders)
(nth cur-number numbers-list)
- new-mark already-mark
- seen-mark important-mark
seen-list)
(* (elmo-multi-folder-divide-number-internal folder)
(1+ cur-number))))))
(setq result (nconc result (list one-alist))))
result))
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-multi-folder) unread-marks &optional mark-alist)
- (elmo-multi-folder-list-unreads-internal folder unread-marks))
-
-(defun elmo-multi-folder-list-unreads-internal (folder unread-marks)
- (let ((folders (elmo-multi-folder-children-internal folder))
- (mark-alists (elmo-multi-split-mark-alist
- folder
- (elmo-msgdb-get-mark-alist
- (elmo-folder-msgdb folder))))
- (cur-number 0)
- unreads
- all-unreads)
- (while folders
+(luna-define-method elmo-folder-list-unreads ((folder elmo-multi-folder))
+ (let ((cur-number 0)
+ unreads)
+ (dolist (child (elmo-multi-folder-children-internal folder))
(setq cur-number (+ cur-number 1))
- (unless (listp (setq unreads
- (elmo-folder-list-unreads-internal
- (car folders) unread-marks (car mark-alists))))
- (setq unreads (delq nil
- (mapcar
- (lambda (x)
- (if (member (cadr x) unread-marks)
- (car x)))
- (car mark-alists)))))
- (setq all-unreads
- (nconc all-unreads
- (mapcar
- (lambda (x)
- (+ x
- (* cur-number
- (elmo-multi-folder-divide-number-internal
- folder))))
- unreads)))
- (setq mark-alists (cdr mark-alists)
- folders (cdr folders)))
- all-unreads))
-
-(luna-define-method elmo-folder-list-importants-internal
- ((folder elmo-multi-folder) important-mark)
- (let ((folders (elmo-multi-folder-children-internal folder))
- (mark-alists (elmo-multi-split-mark-alist
- folder
- (elmo-msgdb-get-mark-alist
- (elmo-folder-msgdb folder))))
- (cur-number 0)
- importants
- all-importants)
- (while folders
+ (setq unreads
+ (nconc
+ unreads
+ (mapcar (lambda (x)
+ (+ x (* cur-number
+ (elmo-multi-folder-divide-number-internal
+ folder))))
+ (elmo-folder-list-unreads child)))))
+ unreads))
+
+(luna-define-method elmo-folder-list-answereds ((folder elmo-multi-folder))
+ (let ((cur-number 0)
+ answereds)
+ (dolist (child (elmo-multi-folder-children-internal folder))
(setq cur-number (+ cur-number 1))
- (when (listp (setq importants
- (elmo-folder-list-importants-internal
- (car folders) important-mark)))
- (setq all-importants
- (nconc all-importants
- (mapcar
- (lambda (x)
- (+ x
- (* cur-number
- (elmo-multi-folder-divide-number-internal
- folder))))
- importants))))
- (setq mark-alists (cdr mark-alists)
- folders (cdr folders)))
- all-importants))
+ (setq answereds
+ (nconc
+ answereds
+ (mapcar (lambda (x)
+ (+ x (* cur-number
+ (elmo-multi-folder-divide-number-internal
+ folder))))
+ (elmo-folder-list-answereds child)))))
+ answereds))
+
+(luna-define-method elmo-folder-list-importants ((folder elmo-multi-folder))
+ (let ((cur-number 0)
+ importants)
+ (dolist (child (elmo-multi-folder-children-internal folder))
+ (setq cur-number (+ cur-number 1))
+ (setq importants
+ (nconc
+ importants
+ (mapcar (lambda (x)
+ (+ x (* cur-number
+ (elmo-multi-folder-divide-number-internal
+ folder))))
+ (elmo-folder-list-importants child)))))
+ (elmo-uniq-list
+ (nconc importants
+ (elmo-folder-list-messages-with-global-mark
+ folder elmo-msgdb-important-mark)))))
(luna-define-method elmo-folder-list-messages-internal
((folder elmo-multi-folder) &optional nohide)
(setq msg-list (cdr msg-list)))
ret-val))
-(luna-define-method elmo-folder-mark-as-important ((folder elmo-multi-folder)
- numbers)
+(luna-define-method elmo-folder-mark-as-important :around ((folder
+ elmo-multi-folder)
+ numbers)
(dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers))
(elmo-folder-mark-as-important (car folder-numbers)
(cdr folder-numbers)))
- t)
+ (luna-call-next-method))
-(luna-define-method elmo-folder-unmark-important ((folder elmo-multi-folder)
- numbers)
+(luna-define-method elmo-folder-unmark-important :around ((folder
+ elmo-multi-folder)
+ numbers)
(dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers))
(elmo-folder-unmark-important (car folder-numbers)
(cdr folder-numbers)))
- t)
+ (luna-call-next-method))
-(luna-define-method elmo-folder-mark-as-read ((folder elmo-multi-folder)
- numbers)
+(luna-define-method elmo-folder-mark-as-read :around ((folder
+ elmo-multi-folder)
+ numbers)
(dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers))
(elmo-folder-mark-as-read (car folder-numbers)
(cdr folder-numbers)))
- t)
+ (luna-call-next-method))
-(luna-define-method elmo-folder-unmark-read ((folder elmo-multi-folder)
- numbers)
+(luna-define-method elmo-folder-unmark-read :around ((folder
+ elmo-multi-folder)
+ numbers)
(dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers))
(elmo-folder-unmark-read (car folder-numbers)
(cdr folder-numbers)))
- t)
+ (luna-call-next-method))
+
+(luna-define-method elmo-folder-mark-as-answered :around ((folder
+ elmo-multi-folder)
+ numbers)
+ (dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers))
+ (elmo-folder-mark-as-answered (car folder-numbers)
+ (cdr folder-numbers)))
+ (luna-call-next-method))
+
+(luna-define-method elmo-folder-unmark-answered :around ((folder
+ elmo-multi-folder)
+ numbers)
+ (dolist (folder-numbers (elmo-multi-make-folder-numbers-list folder numbers))
+ (elmo-folder-unmark-answered (car folder-numbers)
+ (cdr folder-numbers)))
+ (luna-call-next-method))
(require 'product)
(product-provide (provide 'elmo-multi) (require 'elmo-version))
(elmo-dop-spool-folder-list-messages folder))))
t))
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-net-folder) unread-marks &optional mark-alist)
+(luna-define-method elmo-folder-list-unreads :around ((folder
+ elmo-net-folder))
(if (and (elmo-folder-plugged-p folder)
(elmo-folder-use-flag-p folder))
(elmo-folder-send folder 'elmo-folder-list-unreads-plugged)
- t))
+ (luna-call-next-method)))
-(luna-define-method elmo-folder-list-importants-internal
- ((folder elmo-net-folder) important-mark)
+(luna-define-method elmo-folder-list-importants :around ((folder
+ elmo-net-folder))
(if (and (elmo-folder-plugged-p folder)
(elmo-folder-use-flag-p folder))
- (elmo-folder-send folder 'elmo-folder-list-importants-plugged)
- t))
+ (elmo-uniq-list
+ (nconc
+ (elmo-folder-send folder 'elmo-folder-list-importants-plugged)
+ (elmo-folder-list-messages-with-global-mark
+ folder elmo-msgdb-important-mark)))
+ (luna-call-next-method)))
+
+(luna-define-method elmo-folder-list-answereds :around ((folder
+ elmo-net-folder))
+ (if (and (elmo-folder-plugged-p folder)
+ (elmo-folder-use-flag-p folder))
+ (elmo-folder-send folder 'elmo-folder-list-answereds-plugged)
+ (luna-call-next-method)))
(luna-define-method elmo-folder-list-unreads-plugged
((folder elmo-net-folder))
((folder elmo-net-folder))
t)
+(luna-define-method elmo-folder-list-answereds-plugged
+ ((folder elmo-net-folder))
+ t)
+
(luna-define-method elmo-folder-delete-messages ((folder elmo-net-folder)
numbers)
(if (elmo-folder-plugged-p folder)
(elmo-folder-delete-messages-dop folder numbers))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-net-folder)
- numbers new-mark
- already-mark seen-mark
- important-mark seen-list)
+ numbers seen-list)
(if (elmo-folder-plugged-p folder)
(elmo-folder-send folder 'elmo-folder-msgdb-create-plugged
- numbers
- new-mark
- already-mark seen-mark
- important-mark seen-list)
+ numbers seen-list)
(elmo-folder-send folder 'elmo-folder-msgdb-create-unplugged
- numbers
- new-mark already-mark seen-mark
- important-mark seen-list)))
+ numbers seen-list)))
(luna-define-method elmo-folder-msgdb-create-unplugged ((folder
elmo-net-folder)
numbers
- new-mark already-mark
- seen-mark
- important-mark
seen-list)
;; XXXX should be appended to already existing msgdb.
(elmo-dop-msgdb
(elmo-folder-msgdb-create (elmo-dop-spool-folder folder)
(mapcar 'abs numbers)
- new-mark already-mark
- seen-mark
- important-mark
seen-list)))
(luna-define-method elmo-folder-unmark-important ((folder elmo-net-folder)
folder 'elmo-folder-mark-as-read-unplugged numbers))
t))
+(luna-define-method elmo-folder-unmark-answered ((folder elmo-net-folder)
+ numbers)
+ (if (elmo-folder-use-flag-p folder)
+ (if (elmo-folder-plugged-p folder)
+ (elmo-folder-send folder 'elmo-folder-unmark-answered-plugged
+ numbers)
+ (elmo-folder-send folder
+ 'elmo-folder-unmark-answered-unplugged numbers))
+ (luna-call-next-method)))
+
+(luna-define-method elmo-folder-mark-as-answered ((folder elmo-net-folder)
+ numbers)
+ (if (elmo-folder-use-flag-p folder)
+ (if (elmo-folder-plugged-p folder)
+ (elmo-folder-send folder 'elmo-folder-mark-as-answered-plugged
+ numbers)
+ (elmo-folder-send folder 'elmo-folder-mark-as-answered-unplugged
+ numbers))
+ (luna-call-next-method)))
+
(luna-define-method elmo-folder-mark-as-read-unplugged ((folder
elmo-net-folder)
numbers)
numbers)
(elmo-folder-unmark-important-dop folder numbers))
+(luna-define-method elmo-folder-mark-as-answered-unplugged ((folder
+ elmo-net-folder)
+ numbers)
+ (elmo-folder-mark-as-answered-dop folder numbers))
+
+(luna-define-method elmo-folder-unmark-answered-unplugged
+ ((folder elmo-net-folder) numbers)
+ (elmo-folder-unmark-answered-dop folder numbers))
+
(luna-define-method elmo-message-encache :around ((folder elmo-net-folder)
number &optional read)
(if (elmo-folder-plugged-p folder)
entity))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-nmz-folder)
- numlist new-mark
- already-mark seen-mark
- important-mark
- seen-list)
+ numlist seen-list)
(let* (overview number-alist mark-alist entity
i percent num pair)
(setq num (length numlist))
(or (elmo-msgdb-global-mark-get
(elmo-msgdb-overview-entity-get-id
entity))
- new-mark))))
+ elmo-msgdb-new-mark))))
(when (> num elmo-display-progress-threshold)
(setq i (1+ i))
(setq percent (/ (* i 100) num))
(luna-define-method elmo-folder-exists-p ((folder elmo-nmz-folder))
t)
-;;; To override elmo-map-folder methods.
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-nmz-folder) unread-marks &optional mark-alist)
- t)
-
-(luna-define-method elmo-folder-unmark-important ((folder elmo-nmz-folder)
- numbers)
- t)
-
-(luna-define-method elmo-folder-mark-as-important ((folder elmo-nmz-folder)
- numbers)
- t)
-
-(luna-define-method elmo-folder-unmark-read ((folder elmo-nmz-folder) numbers)
- t)
-
-(luna-define-method elmo-folder-mark-as-read ((folder elmo-nmz-folder) numbers)
- t)
-
(require 'product)
(product-provide (provide 'elmo-nmz) (require 'elmo-version))
("xref" . 8)))
(defun elmo-nntp-create-msgdb-from-overview-string (str
- new-mark
- already-mark
- seen-mark
- important-mark
seen-list
&optional numlist)
(let (ov-list gmark message-id seen
(elmo-file-cache-get message-id))
(if seen
nil
- already-mark)
+ elmo-msgdb-unread-cached-mark)
(if seen
(if elmo-nntp-use-cache
- seen-mark)
- new-mark))))
+ elmo-msgdb-read-uncached-mark)
+ elmo-msgdb-new-mark))))
(setq mark-alist
(elmo-msgdb-mark-append mark-alist
num gmark))))
(list overview number-alist mark-alist)))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-nntp-folder)
- numbers new-mark already-mark
- seen-mark important-mark
- seen-list)
- (elmo-nntp-folder-msgdb-create folder numbers new-mark already-mark
- seen-mark important-mark
- seen-list))
-
-(defun elmo-nntp-folder-msgdb-create (folder numbers new-mark already-mark
- seen-mark important-mark
- seen-list)
+ numbers seen-list)
+ (elmo-nntp-folder-msgdb-create folder numbers seen-list))
+
+(defun elmo-nntp-folder-msgdb-create (folder numbers seen-list)
(let ((filter numbers)
(session (elmo-nntp-get-session folder))
beg-num end-num cur length
ret-val
(elmo-nntp-create-msgdb-from-overview-string
ov-str
- new-mark
- already-mark
- seen-mark
- important-mark
seen-list
filter
)))))
'elmo-nntp-msgdb-create "Getting overview..." 100)))
(if (not use-xover)
(setq ret-val (elmo-nntp-msgdb-create-by-header
- session numbers
- new-mark already-mark seen-mark seen-list))
+ session numbers seen-list))
(with-current-buffer (elmo-network-session-buffer session)
(if ov-str
(setq ret-val
ret-val
(elmo-nntp-create-msgdb-from-overview-string
ov-str
- new-mark
- already-mark
- seen-mark
- important-mark
seen-list
filter))))))
(elmo-folder-set-killed-list-internal
(nconc number-alist
(list (cons max-number nil))))))))))
-(defun elmo-nntp-msgdb-create-by-header (session numbers
- new-mark already-mark
- seen-mark seen-list)
+(defun elmo-nntp-msgdb-create-by-header (session numbers seen-list)
(with-temp-buffer
(elmo-nntp-retrieve-headers session (current-buffer) numbers)
(elmo-nntp-msgdb-create-message
- (length numbers) new-mark already-mark seen-mark seen-list)))
+ (length numbers) seen-list)))
(defun elmo-nntp-parse-xhdr-response (string)
(let (response)
;; end of from Gnus
-(defun elmo-nntp-msgdb-create-message (len new-mark
- already-mark seen-mark seen-list)
+(defun elmo-nntp-msgdb-create-message (len seen-list)
(save-excursion
(let (beg overview number-alist mark-alist
entity i num gmark seen message-id)
(elmo-file-cache-get message-id))
(if seen
nil
- already-mark)
+ elmo-msgdb-unread-cached-mark)
(if seen
(if elmo-nntp-use-cache
- seen-mark)
- new-mark))))
+ elmo-msgdb-read-uncached-mark)
+ elmo-msgdb-new-mark))))
(setq mark-alist
(elmo-msgdb-mark-append
mark-alist
elmo-crosspost-message-alist)))
(elmo-nntp-folder-set-reads-internal folder reads)))
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-nntp-folder) unread-marks mark-alist)
+(luna-define-method elmo-folder-list-unreads :around ((folder
+ elmo-nntp-folder))
;; 2.3. elmo-folder-list-unreads return unread message list according to
;; `reads' slot.
- (let ((mark-alist (or mark-alist (elmo-msgdb-get-mark-alist
- (elmo-folder-msgdb folder)))))
- (elmo-living-messages (delq nil
- (mapcar
- (lambda (x)
- (if (member (nth 1 x) unread-marks)
- (car x)))
- mark-alist))
- (elmo-nntp-folder-reads-internal folder))))
+ (elmo-living-messages (luna-call-next-method)
+ (elmo-nntp-folder-reads-internal folder)))
(require 'product)
(product-provide (provide 'elmo-nntp) (require 'elmo-version))
(elmo-folder-contains-type (elmo-pipe-folder-dst-internal folder) type)))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-pipe-folder)
- numlist new-mark already-mark
- seen-mark important-mark
- seen-list)
+ numlist seen-list)
(elmo-folder-msgdb-create (elmo-pipe-folder-dst-internal folder)
- numlist new-mark already-mark
- seen-mark important-mark seen-list))
+ numlist seen-list))
(luna-define-method elmo-folder-append-messages ((folder elmo-pipe-folder)
src-folder numbers
- unread-marks
&optional same-number)
(elmo-folder-append-messages (elmo-pipe-folder-dst-internal folder)
src-folder numbers
- unread-marks
same-number))
(luna-define-method elmo-folder-append-buffer ((folder elmo-pipe-folder)
(elmo-folder-list-messages-internal (elmo-pipe-folder-dst-internal
folder) nohide))
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-pipe-folder) unread-marks &optional mark-alist)
- (elmo-folder-list-unreads-internal (elmo-pipe-folder-dst-internal folder)
- unread-marks mark-alist))
+(luna-define-method elmo-folder-list-unreads ((folder elmo-pipe-folder))
+ (elmo-folder-list-unreads (elmo-pipe-folder-dst-internal folder)))
-(luna-define-method elmo-folder-list-importants-internal
- ((folder elmo-pipe-folder) important-mark)
- (elmo-folder-list-importants-internal (elmo-pipe-folder-dst-internal folder)
- important-mark))
+(luna-define-method elmo-folder-list-importants ((folder elmo-pipe-folder))
+ (elmo-folder-list-importants (elmo-pipe-folder-dst-internal folder)))
+
+(luna-define-method elmo-folder-list-answereds ((folder elmo-pipe-folder))
+ (elmo-folder-list-answereds (elmo-pipe-folder-dst-internal folder)))
(luna-define-method elmo-folder-status ((folder elmo-pipe-folder))
(elmo-folder-open-internal (elmo-pipe-folder-src-internal folder))
(copy-to-buffer tobuffer (point-min) (point-max)))))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-pop3-folder)
- numlist new-mark
- already-mark seen-mark
- important-mark seen-list)
+ numlist seen-list)
(let ((process (elmo-network-session-process-internal
(elmo-pop3-get-session folder))))
(with-current-buffer (process-buffer process)
(elmo-pop3-msgdb-create-by-header
process
numlist
- new-mark already-mark
- seen-mark seen-list
+ seen-list
(if (elmo-pop3-folder-use-uidl-internal folder)
(elmo-pop3-folder-location-alist-internal folder)))))))
elmo-pop3-size-hash))
(defun elmo-pop3-msgdb-create-by-header (process numlist
- new-mark already-mark
- seen-mark
seen-list
loc-alist)
(let ((tmp-buffer (get-buffer-create " *ELMO Overview TMP*")))
process
(length numlist)
numlist
- new-mark already-mark seen-mark seen-list loc-alist)
+ seen-list loc-alist)
(kill-buffer tmp-buffer)))))
(defun elmo-pop3-msgdb-create-message (buffer
process
num
- numlist new-mark already-mark
- seen-mark
+ numlist
seen-list
loc-alist)
(save-excursion
(elmo-file-cache-get message-id))
(if seen
nil
- already-mark)
+ elmo-msgdb-unread-cached-mark)
(if seen
(if elmo-pop3-use-cache
- seen-mark)
- new-mark))))
+ elmo-msgdb-read-uncached-mark)
+ elmo-msgdb-new-mark))))
(setq mark-alist
(elmo-msgdb-mark-append
mark-alist
(elmo-map-message-location folder number)))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-sendlog-folder)
- numbers new-mark
- already-mark seen-mark
- important-mark
- seen-list)
+ numbers seen-list)
(let ((i 0)
(len (length numbers))
overview number-alist mark-alist entity message-id
num
message-id))
(if (setq mark (or (elmo-msgdb-global-mark-get message-id)
- (if (member message-id seen-list) nil new-mark)))
+ (if (member message-id seen-list) nil
+ elmo-msgdb-new-mark)))
(setq mark-alist
(elmo-msgdb-mark-append
mark-alist
(luna-define-method elmo-message-file-p ((folder elmo-sendlog-folder) number)
t)
-;;; To override elmo-map-folder methods.
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-sendlog-folder) unread-marks &optional mark-alist)
- t)
-
-(luna-define-method elmo-folder-unmark-important ((folder elmo-sendlog-folder)
- numbers)
- t)
-
-(luna-define-method elmo-folder-mark-as-important ((folder elmo-sendlog-folder)
- numbers)
- t)
-
-(luna-define-method elmo-folder-unmark-read ((folder elmo-sendlog-folder)
- numbers)
- t)
-
-(luna-define-method elmo-folder-mark-as-read ((folder elmo-sendlog-folder)
- numbers)
- t)
-
(require 'product)
(product-provide (provide 'elmo-sendlog) (require 'elmo-version))
(list (cons "xref" (shimbun-header-xref header)))))))))
(luna-define-method elmo-folder-msgdb-create ((folder elmo-shimbun-folder)
- numlist new-mark
- already-mark seen-mark
- important-mark
- seen-list)
+ numlist seen-list)
(let* (overview number-alist mark-alist entity
i percent number length pair msgid gmark seen)
(setq length (length numlist))
(if (setq gmark (or (elmo-msgdb-global-mark-get msgid)
(if (elmo-file-cache-status
(elmo-file-cache-get msgid))
- (if seen nil already-mark)
+ (if seen nil elmo-msgdb-unread-cached-mark)
(if seen
(if elmo-shimbun-use-cache
- seen-mark)
- new-mark))))
+ elmo-msgdb-read-uncached-mark)
+ elmo-msgdb-new-mark))))
(setq mark-alist
(elmo-msgdb-mark-append mark-alist
number gmark))))
folder))))
t))
-;;; To override elmo-map-folder methods.
-(luna-define-method elmo-folder-list-unreads-internal
- ((folder elmo-shimbun-folder) unread-marks &optional mark-alist)
- t)
-
-(luna-define-method elmo-folder-unmark-important ((folder elmo-shimbun-folder)
- numbers)
- t)
-
-(luna-define-method elmo-folder-mark-as-important ((folder elmo-shimbun-folder)
- numbers)
- t)
-
-(luna-define-method elmo-folder-unmark-read ((folder elmo-shimbun-folder)
- numbers)
- t)
-
-(luna-define-method elmo-folder-mark-as-read ((folder elmo-shimbun-folder)
- numbers)
- t)
-
(require 'product)
(product-provide (provide 'elmo-shimbun) (require 'elmo-version))
(goto-char (match-end 0))))
;; search-key ::= [A-Za-z-]+
;; ;; "since" / "before" / "last" / "first" /
-;; ;; "body" / field-name
+;; ;; "body" / "mark" / field-name
((looking-at "\\(!\\)? *\\([A-Za-z-]+\\) *: *")
(goto-char (match-end 0))
(let ((search-key (vector