From: bg66 Date: Thu, 18 Jan 2007 10:47:16 +0000 (+0000) Subject: * mixi.el (mixi-buffer-name): New variable. X-Git-Tag: mixi-el-1_0_0~94 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=aa7d17ae33c84f525ea9bb44d344d77899929f65;p=elisp%2Fmixi.git * 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. --- 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)