From 4b36c6d4debd2fe02b6ce77e5e90c78655b6f37f Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Fri, 1 Oct 2010 05:50:11 +0000 Subject: [PATCH] gravatar.el (gravatar-create-image): New function. --- lisp/gnus/ChangeLog | 7 +++++++ lisp/gnus/gravatar.el | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5477fa7cd0f..9c5653cadb9 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,10 @@ +2010-10-01 Katsumi Yamaoka + + * 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 * gnus-registry.el (gnus-registry-install-nnregistry): New function to diff --git a/lisp/gnus/gravatar.el b/lisp/gnus/gravatar.el index ec03b1b8a00..d4dfb763167 100644 --- a/lisp/gnus/gravatar.el +++ b/lisp/gnus/gravatar.el @@ -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 -- 2.39.5