X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgravatar.el;h=ffbc37ae15887748346f35d7c2aa433a5434dc4d;hb=1c2ed0ce5abe2181e51f777171f8cd40a547e5a9;hp=cb857fca89bde6f8901ad1f0ba3559043bd1b8b5;hpb=4a3c4e96ab1e0f5f52d6814728b479ea987293df;p=gnus diff --git a/lisp/gravatar.el b/lisp/gravatar.el index cb857fca8..ffbc37ae1 100644 --- a/lisp/gravatar.el +++ b/lisp/gravatar.el @@ -1,6 +1,6 @@ ;;; gravatar.el --- Get Gravatars -;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 2010-2014 Free Software Foundation, Inc. ;; Author: Julien Danjou ;; Keywords: news @@ -29,22 +29,29 @@ (defgroup gravatar nil "Gravatar." + :version "24.1" :group 'comm) (defcustom gravatar-automatic-caching t - "Whether cache retrieved gravatar." + "Whether to cache retrieved gravatars." + :type 'boolean :group 'gravatar) +;; FIXME a time value is not the nicest format for a custom variable. (defcustom gravatar-cache-ttl (days-to-time 30) "Time to live for gravatar cache entries." + :type '(repeat integer) :group 'gravatar) +;; FIXME Doc is tautological. What are the options? (defcustom gravatar-rating "g" "Default rating for gravatar." + :type 'string :group 'gravatar) (defcustom gravatar-size 32 "Default size in pixels for gravatars." + :type 'integer :group 'gravatar) (defconst gravatar-base-url @@ -102,6 +109,8 @@ 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. @@ -130,7 +139,7 @@ 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) (with-current-buffer (url-retrieve-synchronously url) - (when gravatar-automatic-caching + (when gravatar-automatic-caching (url-store-in-cache (current-buffer))) (let ((data (gravatar-data->image))) (kill-buffer (current-buffer))