From a442c4aea818531dc2cc27c40d984902f647d005 Mon Sep 17 00:00:00 2001 From: bg66 Date: Wed, 17 Jan 2007 11:02:29 +0000 Subject: [PATCH] * mixi.el: (mixi-get-matched-items): Add REVERSE argument. (mixi-get-comments): Follow the change above. --- ChangeLog | 5 +++++ mixi.el | 21 ++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad7dea0..cde87ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-01-17 OHASHI Akira + * mixi.el: (mixi-get-matched-items): Add REVERSE argument. + (mixi-get-comments): Follow the change above. + +2007-01-17 OHASHI Akira + * mixi.el: (mixi-realize-message): Follow the change of mixi. 2007-01-17 OHASHI Akira diff --git a/mixi.el b/mixi.el index ed00996..ff8a53a 100644 --- a/mixi.el +++ b/mixi.el @@ -440,15 +440,19 @@ Increase this value when unexpected error frequently occurs." (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) @@ -2249,16 +2253,7 @@ Increase this value when unexpected error frequently occurs." (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)) -- 1.7.10.4