From: bg66 Date: Fri, 24 Nov 2006 04:19:19 +0000 (+0000) Subject: * mixi.el (mixi-retrieve): New macro. X-Git-Tag: cache-file-branchpoint X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4beda4edbfc77cf076b8e6ba7ca8ad73c802fbc;p=elisp%2Fmixi.git * mixi.el (mixi-retrieve): New macro. (mixi-retrieve-1): Use it. (mixi-login): Ditto. (mixi-logout): Ditto. (with-mixi-retrieve): Ditto. --- diff --git a/ChangeLog b/ChangeLog index cddf310..ede17ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-11-24 OHASHI Akira + + * mixi.el (mixi-retrieve): New macro. + (mixi-retrieve-1): Use it. + (mixi-login): Ditto. + (mixi-logout): Ditto. + (with-mixi-retrieve): Ditto. + 2006-11-23 OHASHI Akira * mixi.el (mixi-url-retrieve): Rename from `mixi-w3-retrieve'. diff --git a/mixi.el b/mixi.el index 3ca6c39..23e774a 100644 --- a/mixi.el +++ b/mixi.el @@ -213,18 +213,21 @@ Increase this value when unexpected error frequently occurs." ¼õ¤±¤é¤ì¤Þ¤·¤¿¤Î¤Ç¡¢°ì»þŪ¤ËÁàºî¤òÄä»ß¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£¿½¤·Ìõ¤´¤¶¤¤¤Þ
¤»¤ó¤¬¡¢¤·¤Ð¤é¤¯¤Î´Ö¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£") +(defmacro mixi-retrieve (url &optional post-data) + `(funcall mixi-retrieve-function ,url ,post-data)) + (defun mixi-retrieve-1 (buffer url &optional post-data) (when (string-match mixi-message-adult-contents buffer) (if mixi-accept-adult-contents - (setq buffer (funcall mixi-retrieve-function url "submit=agree")) - (setq buffer (funcall mixi-retrieve-function (concat url "?"))))) + (setq buffer (mixi-retrieve url "submit=agree")) + (setq buffer (mixi-retrieve (concat url "?"))))) (when (string-match mixi-warning-continuously-accessing buffer) (error (mixi-message "Continuously accessing"))) (if (not (string-match mixi-message-continuously-accessing buffer)) buffer (message (mixi-message "Waiting for continuously accessing...")) (sit-for mixi-continuously-access-interval) - (funcall mixi-retrieve-function url post-data))) + (mixi-retrieve url post-data))) (defmacro mixi-expand-url (url) `(if (string-match (concat "^" mixi-url) ,url) @@ -321,28 +324,28 @@ Increase this value when unexpected error frequently occurs." (read-from-minibuffer (mixi-message "Login Email: ")))) (password (or password mixi-default-password (read-passwd (mixi-message "Login Password: "))))) - (let ((buffer (funcall mixi-retrieve-function "/login.pl" - (concat "email=" email - "&password=" password - "&next_url=/home.pl" - "&sticky=on")))) + (let ((buffer (mixi-retrieve "/login.pl" + (concat "email=" email + "&password=" password + "&next_url=/home.pl" + "&sticky=on")))) (unless (string-match "url=/check\\.pl\\?n=" buffer) (error (mixi-message "Cannot login"))) - (setq buffer (funcall mixi-retrieve-function "/check.pl?n=home.pl")) + (setq buffer (mixi-retrieve "/check.pl?n=home.pl")) (if (string-match mixi-my-id-regexp buffer) (setq mixi-me (mixi-make-friend (match-string 1 buffer))) (error (mixi-message "Cannot login")))))) (defun mixi-logout () - (funcall mixi-retrieve-function "/logout.pl")) + (mixi-retrieve "/logout.pl")) (defmacro with-mixi-retrieve (url &rest body) `(let (buffer) (when ,url - (setq buffer (funcall mixi-retrieve-function ,url)) + (setq buffer (mixi-retrieve ,url)) (when (string-match "login.pl" buffer) (mixi-login) - (setq buffer (funcall mixi-retrieve-function ,url)))) + (setq buffer (mixi-retrieve ,url)))) ,@body)) (put 'with-mixi-retrieve 'lisp-indent-function 'defun) (put 'with-mixi-retrieve 'edebug-form-spec '(form body))