From 84c71fc5bbab967af0fc7b0af539c4ec42dd5ab1 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 5 Aug 2003 14:41:59 +0000 Subject: [PATCH] * wl-util.el (wl-current-message-buffer): Define as function; Don't use the value of wl-messge-buffer. * wl-summary.el (wl-summary-redisplay-no-mime-internal): Update persistent mark. * wl-mime.el (wl-draft-yank-current-message-entity): If there's no current message, cause an error. * elmo-mime.el (elmo-mime-message-display): Display message entirely if folder length is zero. (elmo-mime-display-as-is): Ditto. * elmo-multi.el (elmo-folder-set-message-modified): Ditto. --- elmo/ChangeLog | 6 +++++- elmo/elmo-mime.el | 26 +++++++++++++++----------- elmo/elmo-multi.el | 2 +- wl/ChangeLog | 11 +++++++++++ wl/wl-mime.el | 7 +++++-- wl/wl-summary.el | 6 +++++- wl/wl-util.el | 11 ++++++----- 7 files changed, 48 insertions(+), 21 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 606819a..e57ad7d 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,4 +1,8 @@ -2003-08-04 Yuuichi Teranishi +2003-08-05 Yuuichi Teranishi + + * elmo-mime.el (elmo-mime-message-display): Display message entirely + if folder length is zero. + (elmo-mime-display-as-is): Ditto. * elmo-filter.el (elmo-folder-set-message-modified): Define. diff --git a/elmo/elmo-mime.el b/elmo/elmo-mime.el index feb5f42..0fa6fa0 100644 --- a/elmo/elmo-mime.el +++ b/elmo/elmo-mime.el @@ -224,9 +224,11 @@ Return non-nil if not entire message was fetched." (let (mime-display-header-hook ; Do nothing. (elmo-message-displaying t) entity strategy) - (setq entity (elmo-message-entity folder number)) - (setq strategy (elmo-find-fetch-strategy folder entity - ignore-cache)) + (unless (zerop (elmo-folder-length folder)) + (setq entity (elmo-message-entity folder number))) + (setq strategy (if entity (elmo-find-fetch-strategy folder entity + ignore-cache) + (elmo-make-fetch-strategy 'entire))) (mime-display-message (mime-open-entity (if (and strategy @@ -256,21 +258,23 @@ Return non-nil if cache is used." (elmo-folder-msgdb folder))) mime-display-header-hook ; Do nothing. cache-file strategy use-cache) - (setq cache-file (elmo-file-cache-get - (elmo-msgdb-overview-entity-get-id entity))) - (setq use-cache (and (elmo-message-use-cache-p folder number) - (eq (elmo-file-cache-status cache-file) 'entire))) + (when entity + (setq cache-file (elmo-file-cache-get + (elmo-msgdb-overview-entity-get-id entity))) + (setq use-cache (and (elmo-message-use-cache-p folder number) + (eq (elmo-file-cache-status cache-file) 'entire)))) (setq strategy (elmo-make-fetch-strategy - 'entire use-cache (elmo-message-use-cache-p folder number) - (elmo-file-cache-path - cache-file))) + 'entire use-cache + (elmo-message-use-cache-p folder number) + (elmo-file-cache-path cache-file))) (elmo-mime-display-as-is-internal (mime-open-entity 'elmo-buffer (elmo-make-mime-message-location folder number strategy rawbuf unread)) viewbuf nil keymap original-mode) - (elmo-fetch-strategy-use-cache strategy))) + (when strategy + (elmo-fetch-strategy-use-cache strategy)))) ;; Replacement of mime-display-message. (defun elmo-mime-display-as-is-internal (message diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index ded52a4..d03b1f6 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -43,7 +43,7 @@ (defmacro elmo-multi-real-folder-number (folder number) "Returns a cons cell of real FOLDER and NUMBER." - (` (cons (nth (- + (` (cons (nth (- (/ (, number) (elmo-multi-folder-divide-number-internal (, folder))) 1) (elmo-multi-folder-children-internal (, folder))) diff --git a/wl/ChangeLog b/wl/ChangeLog index e55b9d8..6f36d88 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,14 @@ +2003-08-05 Yuuichi Teranishi + + * wl-util.el (wl-current-message-buffer): Define as function; + Don't use the value of wl-messge-buffer. + + * wl-summary.el (wl-summary-redisplay-no-mime-internal): Update + persistent mark. + + * wl-mime.el (wl-draft-yank-current-message-entity): If there's + no current message, cause an error. + 2003-08-03 Hiroya Murata * wl-summary.el (wl-summary-set-message-modified): Use diff --git a/wl/wl-mime.el b/wl/wl-mime.el index d6f467b..16f56c0 100644 --- a/wl/wl-mime.el +++ b/wl/wl-mime.el @@ -59,8 +59,11 @@ has Non-nil value\)" (function wl-draft-yank-to-draft-buffer)))) (mime-preview-following-method-alist (list (cons 'wl-original-message-mode - (function wl-draft-yank-to-draft-buffer))))) - (if (get-buffer (wl-current-message-buffer)) + (function wl-draft-yank-to-draft-buffer)))) + (message-buffer (wl-current-message-buffer))) + (unless message-buffer + (error "No message.")) + (if (get-buffer message-buffer) (save-excursion (set-buffer (wl-current-message-buffer)) (save-restriction diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 5b71144..4333652 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -4155,7 +4155,11 @@ If ASK-CODING is non-nil, coding-system for the message is asked." (wl-message-redisplay fld num 'as-is (string= (elmo-folder-name-internal fld) wl-draft-folder)) - (wl-summary-mark-as-read num) + (ignore-errors + (if (member (elmo-message-mark fld num) + (elmo-msgdb-unread-marks)) + (wl-summary-mark-as-read num); no-folder-mark) + (wl-summary-update-persistent-mark))) (setq wl-summary-buffer-current-msg num) (when wl-summary-recenter (recenter (/ (- (window-height) 2) 2)) diff --git a/wl/wl-util.el b/wl/wl-util.el index 723874d..ebc1894 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -539,11 +539,12 @@ that `read' can handle, whenever this is possible." (defmacro wl-concat-list (list separator) (` (mapconcat 'identity (delete "" (delq nil (, list))) (, separator)))) -(defmacro wl-current-message-buffer () - (` (save-excursion - (if (buffer-live-p wl-current-summary-buffer) - (set-buffer wl-current-summary-buffer)) - wl-message-buffer))) +(defun wl-current-message-buffer () + (when (buffer-live-p wl-current-summary-buffer) + (with-current-buffer wl-current-summary-buffer + (car (wl-message-buffer-display wl-summary-buffer-elmo-folder + (wl-summary-message-number) + 'mime))))) (defmacro wl-kill-buffers (regexp) (` (mapcar (function -- 1.7.10.4