summaryrefslogtreecommitdiff
path: root/lisp/gnus/shr.el
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2010-10-28 12:45:51 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-10-28 12:45:51 +0000
commit4abff9048dc9462bf4beb06087d441bcfc19d8bc (patch)
tree11f8c15d0ff78d449e3b52f7c8006dd5e88896da /lisp/gnus/shr.el
parentcfe94935c8da4cf0650d6e5a0b3cce7b04279e52 (diff)
downloademacs-4abff9048dc9462bf4beb06087d441bcfc19d8bc.tar.gz
shr.el (shr-put-image): Use point even if only inserting text; save-excursion on alt text.
Diffstat (limited to 'lisp/gnus/shr.el')
-rw-r--r--lisp/gnus/shr.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 852f6cc826c..8bb532eb27e 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -373,12 +373,14 @@ redirects somewhere else."
(kill-buffer (current-buffer)))
(defun shr-put-image (data point alt)
- (if (not (display-graphic-p))
- (insert alt)
- (let ((image (ignore-errors
- (shr-rescale-image data))))
- (when image
- (put-image image point alt)))))
+ (if (display-graphic-p)
+ (let ((image (ignore-errors
+ (shr-rescale-image data))))
+ (when image
+ (put-image image point alt)))
+ (save-excursion
+ (goto-char point)
+ (insert alt))))
(defun shr-rescale-image (data)
(if (or (not (fboundp 'imagemagick-types))