# HG changeset patch # User Katsumi Yamaoka # Date 1286454699 0 # Node ID 6bcb1cd1309bc1c5f896e22d55825ed6fdd19490 # Parent 30fed27e97bc19a66f14ff89874f4fbcd9539e54 [Gnus] Introduce gnus-gravatar-too-ugly. gnus-gravatar.el (gnus-gravatar-too-ugly): New user option. gnus-gravatar.el (gnus-gravatar-transform-address): Don't show avatars of people of which mail addresses match gnus-gravatar-too-ugly. gnus.texi (Gravatars): Document gnus-gravatar-too-ugly. diff -r 30fed27e97bc -r 6bcb1cd1309b doc/misc/ChangeLog --- a/doc/misc/ChangeLog Thu Oct 07 11:46:01 2010 +0000 +++ b/doc/misc/ChangeLog Thu Oct 07 12:31:39 2010 +0000 @@ -1,3 +1,7 @@ +2010-10-07 Katsumi Yamaoka + + * gnus.texi (Gravatars): Document gnus-gravatar-too-ugly. + 2010-10-06 Julien Danjou * sieve.texi (Manage Sieve API): Document sieve-manage-authenticate. diff -r 30fed27e97bc -r 6bcb1cd1309b doc/misc/gnus.texi --- a/doc/misc/gnus.texi Thu Oct 07 11:46:01 2010 +0000 +++ b/doc/misc/gnus.texi Thu Oct 07 12:31:39 2010 +0000 @@ -827,6 +827,7 @@ * Smileys:: Show all those happy faces the way they were meant to be shown. * Picons:: How to display pictures of what you're reading. +* Gravatars:: Display the avatar of people you read. * XVarious:: Other XEmacsy Gnusey variables. Thwarting Email Spam @@ -23195,6 +23196,12 @@ @vindex gnus-gravatar-properties List of image properties applied to Gravatar images. +@item gnus-gravatar-too-ugly +@vindex gnus-gravatar-too-ugly +Regexp that matches mail addresses or names of people of which avatars +should not be displayed, or @code{nil}. It default to the value of +@code{gnus-article-x-face-too-ugly} (@pxref{X-Face}). + @end table If you want to see them in the From field, set: diff -r 30fed27e97bc -r 6bcb1cd1309b lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Thu Oct 07 11:46:01 2010 +0000 +++ b/lisp/gnus/ChangeLog Thu Oct 07 12:31:39 2010 +0000 @@ -1,3 +1,9 @@ +2010-10-07 Katsumi Yamaoka + + * gnus-gravatar.el (gnus-gravatar-too-ugly): New user option. + (gnus-gravatar-transform-address): Don't show avatars of people of + which mail addresses match gnus-gravatar-too-ugly. + 2010-10-07 Lars Magne Ingebrigtsen * shr.el (shr-table-widths): Expand TD elements to fill available diff -r 30fed27e97bc -r 6bcb1cd1309b lisp/gnus/gnus-gravatar.el --- a/lisp/gnus/gnus-gravatar.el Thu Oct 07 11:46:01 2010 +0000 +++ b/lisp/gnus/gnus-gravatar.el Thu Oct 07 12:31:39 2010 +0000 @@ -42,6 +42,13 @@ :version "24.1" :group 'gnus-gravatar) +(defcustom gnus-gravatar-too-ugly (if (boundp 'gnus-article-x-face-too-ugly) + gnus-article-x-face-too-ugly) + "Regexp matching posters whose avatar shouldn't be shown automatically." + :type '(choice regexp (const nil)) + :version "24.1" + :group 'gnus-gravatar) + (defun gnus-gravatar-transform-address (header category) (gnus-with-article-headers (let ((addresses @@ -55,10 +62,16 @@ (mail-fetch-field header))))) (let ((gravatar-size gnus-gravatar-size)) (dolist (address addresses) - (gravatar-retrieve - (car address) - 'gnus-gravatar-insert - (list header address category))))))) + (unless (and gnus-gravatar-too-ugly + (or (string-match gnus-gravatar-too-ugly + (car address)) + (and (cdr address) + (string-match gnus-gravatar-too-ugly + (cdr address))))) + (gravatar-retrieve + (car address) + 'gnus-gravatar-insert + (list header address category)))))))) (defun gnus-gravatar-insert (gravatar header address category) "Insert GRAVATAR for ADDRESS in HEADER in current article buffer.