* eww.el (eww-tag-select): Don't render totally empty <select> forms.
[gnus] / lisp / gravatar.el
index c17bd20..985ed2c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gravatar.el --- Get Gravatars
 
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2013 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: news
@@ -29,6 +29,7 @@
 
 (defgroup gravatar nil
   "Gravatar."
+  :version "24.1"
   :group 'comm)
 
 (defcustom gravatar-automatic-caching t
@@ -102,15 +103,23 @@ If no image available, return 'error."
        (gravatar-create-image data nil t)
       'error)))
 
+(autoload 'help-function-arglist "help-fns")
+
 ;;;###autoload
 (defun gravatar-retrieve (mail-address cb &optional cbargs)
   "Retrieve MAIL-ADDRESS gravatar and call CB on retrieval.
 You can provide a list of argument to pass to CB in CBARGS."
   (let ((url (gravatar-build-url mail-address)))
     (if (gravatar-cache-expired url)
-        (url-retrieve url
-                      'gravatar-retrieved
-                      (list cb (when cbargs cbargs)))
+       (let ((args (list url
+                         'gravatar-retrieved
+                         (list cb (when cbargs cbargs)))))
+         (when (> (length (if (featurep 'xemacs)
+                              (cdr (split-string (function-arglist 'url-retrieve)))
+                            (help-function-arglist 'url-retrieve)))
+                  4)
+           (setq args (nconc args (list t))))
+         (apply #'url-retrieve args))
       (apply cb
                (with-temp-buffer
                  (mm-disable-multibyte)
@@ -123,8 +132,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))