* mixi.el (mixi-get-matched-items): Fix the condition for quitting
authorbg66 <bg66>
Wed, 22 Nov 2006 02:47:35 +0000 (02:47 +0000)
committerbg66 <bg66>
Wed, 22 Nov 2006 02:47:35 +0000 (02:47 +0000)
retrieval.

ChangeLog
mixi.el

index c2d65f1..8c71c27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-22  KAMO Tomoyuki  <kto2038@yahoo.co.jp>
+
+       * mixi.el (mixi-get-matched-items): Fix the condition for quitting
+       retrieval.
+
 2006-11-20  OHASHI Akira  <bg66@koka-in.org>
 
        * sb-mixi.el (shimbun-mixi-get-comment-p): New user option.
diff --git a/mixi.el b/mixi.el
index a0a4e43..bf95ff5 100644 (file)
--- a/mixi.el
+++ b/mixi.el
@@ -354,7 +354,8 @@ Increase this value when unexpected error frequently occurs."
     (catch 'end
       (while (or (null max-numbers) (< (length ids) max-numbers))
        (with-mixi-retrieve (format url page)
-         (let ((pos 0))
+         (let ((pos 0)
+               found)
            (while (and (string-match regexp buffer pos)
                        (or (null max-numbers) (< (length ids) max-numbers)))
              (let ((num 1)
@@ -362,11 +363,11 @@ Increase this value when unexpected error frequently occurs."
                (while (match-string num buffer)
                  (setq list (cons (match-string num buffer) list))
                  (incf num))
-               (when (member (reverse list) ids)
-                 (throw 'end ids))
-               (setq ids (cons (reverse list) ids))
+               (when (not (member (reverse list) ids))
+                 (setq found t)
+                 (setq ids (cons (reverse list) ids)))
                (setq pos (match-end (1- num)))))
-           (when (eq pos 0)
+           (when (not found)
              (throw 'end ids))))
        (incf page)))
     ;; FIXME: Sort? Now order by newest.