From 8cc01304890c8fd78fb2590c588563ecfa546286 Mon Sep 17 00:00:00 2001 From: teranisi Date: Wed, 3 Oct 2001 05:51:12 +0000 Subject: [PATCH] * wl-summary.el (wl-summary-mark-as-important): If message is already cached, set messag as read, otherwise encache and mark as read. * elmo.el (elmo-generic-folder-append-messages): Check return value of elmo-folder-append-buffer. (elmo-folder-encache): Added optional argument `read'. (elmo-message-encache): Ditto. --- elmo/ChangeLog | 2 ++ elmo/elmo.el | 17 ++++++++++------- wl/ChangeLog | 5 +++++ wl/wl-summary.el | 5 +++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index bbd4033..72dea86 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -2,6 +2,8 @@ * elmo.el (elmo-generic-folder-append-messages): Check return value of elmo-folder-append-buffer. + (elmo-folder-encache): Added optional argument `read'. + (elmo-message-encache): Ditto. * elmo-dop.el (elmo-folder-append-buffer-dop-delayed): Ditto. diff --git a/elmo/elmo.el b/elmo/elmo.el index 2524b08..621c771 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -514,15 +514,18 @@ Return newly created temporary directory name which contains temporary files.") ((folder elmo-folder) important-mark) t) -(defun elmo-folder-encache (folder numbers) - "Encache messages in the FOLDER with NUMBERS." +(defun elmo-folder-encache (folder numbers &optional unread) + "Encache messages in the FOLDER with NUMBERS. +If UNREAD is non-nil, messages are not marked as read." (dolist (number numbers) - (elmo-message-encache folder number))) + (elmo-message-encache folder number unread))) -(luna-define-generic elmo-message-encache (folder number) - "Encache message in the FOLDER with NUMBER.") +(luna-define-generic elmo-message-encache (folder number &optional read) + "Encache message in the FOLDER with NUMBER. +If READ is non-nil, message is marked as read.") -(luna-define-method elmo-message-encache ((folder elmo-folder) number) +(luna-define-method elmo-message-encache ((folder elmo-folder) number + &optional read) (elmo-message-fetch folder number (elmo-make-fetch-strategy 'entire @@ -531,7 +534,7 @@ Return newly created temporary directory name which contains temporary files.") (elmo-file-cache-get-path (elmo-message-field folder number 'message-id))) - nil nil 'unread)) + nil nil (not read))) (luna-define-generic elmo-message-fetch (folder number strategy &optional diff --git a/wl/ChangeLog b/wl/ChangeLog index 43febeb..f2bb218 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2001-10-03 Yuuichi Teranishi + + * wl-summary.el (wl-summary-mark-as-important): If message is + already cached, set messag as read, otherwise encache and mark as read. + 2001-10-02 Yoichi NAKAYAMA * wl-summary.el (wl-summary-jump-to-current-message): Don't go to diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 6b1dcc7..1c273b2 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -4153,9 +4153,10 @@ If ARG, exit virtual folder." (elmo-msgdb-mark-set mark-alist number wl-summary-important-mark)) - (unless (elmo-file-cache-exists-p message-id) + (if (elmo-file-cache-exists-p message-id) + (elmo-folder-mark-as-read folder (list number)) ;; Force cache message. - (elmo-message-encache folder number)) + (elmo-message-encache folder number 'read)) (unless no-server-update (elmo-msgdb-global-mark-set message-id wl-summary-important-mark))) -- 1.7.10.4