(mixi-retrieve-function): Try to select
authorueno <ueno>
Wed, 25 Oct 2006 09:15:26 +0000 (09:15 +0000)
committerueno <ueno>
Wed, 25 Oct 2006 09:15:26 +0000 (09:15 +0000)
mixi-retrieve-function automatically.

ChangeLog
mixi.el

index 8a22c44..d9d1f21 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-25  Daiki Ueno  <ueno@unixuser.org>
+
+       * mixi.el (mixi-retrieve-function): Try to select
+       mixi-retrieve-function automatically.
+
 2006-10-25  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi.el (mixi-cache-expires): Add new constant.
diff --git a/mixi.el b/mixi.el
index 81a24ad..4c40727 100644 (file)
--- a/mixi.el
+++ b/mixi.el
 
 ;;; Code:
 
-(condition-case nil
-    (require 'url)
-  (error))
-
-(condition-case nil
-    (require 'w3m)
-  (error))
-
 (eval-when-compile (require 'cl))
 
 (defgroup mixi nil
   :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)