From aa7d17ae33c84f525ea9bb44d344d77899929f65 Mon Sep 17 00:00:00 2001 From: bg66 Date: Thu, 18 Jan 2007 10:47:16 +0000 Subject: [PATCH] * mixi.el (mixi-buffer-name): New variable. (with-mixi-buffer): New macro. (with-mixi-retrieve): Use them. (with-mixi-post-form): Ditto. (mixi-get-matched-items): Follow the change above. --- ChangeLog | 8 ++++++++ mixi.el | 25 ++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index fad19f2..4625bc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2007-01-18 OHASHI Akira + * mixi.el (mixi-buffer-name): New variable. + (with-mixi-buffer): New macro. + (with-mixi-retrieve): Use them. + (with-mixi-post-form): Ditto. + (mixi-get-matched-items): Follow the change above. + +2007-01-18 OHASHI Akira + * sb-mixi.el (shimbun-mixi-get-headers): Get headers of comments before parent's. diff --git a/mixi.el b/mixi.el index 8d52aa3..4659e1d 100644 --- a/mixi.el +++ b/mixi.el @@ -224,6 +224,7 @@ Increase this value when unexpected error frequently occurs." :type 'boolean :group 'mixi) +(defvar mixi-buffer-name " *mixi temp*") (defvar mixi-me nil) ;; Utilities. @@ -415,32 +416,34 @@ Increase this value when unexpected error frequently occurs." (mixi-retrieve "/logout.pl")) (defmacro with-mixi-retrieve (url &rest body) - `(when ,url - (with-temp-buffer + `(with-current-buffer (get-buffer-create mixi-buffer-name) + (when ,url + (erase-buffer) (insert (mixi-retrieve ,url)) (goto-char (point-min)) (when (search-forward "
" nil t) (mixi-login) (erase-buffer) - (insert (mixi-retrieve ,url)) - (goto-char (point-min))) - ,@body))) + (insert (mixi-retrieve ,url)))) + (goto-char (point-min)) + ,@body)) (put 'with-mixi-retrieve 'lisp-indent-function 'defun) (put 'with-mixi-retrieve 'edebug-form-spec '(body)) (defmacro with-mixi-post-form (url fields &rest body) - `(when ,url - (with-temp-buffer + `(with-current-buffer (get-buffer-create mixi-buffer-name) + (when ,url + (erase-buffer) (insert (mixi-post-form ,url ,fields)) (goto-char (point-min)) (when (search-forward "" nil t) (mixi-login) (erase-buffer) - (insert (mixi-post-form ,url ,fields)) - (goto-char (point-min))) - ,@body))) + (insert (mixi-post-form ,url ,fields)))) + (goto-char (point-min)) + ,@body)) (put 'with-mixi-post-form 'lisp-indent-function 'defun) (put 'with-mixi-post-form 'edebug-form-spec '(body)) @@ -450,7 +453,7 @@ Increase this value when unexpected error frequently occurs." ids) (catch 'end (while (or (null range) (< (length ids) range)) - (with-mixi-retrieve (format url page) + (with-mixi-retrieve (when url (format url page)) (let ((func (if reverse (progn (goto-char (point-max)) 're-search-backward) -- 1.7.10.4