From 9bf4975e6cd4e2a637aff74b8c77b080e6a74fb3 Mon Sep 17 00:00:00 2001 From: ueno Date: Wed, 25 Oct 2006 09:15:26 +0000 Subject: [PATCH] (mixi-retrieve-function): Try to select mixi-retrieve-function automatically. --- ChangeLog | 5 +++++ mixi.el | 25 +++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) 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) -- 1.7.10.4