* mixi.el (mixi-buffer-name): New variable.
authorbg66 <bg66>
Thu, 18 Jan 2007 10:47:16 +0000 (10:47 +0000)
committerbg66 <bg66>
Thu, 18 Jan 2007 10:47:16 +0000 (10:47 +0000)
(with-mixi-buffer): New macro.
(with-mixi-retrieve): Use them.
(with-mixi-post-form): Ditto.
(mixi-get-matched-items): Follow the change above.

ChangeLog
mixi.el

index fad19f2..4625bc4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-01-18  OHASHI Akira  <bg66@koka-in.org>
 
+       * 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  <bg66@koka-in.org>
+
        * 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 (file)
--- 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
              "<form action=\"login.pl\" method=\"post\">" 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
              "<form action=\"login.pl\" method=\"post\">" 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)