2007-01-17 OHASHI Akira <bg66@koka-in.org>
+ * mixi.el: (mixi-get-matched-items): Add REVERSE argument.
+ (mixi-get-comments): Follow the change above.
+
+2007-01-17 OHASHI Akira <bg66@koka-in.org>
+
* mixi.el: (mixi-realize-message): Follow the change of mixi.
2007-01-17 OHASHI Akira <bg66@koka-in.org>
(put 'with-mixi-post-form 'lisp-indent-function 'defun)
(put 'with-mixi-post-form 'edebug-form-spec '(body))
-(defun mixi-get-matched-items (url regexp &optional range)
+(defun mixi-get-matched-items (url regexp &optional range reverse)
"Get matched items to REGEXP in URL."
(let ((page 1)
ids)
(catch 'end
(while (or (null range) (< (length ids) range))
(with-mixi-retrieve (format url page)
- (let (found)
- (while (and (re-search-forward regexp nil t)
+ (let ((func (if reverse (progn
+ (goto-char (point-max))
+ 're-search-backward)
+ 're-search-forward))
+ found)
+ (while (and (funcall func regexp nil t)
(or (null range) (< (length ids) range)))
(let ((num 1)
list)
(regexp (eval (intern (concat mixi-object-prefix name
"-comment-list-regexp")))))
(let ((items (mixi-get-matched-items
- (funcall list-page parent) regexp)))
- (let (list)
- (catch 'stop
- (mapc (lambda (item)
- (when (and (numberp range)
- (>= (length list) range))
- (throw 'stop nil))
- (setq list (cons item list)))
- (reverse items)))
- (setq items (reverse list)))
+ (funcall list-page parent) regexp range t)))
(mapcar (lambda (item)
(mixi-make-comment parent (mixi-make-friend
(nth 7 item) (nth 8 item))