Mercurial > emacs
annotate lisp/gnus/gnus-gravatar.el @ 112445:93fcbcb698b0
Improve configuration of makeinfo.
* Makefile.in (MAKEINFO): Now controlled by `configure'.
(MAKEINFO_OPTS): New variable. Use it where appropriate.
(ENVADD): Updated.
author | Werner Lemberg <wl@gnu.org> |
---|---|
date | Sun, 23 Jan 2011 11:38:14 +0100 |
parents | b1eac6d41a93 |
children | 98ad7c9e56a3 |
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 |
112235
b1eac6d41a93
[Gnus] Update copyright years.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
112014
diff
changeset
|
3 ;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. |
110555
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) |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
29 (require 'mail-extr) ;; Because of binding `mail-extr-disable-voodoo'. |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
30 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
31 (defgroup gnus-gravatar nil |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
32 "Gnus Gravatar." |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
33 :group 'gnus-visual) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
34 |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
35 (defcustom gnus-gravatar-size nil |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
36 "How big should gravatars be displayed. |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
37 If nil, default to `gravatar-size'." |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
38 :type 'integer |
110661
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
39 :version "24.1" |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
40 :group 'gnus-gravatar) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
41 |
110661
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
42 (defcustom gnus-gravatar-properties '(:ascent center :relief 1) |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
43 "List of image properties applied to Gravatar images." |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
44 :type 'list |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110634
diff
changeset
|
45 :version "24.1" |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
46 :group 'gnus-gravatar) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
47 |
110957
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
48 (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
|
49 "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
|
50 :type '(choice regexp (const nil)) |
6bcb1cd1309b
[Gnus] Introduce gnus-gravatar-too-ugly.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110800
diff
changeset
|
51 :version "24.1" |
6bcb1cd1309b
[Gnus] Introduce gnus-gravatar-too-ugly.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110800
diff
changeset
|
52 :group 'gnus-gravatar) |
6bcb1cd1309b
[Gnus] Introduce gnus-gravatar-too-ugly.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110800
diff
changeset
|
53 |
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
|
54 (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
|
55 (gnus-with-article-headers |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
56 (let* ((mail-extr-disable-voodoo t) |
112014
df9847719afa
gnus-gravatar.el (gnus-gravatar-transform-address): Set `mail-extr-ignore-realname-equals-mailbox-name' to nil when extracting the addresses, otherwise we might misplaced the gravatar.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111994
diff
changeset
|
57 (mail-extr-ignore-realname-equals-mailbox-name nil) |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
58 (addresses (mail-extract-address-components |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
59 (or (mail-fetch-field header) "") t)) |
111994
c92e0a5c96e9
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111872
diff
changeset
|
60 (gravatar-size (or gnus-gravatar-size gravatar-size)) |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
61 name) |
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 (dolist (address addresses) |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
63 (when (and (setq name (car address)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
64 (string-match "\\` +" name)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
65 (setcar address (setq name (substring name (match-end 0))))) |
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
|
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 |
111872
a264bb877bc7
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111789
diff
changeset
|
69 (or (cadr address) "")) |
111639
d94e03b64838
gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111432
diff
changeset
|
70 (and name |
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 |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
75 (cadr 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
|
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) |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
88 (let ((real-name (car address)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
89 (mail-address (cadr address))) |
111639
d94e03b64838
gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111432
diff
changeset
|
90 (when (if real-name |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
91 (re-search-forward |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
92 (concat (gnus-replace-in-string |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
93 (regexp-quote real-name) "[\t ]+" "[\t\n ]+") |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
94 "\\|" |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
95 (regexp-quote mail-address)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
96 nil t) |
111639
d94e03b64838
gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111432
diff
changeset
|
97 (search-forward mail-address nil t)) |
d94e03b64838
gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111432
diff
changeset
|
98 (goto-char (1- (match-beginning 0))) |
110957
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
99 ;; 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
|
100 (when (looking-at "[\"<]") |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
101 (goto-char (1- (point)))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
102 ;; 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
|
103 ;; 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
|
104 ;; 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
|
105 ;; another mail with the same someaddress. |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
106 (unless (memq 'gnus-gravatar (text-properties-at (point))) |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111639
diff
changeset
|
107 (let ((point (point))) |
110957
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
108 (unless (featurep 'xemacs) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
109 (setq gravatar (append gravatar gnus-gravatar-properties))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
110 (gnus-put-image gravatar nil category) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
111 (put-text-property point (point) 'gnus-gravatar address) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
112 (gnus-add-wash-type category) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
113 (gnus-add-image category gravatar))))))))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
114 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
115 ;;;###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
|
116 (defun gnus-treat-from-gravatar (&optional force) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
117 "Display gravatar in the From header. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
118 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
|
119 (interactive (list t)) ;; When type `W D g' |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
120 (gnus-with-article-buffer |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
121 (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
|
122 (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
|
123 (gnus-gravatar-transform-address "from" 'from-gravatar force)))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
124 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
125 ;;;###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
|
126 (defun gnus-treat-mail-gravatar (&optional force) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
127 "Display gravatars in the Cc and To headers. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
128 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
|
129 (interactive (list t)) ;; When type `W D h' |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
130 (gnus-with-article-buffer |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
131 (if (memq 'mail-gravatar gnus-article-wash-types) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
132 (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
|
133 (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
|
134 (gnus-gravatar-transform-address "to" 'mail-gravatar force)))) |
110555
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 (provide 'gnus-gravatar) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
137 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
138 ;;; gnus-gravatar.el ends here |