* wl-summary.el (wl-summary-update-mark): Ignore errors while
authorteranisi <teranisi>
Mon, 28 Jul 2003 14:03:53 +0000 (14:03 +0000)
committerteranisi <teranisi>
Mon, 28 Jul 2003 14:03:53 +0000 (14:03 +0000)
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
elmo/elmo.el
wl/ChangeLog
wl/wl-message.el
wl/wl-summary.el

index 7ad35a3..c29cf71 100644 (file)
@@ -1,5 +1,8 @@
 2003-07-28  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * 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.
index dd04160..5149ba4 100644 (file)
@@ -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)
index 6b33e47..23e645b 100644 (file)
@@ -1,5 +1,12 @@
 2003-07-28  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * 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 <shinichiro@stained-g.net>)
        (wl-expire-refile-with-copy-reserve-msg): Follow the change in the
index 4a243eb..ba7d3c6 100644 (file)
@@ -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)
index e802611..815c234 100644 (file)
@@ -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))