From: ueno Date: Wed, 25 Oct 2006 09:15:26 +0000 (+0000) Subject: (mixi-retrieve-function): Try to select X-Git-Tag: cache-file-branchpoint~30 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bf4975e6cd4e2a637aff74b8c77b080e6a74fb3;p=elisp%2Fmixi.git (mixi-retrieve-function): Try to select mixi-retrieve-function automatically. --- diff --git a/ChangeLog b/ChangeLog index 8a22c44..d9d1f21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-10-25 Daiki Ueno + + * mixi.el (mixi-retrieve-function): Try to select + mixi-retrieve-function automatically. + 2006-10-25 OHASHI Akira * mixi.el (mixi-cache-expires): Add new constant. diff --git a/mixi.el b/mixi.el index 81a24ad..4c40727 100644 --- a/mixi.el +++ b/mixi.el @@ -99,14 +99,6 @@ ;;; Code: -(condition-case nil - (require 'url) - (error)) - -(condition-case nil - (require 'w3m) - (error)) - (eval-when-compile (require 'cl)) (defgroup mixi nil @@ -124,8 +116,21 @@ :group 'mixi) (defcustom mixi-retrieve-function - (if (fboundp 'url-retrieve-synchronously) - 'mixi-w3-retrieve 'mixi-w3m-retrieve) + (or (condition-case nil + (progn + (require 'url) + (if (fboundp 'url-retrieve-synchronously) + 'mixi-w3-retrieve)) + (error)) + (condition-case nil + (progn + (require 'w3m) + 'mixi-w3m-retrieve) + (error)) + (if (and (fboundp 'executable-find) + (executable-find mixi-curl-program)) + 'mixi-curl-retrieve) + (error "Can't set `mixi-retrieve-function'")) "*The function for retrieving." :type '(radio (const :tag "Using w3" mixi-w3-retrieve) (const :tag "Using w3m" mixi-w3m-retrieve)