Mercurial > emacs
annotate lisp/gnus/gnus-gravatar.el @ 111344:b775602e70c8
Cleanup fallout from redesigning mouse highlight.
dispextern.h (tty_draw_row_with_mouse_face): Add prototype.
xdisp.c (draw_row_with_mouse_face): Don't #ifdef away on MSDOS.
Call tty_draw_row_with_mouse_face on MSDOS as well.
msdos.c (tty_draw_row_with_mouse_face): Renamed from
draw_row_with_mouse_face. Make the argument list identical to the
GPM implementation.
msdos.h (Display_Info): Restore typedef.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 05 Nov 2010 12:03:17 +0200 |
parents | ea91aa0b9743 |
children | 8de1e4554e5e |
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 (and (setq name (cdr 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
|
67 (string-match "\\`\\*+ " name)) ;; (X-)Faces exist. |
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 (setcdr address (setq name (substring name (match-end 0))))) |
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 (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
|
70 (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
|
71 (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
|
72 (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
|
73 (and 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
|
74 (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
|
75 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
|
76 (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
|
77 (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
|
78 (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
|
79 '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
|
80 (list header address category)))))))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
81 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
82 (defun gnus-gravatar-insert (gravatar header address category) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
83 "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
|
84 Set image category to CATEGORY." |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
85 (unless (eq gravatar 'error) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
86 (gnus-with-article-headers |
110957
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
87 ;; The buffer can be gone at this time |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
88 (when (buffer-live-p (current-buffer)) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
89 (gnus-article-goto-header header) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
90 (mail-header-narrow-to-field) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
91 (let ((real-name (cdr address)) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
92 (mail-address (car address))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
93 (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
|
94 (and (search-forward real-name nil t) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
95 (search-backward real-name nil t)) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
96 (and (search-forward mail-address nil t) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
97 (search-backward mail-address nil t))) |
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 ;; 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))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
107 (let ((inhibit-read-only t) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
108 (point (point))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
109 (unless (featurep 'xemacs) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
110 (setq gravatar (append gravatar gnus-gravatar-properties))) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
111 (gnus-put-image gravatar nil category) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
112 (put-text-property point (point) 'gnus-gravatar address) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
113 (gnus-add-wash-type category) |
627742e646c4
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110873
diff
changeset
|
114 (gnus-add-image category gravatar))))))))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
115 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
116 ;;;###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
|
117 (defun gnus-treat-from-gravatar (&optional force) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
118 "Display gravatar in the From header. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
119 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
|
120 (interactive (list t)) ;; When type `W D g' |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
121 (gnus-with-article-buffer |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
122 (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
|
123 (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
|
124 (gnus-gravatar-transform-address "from" 'from-gravatar force)))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
125 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
126 ;;;###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
|
127 (defun gnus-treat-mail-gravatar (&optional force) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
128 "Display gravatars in the Cc and To headers. |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
129 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
|
130 (interactive (list t)) ;; When type `W D h' |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
131 (gnus-with-article-buffer |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
132 (if (memq 'mail-gravatar gnus-article-wash-types) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
133 (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
|
134 (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
|
135 (gnus-gravatar-transform-address "to" 'mail-gravatar force)))) |
110555
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
136 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
137 (provide 'gnus-gravatar) |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
138 |
e07971bb896c
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
diff
changeset
|
139 ;;; gnus-gravatar.el ends here |