2004-08-31 Yuuichi Teranishi <teranisi@gohome.org>
+ * modb-standard.el (modb-standard-digest-flags): New variable.
+ (elmo-msgdb-list-flagged): Use it for `digest'; Add `uncached';
+ Changed behavior of `any'.
+
+ * elmo-imap4.el (elmo-imap4-flag-specs): Added keyword flags
+ which are defined the Internet draft
+ (draft-melnikov-imap-keywords-03.txt).
+ (elmo-imap4-flags-to-imap): New function.
+ (elmo-folder-append-buffer): Use it.
+
+ * modb-legacy.el (modb-legacy-answered-uncached-mark): Fixed typo
+ in the docstring.
+
* utf7.el (utf7-fragment-encode): Don't use narrow-to-region to
avoid the bug of Emacs 21.3.
(defconst elmo-imap4-flag-specs '((important "\\Flagged")
(read "\\Seen")
(unread "\\Seen" 'remove)
- (answered "\\Answered")))
+ (answered "\\Answered")
+ ;; draft-melnikov-imap-keywords-03.txt
+ (forwarded "$Forwarded")
+ (work "$Work")
+ (personal "$Personal")
+ (shouldreply "$ShouldReply")))
;; For debugging.
(defvar elmo-imap4-debug nil
(elmo-imap4-mailbox
(elmo-imap4-folder-mailbox-internal folder)))))
+(defun elmo-imap4-flags-to-imap (flags)
+ "Convert FLAGS to the IMAP flag string."
+ (let ((imap-flag (if (not (memq 'unread flags)) "\\Seen"))
+ (flags (delq 'cached (delq 'unread flags)))
+ spec)
+ (dolist (flag flags)
+ (setq imap-flag (concat imap-flag (if imap-flag " ")
+ (or (car (cdr (assq flag elmo-imap4-flag-specs)))
+ (capitalize (symbol-name flag))))))
+ imap-flag))
+
(luna-define-method elmo-folder-append-buffer
((folder elmo-imap4-folder) &optional flags number)
(if (elmo-folder-plugged-p folder)
(elmo-imap4-mailbox (elmo-imap4-folder-mailbox-internal
folder))
(if (and flags (elmo-folder-use-flag-p folder))
- (concat " ("
- (mapconcat
- 'identity
- (append
- (and (memq 'important flags)
- '("\\Flagged"))
- (and (not (memq 'unread flags))
- '("\\Seen"))
- (and (memq 'answered flags)
- '("\\Answered")))
- " ")
- ;; XX KEYWORD flags
- ") ")
+ (concat " (" (elmo-imap4-flags-to-imap flags) ") ")
" () ")
(elmo-imap4-buffer-literal send-buffer))))
(kill-buffer send-buffer))
"Mark for answered and cached message.")
(defconst modb-legacy-answered-uncached-mark "A"
- "Mark for answered but cached message.")
+ "Mark for answered but uncached message.")
(defconst modb-legacy-important-mark "$"
"Mark for important message.")
(defvar modb-standard-msgid-filename "msgid"
"Message number <=> Message-Id database.")
+(defvar modb-standard-digest-flags '(unread)
+ "Flags which are listed as `digest'.")
+
(eval-and-compile
(luna-define-class modb-standard (modb-generic)
(number-list ; sorted list of message numbers.
(modb-standard-number-list-internal msgdb)))
(luna-define-method elmo-msgdb-list-flagged ((msgdb modb-standard) flag)
- (let ((flags (case flag
- (digest
- (append '(unread) (elmo-get-global-flags t t)))
- (any
- (append '(unread answered) (elmo-get-global-flags t t)))))
- entry matched)
+ (let (entry matched)
(case flag
(read
(dolist (number (modb-standard-number-list-internal msgdb))
(unless (memq 'unread (modb-standard-message-flags msgdb number))
(setq matched (cons number matched)))))
- ((digest any)
+ (uncached
+ (dolist (number (modb-standard-number-list-internal msgdb))
+ (unless (memq 'cached (modb-standard-message-flags msgdb number))
+ (setq matched (cons number matched)))))
+ (any
(mapatoms
(lambda (atom)
(setq entry (symbol-value atom))
- (when (modb-standard-match-flags flags (cdr entry))
+ (unless (and (eq (length (cdr entry)) 1)
+ (eq (car (cdr entry)) 'cached))
+ ;; If there is a flag other than cached, then the message
+ ;; matches to `any'.
(setq matched (cons (car entry) matched))))
(modb-standard-flag-map msgdb)))
+ (digest
+ (let ((flags (append modb-standard-digest-flags
+ (elmo-get-global-flags t t))))
+ (mapatoms
+ (lambda (atom)
+ (setq entry (symbol-value atom))
+ (when (modb-standard-match-flags flags (cdr entry))
+ (setq matched (cons (car entry) matched))))
+ (modb-standard-flag-map msgdb))))
(t
(mapatoms
(lambda (atom)