$ diff -c kamail-summary.l.orig kamail-summary.l
*** kamail-summary.l.orig Tue Jan 28 01:04:09 2003
--- kamail-summary.l Sun Jan 9 11:34:26 2005
***************
*** 48,53 ****
--- 48,54 ----
(define-key *kamail-list-map* #\P 'kamail-copy-marked-mail)
(define-key *kamail-list-map* #\p 'kamail-set-copy-mail)
(define-key *kamail-list-map* #\s 'kamail-marked-mail-seen)
+ (define-key *kamail-list-map* #\z 'kamail-marked-mail-unseen)
(define-key *kamail-list-map* #\m 'kamail-mark-set-and-next)
(define-key *kamail-list-map* #\M 'kamail-mark-set-all)
(define-key *kamail-list-map* #\x 'kamail-mark-execute)
$ diff -c kamail-menu.l.orig kamail-menu.l
*** kamail-menu.l.orig Fri Nov 14 13:10:07 2003
--- kamail-menu.l Sun Jan 9 12:18:13 2005
***************
*** 402,407 ****
--- 402,409 ----
'kamail-join-marked-message)
(add-menu-item menu nil "読んだことにする"
'kamail-marked-mail-seen)
+ (add-menu-item menu nil "未読にする"
+ 'kamail-marked-mail-unseen)
menu))
(defun kamail-summary-menu-list ()
$ diff -c kamail-mark.l.orig kamail-mark.l
*** kamail-mark.l.orig Sun Jan 26 06:05:10 2003
--- kamail-mark.l Sun Jan 9 12:28:15 2005
***************
*** 226,236 ****
--- 226,244 ----
(defun kamail-status-set-seen ()
(kamail-status-set-update *kamail-status-seen*))
+ (defun kamail-status-set-unseen ()
+ (kamail-status-set-update *kamail-status-seen* *kamail-status-seen*))
+
(defun kamail-mail-seenp ()
(interactive)
(not (char= (kamail-status-get)
*kamail-status-char-unseen*)))
+ (defun kamail-mail-unseenp ()
+ (interactive)
+ (char= (kamail-status-get)
+ *kamail-status-char-unseen*))
+
(defun kamail-mail-need-reply-p ()
(not (char= (kamail-status-get)
*kamail-status-char-need-reply*)))
***************
*** 269,274 ****
--- 277,296 ----
(kamail-folder-status-update *kamail-folder-current* num))
))
+ (defun kamail-mail-unseen (num)
+ (interactive)
+ (save-excursion
+ (unless (kamail-mail-unseenp)
+ (kamail-status-set-unseen)
+ (kamail-summary-line-attribute)
+ (kamail-folder-mail-unseen num))))
+
+ (defun kamail-folder-mail-unseen (num)
+ (cond ((kamail-folder-imap-p)
+ (kamail-folder-status-decrement *kamail-folder-current*))
+ (t
+ )))
+
;;
;; Mark関連
;;
***************
*** 450,455 ****
--- 472,510 ----
(defun kamail-summary-header (num)
(cadr (assoc num kamail-headers :test #'equal)))
+ (defun kamail-marked-mail-unseen ()
+ (interactive)
+ (unless (yes-or-no-p "マークしたメッセージを未読にしますか?")
+ (return-from kamail-marked-mail-unseen))
+ (let ((max 0)
+ (buffer-read-only nil))
+ (declare (special buffer-read-only))
+ (message "Marking message as unseen ...")
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (or (eolp) (eobp)))
+ (when (kamail-mark-markp)
+ (cond ((kamail-folder-imap-p)
+ (kamail-mark-unset)
+ (when (not (kamail-mail-unseenp))
+ (let* ((num (parse-integer (kamail-summary-getnum))))
+ (when num
+ (kamail-mail-unseen num)
+ (imap4-unseen-flags (kamail-account-stream) num)
+ (setq max (max max num))))))
+ (t
+ (message "このフォルダは対応してません。: ~S" *kamail-folder-current*))
+ ))
+ (unless (forward-line 1)
+ (return))
+ );while
+ )
+ (when max
+ (kamail-folder-status-update *kamail-folder-current* max))
+ (kamail-list-reload)
+ (message "Marking messages as unseen ... done")
+ ))
+
(defun kamail-marked-mail-seen ()
(interactive)
(unless (yes-or-no-p "マークしたメッセージを読んだ事にしますか?")
***************
*** 480,485 ****
--- 535,548 ----
(when num
(kamail-mail-seen num)
(setq max (max max num))))))
+ ((kamail-folder-imap-p)
+ (kamail-mark-unset)
+ (when (not (kamail-mail-seenp))
+ (let* ((num (parse-integer (kamail-summary-getnum))))
+ (when num
+ (kamail-mail-seen num)
+ (imap4-seen-flags (kamail-account-stream) num)
+ (setq max (max max num))))))
(t
(message "このフォルダはできません。: ~S" *kamail-folder-current*))
))
$ diff -c kamail-folder.l.orig kamail-folder.l
*** kamail-folder.l.orig Sun Jan 9 12:12:40 2005
--- kamail-folder.l Sun Jan 9 12:30:31 2005
***************
*** 1322,1327 ****
--- 1322,1336 ----
)
))
+ (defun kamail-folder-status-decrement (folder)
+ "フォルダの現在の既読数を一つ減らす"
+ (let ((curn (kamail-folder-get-curn folder))
+ (stat (kamail-folder-get-stat folder)))
+ (when (and (numberp stat)
+ (numberp curn)
+ (< curn stat))
+ (kamail-folder-status-change folder (1- curn)))))
+
(defun kamail-folder-unseen-decrement (folder)
"フォルダの未読数を一つ減らす"
(let ((unseen (kamail-folder-get-unseen folder)))
$ diff -c imap4.l.orig imap4.l
*** imap4.l.orig Sat Nov 8 15:20:17 2003
--- imap4.l Sun Jan 9 11:01:07 2005
***************
*** 705,710 ****
--- 705,713 ----
(defun imap4-seen-flags (stream nums)
(imap4-store stream nums "+FLAGS" "\\Seen"))
+ (defun imap4-unseen-flags (stream nums)
+ (imap4-store stream nums "-FLAGS" "\\Seen"))
+
(defun imap4-answered-flags (stream nums)
(imap4-store stream nums "+FLAGS" "\\Answered"))
IMAPフォルダ以外は私は使ってないからパス。しかもなんか動作があやしいし。でも既読を未読に出来ることは出来たのでこれで良しとしよう