[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/with-url b6d6172 7/8: Don't move point around when
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] scratch/with-url b6d6172 7/8: Don't move point around when inserting images |
Date: |
Sun, 22 Jan 2017 22:25:23 +0000 (UTC) |
branch: scratch/with-url
commit b6d617224b2f1e5226e0c9411a58782b2b8f9b97
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Don't move point around when inserting images
---
lisp/net/shr.el | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 8581033..902186f 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -39,6 +39,7 @@
(require 'svg)
(require 'image)
(require 'with-url)
+(require 'mail-parse)
(defgroup shr nil
"Simple HTML Renderer"
@@ -932,17 +933,18 @@ If EXTERNAL, browse the URL using `shr-external-browser'."
(or (url-header 'content-type) "text/plain")))
obarray))))
(with-current-buffer buffer
- (let ((alt (buffer-substring start end))
- (properties (text-properties-at start))
- (inhibit-read-only t))
- (delete-region start end)
- (goto-char start)
- (funcall shr-put-image-function data alt flags)
- (while properties
- (let ((type (pop properties))
- (value (pop properties)))
- (unless (memq type '(display image-size))
- (put-text-property start (point) type value)))))))))
+ (save-excursion
+ (let ((alt (buffer-substring start end))
+ (properties (text-properties-at start))
+ (inhibit-read-only t))
+ (delete-region start end)
+ (goto-char start)
+ (funcall shr-put-image-function data alt flags)
+ (while properties
+ (let ((type (pop properties))
+ (value (pop properties)))
+ (unless (memq type '(display image-size))
+ (put-text-property start (point) type value))))))))))
(defun shr-image-from-data (data)
"Return an image from the data: URI content DATA."
- [Emacs-diffs] scratch/with-url updated (3322f8f -> 03b56ca), Lars Ingebrigtsen, 2017/01/22
- [Emacs-diffs] scratch/with-url f402e35 3/8: Heed the Cache-Control header, Lars Ingebrigtsen, 2017/01/22
- [Emacs-diffs] scratch/with-url 3733456 2/8: Adapt to the new cache, Lars Ingebrigtsen, 2017/01/22
- [Emacs-diffs] scratch/with-url 1c59f8a 6/8: Get chunked decoding right, Lars Ingebrigtsen, 2017/01/22
- [Emacs-diffs] scratch/with-url 4fb09fd 4/8: Build fix, Lars Ingebrigtsen, 2017/01/22
- [Emacs-diffs] scratch/with-url bc505fd 1/8: Fix up some :wait issues, Lars Ingebrigtsen, 2017/01/22
- [Emacs-diffs] scratch/with-url b6d6172 7/8: Don't move point around when inserting images,
Lars Ingebrigtsen <=
- [Emacs-diffs] scratch/with-url 2415aae 5/8: Make reloading work again., Lars Ingebrigtsen, 2017/01/22
- [Emacs-diffs] scratch/with-url 03b56ca 8/8: Respect the buffer parameter, Lars Ingebrigtsen, 2017/01/22