From 4cf8f34a4c4313dc2fb255aa07be31990988e7c1 Mon Sep 17 00:00:00 2001 From: teranisi Date: Mon, 28 Jul 2003 14:03:53 +0000 Subject: [PATCH] * wl-summary.el (wl-summary-update-mark): Ignore errors while retrieving message mark. (wl-summary-redisplay-internal): Ditto. * wl-message.el (wl-message-buffer-display): Ignore errors while retrieving message-id field. * elmo.el (elmo-message-mark): Cause an error when empty folder. (elmo-message-field): Ditto. --- elmo/ChangeLog | 3 +++ elmo/elmo.el | 4 ++++ wl/ChangeLog | 7 +++++++ wl/wl-message.el | 3 ++- wl/wl-summary.el | 32 ++++++++++++++++++-------------- 5 files changed, 34 insertions(+), 15 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7ad35a3..c29cf71 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,8 @@ 2003-07-28 Yuuichi Teranishi + * elmo.el (elmo-message-mark): Cause an error when empty folder. + (elmo-message-field): Ditto. + * elmo-maildir.el (luna-define-class): Added slot `answered-locations'. (elmo-map-folder-list-message-locations): Setup `answered-locations' slot. diff --git a/elmo/elmo.el b/elmo/elmo.el index dd04160..5149ba4 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1250,6 +1250,8 @@ FOLDER is the ELMO folder structure. NUMBER is a number of the message.") (luna-define-method elmo-message-mark ((folder elmo-folder) number) + (when (zerop (elmo-folder-length folder)) + (error "Cannot treat this folder correctly.")) (elmo-msgdb-get-mark (elmo-folder-msgdb folder) number)) (luna-define-generic elmo-message-field (folder number field) @@ -1259,6 +1261,8 @@ NUMBER is a number of the message. FIELD is a symbol of the field.") (luna-define-method elmo-message-field ((folder elmo-folder) number field) + (when (zerop (elmo-folder-length folder)) + (error "Cannot treat this folder correctly.")) (elmo-msgdb-get-field (elmo-folder-msgdb folder) number field)) (luna-define-method elmo-message-use-cache-p ((folder elmo-folder) number) diff --git a/wl/ChangeLog b/wl/ChangeLog index 6b33e47..23e645b 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,5 +1,12 @@ 2003-07-28 Yuuichi Teranishi + * wl-summary.el (wl-summary-update-mark): Ignore errors while + retrieving message mark. + (wl-summary-redisplay-internal): Ditto. + + * wl-message.el (wl-message-buffer-display): Ignore errors while + retrieving message-id field. + * wl-expire.el (wl-summary-expire): Fixed 2nd argument for `wl-append'. (Reported by Shinichiro HIDA ) (wl-expire-refile-with-copy-reserve-msg): Follow the change in the diff --git a/wl/wl-message.el b/wl/wl-message.el index 4a243eb..ba7d3c6 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -468,7 +468,8 @@ Returns non-nil if bottom of message." ;; Use message buffer cache. (defun wl-message-buffer-display (folder number flag &optional force-reload unread) - (let* ((msg-id (elmo-message-field folder number 'message-id)) + (let* ((msg-id (ignore-errors (elmo-message-field folder number + 'message-id))) (fname (elmo-folder-name-internal folder)) (hit (wl-message-buffer-cache-hit (list fname number msg-id))) (read nil) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index e802611..815c234 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -2896,15 +2896,18 @@ If ARG, exit virtual folder." "Synch up persistent mark of current line with msgdb's." (let ((number (or number (wl-summary-message-number))) buffer-read-only cur-mark) - (setq cur-mark (elmo-message-mark wl-summary-buffer-elmo-folder number)) - (save-excursion - ;; set mark on buffer - (unless (string= (wl-summary-persistent-mark) cur-mark) - (delete-backward-char 1) - (insert (or cur-mark " "))) - (when wl-summary-highlight - (wl-highlight-summary-current-line)) - (set-buffer-modified-p nil)))) + (ignore-errors + (setq cur-mark + (elmo-message-mark wl-summary-buffer-elmo-folder number)) + (save-excursion + ;; set mark on buffer + (unless (string= (wl-summary-persistent-mark) cur-mark) + (delete-backward-char 1) + (insert (or cur-mark " "))) + (when wl-summary-highlight + (wl-highlight-summary-current-line)))) + (set-buffer-modified-p nil))) + (defsubst wl-summary-mark-as-read-internal (inverse number-or-numbers @@ -4204,11 +4207,12 @@ Use function list is `wl-summary-write-current-folder-functions'." 'leave))) (when (elmo-message-use-cache-p folder num) (elmo-message-set-cached folder num t)) - (if (member (elmo-message-mark wl-summary-buffer-elmo-folder - num) - (elmo-msgdb-unread-marks)) - (wl-summary-mark-as-read num no-folder-mark) - (wl-summary-update-mark)) + (ignore-errors + (if (member (elmo-message-mark wl-summary-buffer-elmo-folder + num) + (elmo-msgdb-unread-marks)) + (wl-summary-mark-as-read num no-folder-mark) + (wl-summary-update-mark))) (setq wl-summary-buffer-current-msg num) (when wl-summary-recenter (recenter (/ (- (window-height) 2) 2)) -- 1.7.10.4