changeset 110670:bd7b628a1f67

gravatar.el (gravatar-create-image): New function.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 01 Oct 2010 05:50:11 +0000
parents 1ec34887255d
children 42798a7fad62
files lisp/gnus/ChangeLog lisp/gnus/gravatar.el
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Thu Sep 30 20:57:26 2010 -0700
+++ b/lisp/gnus/ChangeLog	Fri Oct 01 05:50:11 2010 +0000
@@ -1,3 +1,10 @@
+2010-10-01  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gravatar.el: Don't load image.el that XEmacs doesn't provide.
+	(gravatar-create-image): New function that's an alias to
+	gnus-xmas-create-image, gnus-create-image, or create-image.
+	(gravatar-data->image): Use it.
+
 2010-09-30  Teodor Zlatanov  <tzz@lifelogs.com>
 
 	* gnus-registry.el (gnus-registry-install-nnregistry): New function to
--- a/lisp/gnus/gravatar.el	Thu Sep 30 20:57:26 2010 -0700
+++ b/lisp/gnus/gravatar.el	Fri Oct 01 05:50:11 2010 +0000
@@ -24,7 +24,6 @@
 
 ;;; Code:
 
-(require 'image)
 (require 'url)
 (require 'url-cache)
 
@@ -84,12 +83,22 @@
     (when (search-forward "\n\n" nil t)
       (buffer-substring (point) (point-max)))))
 
+(eval-and-compile
+  (cond ((featurep 'xemacs)
+	 (require 'gnus-xmas)
+	 (defalias 'gravatar-create-image 'gnus-xmas-create-image))
+	((featurep 'gnus-ems)
+	 (defalias 'gravatar-create-image 'gnus-create-image))
+	(t
+	 (require 'image)
+	 (defalias 'gravatar-create-image 'create-image))))
+
 (defun gravatar-data->image ()
   "Get data of current buffer and return an image.
 If no image available, return 'error."
   (let ((data (gravatar-get-data)))
     (if data
-        (create-image data  nil t)
+	(gravatar-create-image data  nil t)
       'error)))
 
 ;;;###autoload