From: Julien Danjou Date: Thu, 28 Oct 2010 12:45:51 +0000 (+0000) Subject: shr.el (shr-put-image): Use point even if only inserting text; save-excursion on... X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~370^2~19 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4abff9048dc9462bf4beb06087d441bcfc19d8bc;p=emacs.git shr.el (shr-put-image): Use point even if only inserting text; save-excursion on alt text. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 1e57106a2be..85d00c6607a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,9 @@ 2010-10-28 Julien Danjou + * shr.el (shr-put-image): Use point even if only inserting text. + (shr-put-image): Save excursion when inserting alt text on non-graphic + display, so the behaviour is the same when we are on a graphic display. + * nnir.el (nnir-run-swish-e): Remove hyrex support. 2010-10-28 Katsumi Yamaoka 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))