Mercurial > emacs
annotate lisp/gnus/gnus-gravatar.el @ 111452:457fd361982f
gnus-art.el (org-entities): Bind it.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Wed, 10 Nov 2010 01:25:17 +0000 |
parents | 8de1e4554e5e |
children | d94e03b64838 |
rev | line source |
---|---|
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
1 ;;; gnus-gravatar.el --- Gnus Gravatar support |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
2 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
3 ;; Copyright (C) 2010 Free Software Foundation, Inc. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
4 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
5 ;; Author: Julien Danjou <julien@danjou.info> |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
6 ;; Keywords: news |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
7 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
9 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
13 ;; (at your option) any later version. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
14 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
15 ;; GNU Emacs is distributed in the hope that it will be useful, |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
18 ;; GNU General Public License for more details. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
19 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
22 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
23 ;;; Commentary: |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
24 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
25 ;;; Code: |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
26 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
27 (require 'gravatar) |
110957
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
28 (require 'gnus-art) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
29 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
30 (defgroup gnus-gravatar nil |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
31 "Gnus Gravatar." |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
32 :group 'gnus-visual) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
33 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
34 (defcustom gnus-gravatar-size 32 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
35 "How big should gravatars be displayed." |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
36 :type 'integer |
110661
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
37 :version "24.1" |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
38 :group 'gnus-gravatar) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
39 |
110661
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
40 (defcustom gnus-gravatar-properties '(:ascent center :relief 1) |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
41 "List of image properties applied to Gravatar images." |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
42 :type 'list |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
43 :version "24.1" |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
44 :group 'gnus-gravatar) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
45 |
110957
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
46 (defcustom gnus-gravatar-too-ugly gnus-article-x-face-too-ugly |
110805
6bcb1cd1309b
[Gnus] Introduce gnus-gravatar-too-ugly.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110800
diff
changeset
|
47 "Regexp matching posters whose avatar shouldn't be shown automatically." |
6bcb1cd1309b
[Gnus] Introduce gnus-gravatar-too-ugly.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110800
diff
changeset
|
48 :type '(choice regexp (const nil)) |
6bcb1cd1309b
[Gnus] Introduce gnus-gravatar-too-ugly.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110800
diff
changeset
|
49 :version "24.1" |
6bcb1cd1309b
[Gnus] Introduce gnus-gravatar-too-ugly.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110800
diff
changeset
|
50 :group 'gnus-gravatar) |
6bcb1cd1309b
[Gnus] Introduce gnus-gravatar-too-ugly.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110800
diff
changeset
|
51 |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
52 (defun gnus-gravatar-transform-address (header category &optional force) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
53 (gnus-with-article-headers |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
54 (let ((addresses |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
55 (mail-header-parse-addresses |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
56 ;; mail-header-parse-addresses does not work (reliably) on |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
57 ;; decoded headers. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
58 (or |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
59 (ignore-errors |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
60 (mail-encode-encoded-word-string |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
61 (or (mail-fetch-field header) ""))) |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
62 (mail-fetch-field header)))) |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
63 (gravatar-size gnus-gravatar-size) |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
64 name) |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
65 (dolist (address addresses) |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
66 (when (or force |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
67 (not (and gnus-gravatar-too-ugly |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
68 (or (string-match gnus-gravatar-too-ugly |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
69 (car address)) |
111432
8de1e4554e5e
gnus-gravatar.el (gnus-gravatar-transform-address): No need to skip asterisks in From header.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110958
diff
changeset
|
70 (and (setq name (cdr address)) |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
71 (string-match gnus-gravatar-too-ugly |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
72 name)))))) |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
73 (ignore-errors |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
74 (gravatar-retrieve |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
75 (car address) |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
76 'gnus-gravatar-insert |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
77 (list header address category)))))))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
78 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
79 (defun gnus-gravatar-insert (gravatar header address category) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
80 "Insert GRAVATAR for ADDRESS in HEADER in current article buffer. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
81 Set image category to CATEGORY." |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
82 (unless (eq gravatar 'error) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
83 (gnus-with-article-headers |
110957
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
84 ;; The buffer can be gone at this time |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
85 (when (buffer-live-p (current-buffer)) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
86 (gnus-article-goto-header header) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
87 (mail-header-narrow-to-field) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
88 (let ((real-name (cdr address)) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
89 (mail-address (car address))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
90 (when (if real-name ; have a realname, go for it! |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
91 (and (search-forward real-name nil t) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
92 (search-backward real-name nil t)) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
93 (and (search-forward mail-address nil t) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
94 (search-backward mail-address nil t))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
95 (goto-char (1- (point))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
96 ;; If we're on the " quoting the name, go backward |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
97 (when (looking-at "[\"<]") |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
98 (goto-char (1- (point)))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
99 ;; Do not do anything if there's already a gravatar. This can |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
100 ;; happens if the buffer has been regenerated in the mean time, for |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
101 ;; example we were fetching someaddress, and then we change to |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
102 ;; another mail with the same someaddress. |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
103 (unless (memq 'gnus-gravatar (text-properties-at (point))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
104 (let ((inhibit-read-only t) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
105 (point (point))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
106 (unless (featurep 'xemacs) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
107 (setq gravatar (append gravatar gnus-gravatar-properties))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
108 (gnus-put-image gravatar nil category) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
109 (put-text-property point (point) 'gnus-gravatar address) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
110 (gnus-add-wash-type category) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
111 (gnus-add-image category gravatar))))))))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
112 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
113 ;;;###autoload |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
114 (defun gnus-treat-from-gravatar (&optional force) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
115 "Display gravatar in the From header. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
116 If gravatar is already displayed, remove it." |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
117 (interactive (list t)) ;; When type `W D g' |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
118 (gnus-with-article-buffer |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
119 (if (memq 'from-gravatar gnus-article-wash-types) |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
120 (gnus-delete-images 'from-gravatar) |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
121 (gnus-gravatar-transform-address "from" 'from-gravatar force)))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
122 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
123 ;;;###autoload |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
124 (defun gnus-treat-mail-gravatar (&optional force) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
125 "Display gravatars in the Cc and To headers. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
126 If gravatars are already displayed, remove them." |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
127 (interactive (list t)) ;; When type `W D h' |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
128 (gnus-with-article-buffer |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
129 (if (memq 'mail-gravatar gnus-article-wash-types) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
130 (gnus-delete-images 'mail-gravatar) |
110958
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
131 (gnus-gravatar-transform-address "cc" 'mail-gravatar force) |
ea91aa0b9743
gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars' position when (X-)Faces exist.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110957
diff
changeset
|
132 (gnus-gravatar-transform-address "to" 'mail-gravatar force)))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
133 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
134 (provide 'gnus-gravatar) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
135 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
136 ;;; gnus-gravatar.el ends here |