diff options
| author | Julien Danjou | 2010-09-28 11:47:12 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-09-28 11:47:12 +0000 |
| commit | b6fda8fc58840bab97ef1cb0fce3c26908edb815 (patch) | |
| tree | 817d7bfc740e73c02cc21190fce52505a278cbd7 | |
| parent | 635be05ac8ee64653a22198e102e4eb65ab23243 (diff) | |
| download | emacs-b6fda8fc58840bab97ef1cb0fce3c26908edb815.tar.gz emacs-b6fda8fc58840bab97ef1cb0fce3c26908edb815.zip | |
Merge changes made in Gnus trunk.
gnus-gravatar.el (gnus-gravatar-insert): Fix search backward.
gnus-gravatar.el (gnus-gravatar-insert): Fix search in case mail-address contains the same string as real-name.
gnus-gravatar.el (gnus-gravatar-insert): More robust search.
gnus-ems.el (gnus-put-image): Revert Lars, change and insert non-blank in header, otherwise it'll get stripped.
| -rw-r--r-- | lisp/gnus/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/gnus/gnus-ems.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/gnus-gravatar.el | 45 |
3 files changed, 38 insertions, 20 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 95cb6792889..830f481e8f7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2010-09-28 Julien Danjou <julien@danjou.info> | ||
| 2 | |||
| 3 | * gnus-gravatar.el (gnus-gravatar-insert): Fix search in case | ||
| 4 | mail-address contains the same string as real-name. | ||
| 5 | |||
| 6 | * gnus-ems.el (gnus-put-image): Revert Lars, change and insert | ||
| 7 | non-blank in header, otherwise it'll get stripped. | ||
| 8 | |||
| 9 | * gnus-gravatar.el (gnus-gravatar-insert): Search backward for | ||
| 10 | real-name, and then for mail address rather than doing : or , search. | ||
| 11 | |||
| 1 | 2010-09-28 Katsumi Yamaoka <yamaoka@jpl.org> | 12 | 2010-09-28 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 13 | ||
| 3 | * nnimap.el (auth-source-forget-user-or-password) | 14 | * nnimap.el (auth-source-forget-user-or-password) |
diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el index 7b3f3d8a80e..b4a2fe960c6 100644 --- a/lisp/gnus/gnus-ems.el +++ b/lisp/gnus/gnus-ems.el | |||
| @@ -277,7 +277,7 @@ | |||
| 277 | 277 | ||
| 278 | (defun gnus-put-image (glyph &optional string category) | 278 | (defun gnus-put-image (glyph &optional string category) |
| 279 | (let ((point (point))) | 279 | (let ((point (point))) |
| 280 | (insert-image glyph (or string " ")) | 280 | (insert-image glyph (or string "*")) |
| 281 | (put-text-property point (point) 'gnus-image-category category) | 281 | (put-text-property point (point) 'gnus-image-category category) |
| 282 | (unless string | 282 | (unless string |
| 283 | (put-text-property (1- (point)) (point) | 283 | (put-text-property (1- (point)) (point) |
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el index 54679f43ff3..14e224051bb 100644 --- a/lisp/gnus/gnus-gravatar.el +++ b/lisp/gnus/gnus-gravatar.el | |||
| @@ -59,7 +59,7 @@ unpressed button." | |||
| 59 | (gravatar-retrieve | 59 | (gravatar-retrieve |
| 60 | (car address) | 60 | (car address) |
| 61 | 'gnus-gravatar-insert | 61 | 'gnus-gravatar-insert |
| 62 | (list header (car address) category))))))) | 62 | (list header address category))))))) |
| 63 | 63 | ||
| 64 | (defun gnus-gravatar-insert (gravatar header address category) | 64 | (defun gnus-gravatar-insert (gravatar header address category) |
| 65 | "Insert GRAVATAR for ADDRESS in HEADER in current article buffer. | 65 | "Insert GRAVATAR for ADDRESS in HEADER in current article buffer. |
| @@ -68,24 +68,31 @@ Set image category to CATEGORY." | |||
| 68 | (gnus-with-article-headers | 68 | (gnus-with-article-headers |
| 69 | (gnus-article-goto-header header) | 69 | (gnus-article-goto-header header) |
| 70 | (mail-header-narrow-to-field) | 70 | (mail-header-narrow-to-field) |
| 71 | (when (and (search-forward address nil t) | 71 | (let ((real-name (cdr address)) |
| 72 | (or (search-backward ", " nil t) | 72 | (mail-address (car address))) |
| 73 | (search-backward ": " nil t))) | 73 | (when (if real-name ; have a realname, go for it! |
| 74 | (goto-char (1+ (point))) | 74 | (and (search-forward real-name nil t) |
| 75 | ;; Do not do anything if there's already a gravatar. This can | 75 | (search-backward real-name nil t)) |
| 76 | ;; happens if the buffer has been regenerated in the mean time, for | 76 | (and (search-forward mail-address nil t) |
| 77 | ;; example we were fetching someaddress, and then we change to | 77 | (search-backward mail-address nil t))) |
| 78 | ;; another mail with the same someaddress. | 78 | (goto-char (1- (point))) |
| 79 | (unless (memq 'gnus-gravatar (text-properties-at (point))) | 79 | ;; If we're on the " quoting the name, go backward |
| 80 | (let ((inhibit-read-only t) | 80 | (when (looking-at "\"") |
| 81 | (point (point)) | 81 | (goto-char (1- (point)))) |
| 82 | (gravatar (append | 82 | ;; Do not do anything if there's already a gravatar. This can |
| 83 | gravatar | 83 | ;; happens if the buffer has been regenerated in the mean time, for |
| 84 | `(:ascent center :relief ,gnus-gravatar-relief)))) | 84 | ;; example we were fetching someaddress, and then we change to |
| 85 | (gnus-put-image gravatar nil category) | 85 | ;; another mail with the same someaddress. |
| 86 | (put-text-property point (point) 'gnus-gravatar address) | 86 | (unless (memq 'gnus-gravatar (text-properties-at (point))) |
| 87 | (gnus-add-wash-type category) | 87 | (let ((inhibit-read-only t) |
| 88 | (gnus-add-image category gravatar))))))) | 88 | (point (point)) |
| 89 | (gravatar (append | ||
| 90 | gravatar | ||
| 91 | `(:ascent center :relief ,gnus-gravatar-relief)))) | ||
| 92 | (gnus-put-image gravatar nil category) | ||
| 93 | (put-text-property point (point) 'gnus-gravatar address) | ||
| 94 | (gnus-add-wash-type category) | ||
| 95 | (gnus-add-image category gravatar)))))))) | ||
| 89 | 96 | ||
| 90 | ;;;###autoload | 97 | ;;;###autoload |
| 91 | (defun gnus-treat-from-gravatar () | 98 | (defun gnus-treat-from-gravatar () |