From: bg66 Date: Mon, 8 Jan 2007 05:21:39 +0000 (+0000) Subject: * mixi.el (mixi-backend): Rename from `mixi-retrieve-function' and X-Git-Tag: mixi-el-1_0_0~128 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47031d4e61871ecb1fcff98bd81a164644958ec9;p=elisp%2Fmixi.git * mixi.el (mixi-backend): Rename from `mixi-retrieve-function' and change the default value to `w3m'. (mixi-retrieve): Follow the change above. (mixi-post-form): Ditto. (mixi-login): Ditto. --- diff --git a/ChangeLog b/ChangeLog index 23c14cb..1954e9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2007-01-08 OHASHI Akira + * mixi.el (mixi-backend): Rename from `mixi-retrieve-function' and + change the default value to `w3m'. + (mixi-retrieve): Follow the change above. + (mixi-post-form): Ditto. + (mixi-login): Ditto. + +2007-01-08 OHASHI Akira + * sb-mixi.el (shimbun-mixi-reply-to): New variable. (shimbun-reply-to): New method. (shimbun-mixi-make-reply-to): New function. diff --git a/mixi.el b/mixi.el index 1129b06..ba2612c 100644 --- a/mixi.el +++ b/mixi.el @@ -148,27 +148,27 @@ :type 'file :group 'mixi) -(defcustom mixi-retrieve-function +(defcustom mixi-backend (or (condition-case nil (progn - (require 'url) - (if (fboundp 'url-retrieve-synchronously) - 'mixi-url-retrieve)) + (require 'w3m) + 'w3m) (error)) (condition-case nil (progn - (require 'w3m) - 'mixi-w3m-retrieve) + (require 'url) + (if (fboundp 'url-retrieve-synchronously) + 'url)) (error)) (if (and (fboundp 'executable-find) (executable-find mixi-curl-program)) - 'mixi-curl-retrieve) - (error "Can't set `mixi-retrieve-function'")) + 'curl) + (error "Cannot set `mixi-backend'.")) "*The function for retrieving." - :type '(radio (const :tag "Using url" mixi-url-retrieve) - (const :tag "Using w3m" mixi-w3m-retrieve) - (const :tag "Using curl" mixi-curl-retrieve) - (function :format "Other function: %v\n" :size 0)) + :type '(radio (const :tag "Use w3m" w3m) + (const :tag "Use url.el" url) + (const :tag "Use curl" curl) + (symbol :tag "The other backend")) :group 'mixi) (defcustom mixi-default-email nil @@ -250,15 +250,12 @@ Increase this value when unexpected error frequently occurs." ¤»¤ó¤¬¡¢¤·¤Ð¤é¤¯¤Î´Ö¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£") (defmacro mixi-retrieve (url &optional post-data) - `(funcall mixi-retrieve-function ,url ,post-data)) + `(funcall (intern (concat "mixi-" (symbol-name mixi-backend) "-retrieve")) + ,url ,post-data)) -;; FIXME: Change `mixi-retrieve-function' to `mixi-backend'. (defmacro mixi-post-form (url fields) - `(let ((name (symbol-name mixi-retrieve-function))) - (when (string-match "-\\([a-z]+\\)-" name) - (let ((func (intern (concat "mixi-" (match-string 1 name) - "-post-form")))) - (funcall func ,url ,fields))))) + `(funcall (intern (concat "mixi-" (symbol-name mixi-backend) "-post-form")) + ,url ,post-data)) (defun mixi-parse-buffer (url buffer &optional post-data) (when (string-match mixi-message-adult-contents buffer) @@ -376,8 +373,7 @@ Increase this value when unexpected error frequently occurs." (defun mixi-login (&optional email password) "Login to mixi." - (when (and (eq mixi-retrieve-function 'mixi-w3m-retrieve) - (not w3m-use-cookies)) + (when (and (eq mixi-backend 'w3m) (not w3m-use-cookies)) (error (mixi-message "Require to accept cookies. Please set " "`w3m-use-cookies' to t."))) (let ((email (or email mixi-default-email