- (dolist (number (elmo-msgdb-get-number-alist msgdb))
- (unless (string-match mark-regexp (elmo-msgdb-get-mark
- msgdb number))
- (setq matched (cons number matched))))
+ (dolist (number (elmo-msgdb-list-messages msgdb))
+ (let ((mark (elmo-msgdb-get-mark msgdb number)))
+ (unless (and mark (string-match mark-regexp mark))
+ (setq matched (cons number matched)))))