Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: [XEmacs] Gravatar and gnus-article-html
Date: Thu, 07 Oct 2010 15:49:54 +0900	[thread overview]
Message-ID: <b4my6aa7azx.fsf@jpl.org> (raw)

Hi,

The following advices enable you to display Gravatars and external
images in html articles under XEmacs:

--8<---------------cut here---------------start------------->8---
(when (featurep 'xemacs)
  (defadvice url-retrieve (around make-it-work-like-modern-one
				  (url &optional callback cbargs)
				  activate)
    "Make it work like modern one."
    (if (functionp callback)
	(let* (-url-retrieve-is-modernized-p-
	       (retval (let (callback cbargs)
			 (save-excursion ad-do-it))))
	  (with-current-buffer (cdr retval)
	    (goto-char (point-min))
	    (apply callback nil cbargs))
	  (cdr retval))
      ad-do-it))

  (defadvice url-parse-mime-headers (before dont-delete-header
					    (&optional no-delete switch-buff)
					    activate)
    "Don't delete header if demanded.  Convert CRLF to LF in header."
    (when (boundp '-url-retrieve-is-modernized-p-)
      (setq no-delete t)
      (and switch-buff (set-buffer url-working-buffer))
      (goto-char (point-min))
      (when (search-forward "\r\n\r\n" nil t)
	(while (search-backward "\r\n" nil t)
	  (replace-match "\n")))))

  (defadvice url-cache-cachable-p (around cache-gravatars (obj) activate)
    "Enable caching of Gravatars."
    (if (and url-automatic-caching
	     (equal (url-host obj) "www.gravatar.com"))
	(setq ad-return-value t)
      ad-do-it)))
--8<---------------cut here---------------end--------------->8---

You have to use the most recent No Gnus.  I use:

(setq gnus-treat-from-gravatar 'head
      gnus-gravatar-size 48
      mm-text-html-renderer 'gnus-article-html
      url-automatic-caching t)

Why don't you add your face to http://www.gravatar.com , if you
haven't done yet? :-)



                 reply	other threads:[~2010-10-07  6:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4my6aa7azx.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).