changeset 111639:d94e03b64838

gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again. (gnus-gravatar-insert): Put avatar always in the beginning of the field.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sat, 20 Nov 2010 01:18:17 +0000
parents b823e94ac814
children 8bd4a845ba2a
files lisp/gnus/ChangeLog lisp/gnus/gnus-gravatar.el
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Fri Nov 19 18:34:22 2010 +0200
+++ b/lisp/gnus/ChangeLog	Sat Nov 20 01:18:17 2010 +0000
@@ -1,3 +1,8 @@
+2010-11-20  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again.
+	(gnus-gravatar-insert): Put avatar always in the beginning of the field.
+
 2010-11-19  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-art.el (gnus-mime-display-single)
--- a/lisp/gnus/gnus-gravatar.el	Fri Nov 19 18:34:22 2010 +0200
+++ b/lisp/gnus/gnus-gravatar.el	Sat Nov 20 01:18:17 2010 +0000
@@ -63,11 +63,13 @@
 	  (gravatar-size gnus-gravatar-size)
 	  name)
       (dolist (address addresses)
+	(when (setq name (cdr address))
+	  (setcdr address (setq name (mail-decode-encoded-word-string name))))
 	(when (or force
 		  (not (and gnus-gravatar-too-ugly
 			    (or (string-match gnus-gravatar-too-ugly
 					      (car address))
-				(and (setq name (cdr address))
+				(and name
 				     (string-match gnus-gravatar-too-ugly
 						   name))))))
 	  (ignore-errors
@@ -87,12 +89,12 @@
         (mail-header-narrow-to-field)
         (let ((real-name (cdr address))
               (mail-address (car address)))
-          (when (if real-name             ; have a realname, go for it!
-                    (and (search-forward real-name nil t)
-                         (search-backward real-name nil t))
-                  (and (search-forward mail-address nil t)
-                       (search-backward mail-address nil t)))
-            (goto-char (1- (point)))
+          (when (if real-name
+		    (re-search-forward (concat (regexp-quote real-name) "\\|"
+					       (regexp-quote mail-address))
+				       nil t)
+		  (search-forward mail-address nil t))
+	    (goto-char (1- (match-beginning 0)))
             ;; If we're on the " quoting the name, go backward
             (when (looking-at "[\"<]")
               (goto-char (1- (point))))