]> code.delx.au - gnu-emacs/commitdiff
shr.el (shr-put-image): Use point even if only inserting text; save-excursion on...
authorJulien Danjou <julien@danjou.info>
Thu, 28 Oct 2010 12:45:51 +0000 (12:45 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 28 Oct 2010 12:45:51 +0000 (12:45 +0000)
lisp/gnus/ChangeLog
lisp/gnus/shr.el

index 1e57106a2be07b3f2d1abf0f98c255981dca75cd..85d00c6607acf4135f66c2ec95444cba9b0100e5 100644 (file)
@@ -1,5 +1,9 @@
 2010-10-28  Julien Danjou  <julien@danjou.info>
 
+       * 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  <yamaoka@jpl.org>
index 852f6cc826c83a2a533bad72d3f817e8a2a29f8e..8bb532eb27edacaa86705579c302c30e4c1e8780 100644 (file)
@@ -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))