[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] shr-fontified f3dc41b 5/6: Use a single `with-window-excur
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] shr-fontified f3dc41b 5/6: Use a single `with-window-excursion' instead of two |
Date: |
Sun, 08 Feb 2015 05:06:26 +0000 |
branch: shr-fontified
commit f3dc41b4e87d70efe878a978892a19ab76413bc7
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>
Use a single `with-window-excursion' instead of two
---
lisp/net/shr.el | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index dada6b0..89247f5 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1889,16 +1889,18 @@ The preference is a float determined from
`shr-prefer-media-type'."
(let ((shr-internal-width width)
(shr-indentation 0))
(shr-descend dom))
- (unless fill
- (setq natural-width
- (or (dom-attr dom 'shr-td-cache-natural)
- (let ((natural (max (shr-pixel-buffer-width)
- (shr-dom-max-natural-width dom 0))))
- (dom-set-attribute dom 'shr-td-cache-natural natural)
- natural))))
- (let ((shr-internal-width width))
- (shr-fold-lines (point-min) (point-max))
- (setq max-width (shr-pixel-buffer-width)))
+ (save-window-excursion
+ (set-window-buffer nil (current-buffer))
+ (unless fill
+ (setq natural-width
+ (or (dom-attr dom 'shr-td-cache-natural)
+ (let ((natural (max (shr-pixel-buffer-width)
+ (shr-dom-max-natural-width dom 0))))
+ (dom-set-attribute dom 'shr-td-cache-natural natural)
+ natural))))
+ (let ((shr-internal-width width))
+ (shr-fold-lines (point-min) (point-max))
+ (setq max-width (shr-pixel-buffer-width))))
(goto-char (point-max))
;; Delete padding at the bottom of the TDs.
(delete-region
- [Emacs-diffs] shr-fontified updated (bf7aeb3 -> 70199c1), Lars Ingebrigtsen, 2015/02/08
- [Emacs-diffs] shr-fontified 1a2c4b6 1/6: * lisp/net/eww.el (eww-toggle-fonts): New command., Lars Ingebrigtsen, 2015/02/08
- [Emacs-diffs] shr-fontified 6a63431 4/6: Compute the natural widths of nested layouts better, Lars Ingebrigtsen, 2015/02/08
- [Emacs-diffs] shr-fontified 5a8ef7f 2/6: Get line breaking again in complex layouts, Lars Ingebrigtsen, 2015/02/08
- [Emacs-diffs] shr-fontified a5890e6 3/6: Revert previous change since that didn't really work, Lars Ingebrigtsen, 2015/02/08
- [Emacs-diffs] shr-fontified f3dc41b 5/6: Use a single `with-window-excursion' instead of two,
Lars Ingebrigtsen <=
- [Emacs-diffs] shr-fontified 70199c1 6/6: Further <td> speedups, Lars Ingebrigtsen, 2015/02/08