From 426b997612c057fd38de201db7ea03e46e8f1c5f Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 17 Mar 2011 19:53:07 +0100 Subject: [PATCH] Use `url-retrieve' on XEmacs, since it doesn't have url-retrieve-synchronously. --- lisp/ChangeLog | 5 +++++ lisp/dgnushack.el | 2 ++ lisp/gravatar.el | 6 ++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a3e0f6dda..43f371925 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2011-03-17 Lars Magne Ingebrigtsen + * dgnushack.el: Define url-retrieve-synchronously unless not defined. + + * gravatar.el (gravatar-retrieve-synchronously): Use `url-retrieve' on + XEmacs, since it doesn't have url-retrieve-synchronously. + * time-date.el (format-seconds): Use assoc instead of assoc-string, since assoc-string doesn't exist in XEmacs. diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index d5f8d01cc..9fa42d34f 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -137,6 +137,8 @@ (autoload 'iswitchb-read-buffer "iswitchb") (autoload 'netrc-credentials "netrc") (defalias 'x-defined-colors 'ignore) + (unless (fboundp 'url-retrieve-synchronously) + (defalias 'url-retrieve-synchronously 'url-retrieve)) (defalias 'read-color 'ignore))) (eval-and-compile diff --git a/lisp/gravatar.el b/lisp/gravatar.el index 0c97080d8..4b0c9a162 100644 --- a/lisp/gravatar.el +++ b/lisp/gravatar.el @@ -129,8 +129,10 @@ You can provide a list of argument to pass to CB in CBARGS." "Retrieve MAIL-ADDRESS gravatar and returns it." (let ((url (gravatar-build-url mail-address))) (if (gravatar-cache-expired url) - (with-current-buffer (url-retrieve-synchronously url) - (when gravatar-automatic-caching + (with-current-buffer (if (featurep 'xemacs) + (url-retrieve url) + (url-retrieve-synchronously url)) + (when gravatar-automatic-caching (url-store-in-cache (current-buffer))) (let ((data (gravatar-data->image))) (kill-buffer (current-buffer)) -- 2.25.1