Avoid reordering of output in 'shr-insert-document'
* lisp/net/shr.el (shr-string-pixel-width): Preserve point across shr-pixel-column invocations. (Bug#29734)
This commit is contained in:
parent
7890864413
commit
f274cbd185
1 changed files with 8 additions and 3 deletions
|
@ -591,9 +591,14 @@ size, and full-buffer size."
|
||||||
(defun shr-string-pixel-width (string)
|
(defun shr-string-pixel-width (string)
|
||||||
(if (not shr-use-fonts)
|
(if (not shr-use-fonts)
|
||||||
(length string)
|
(length string)
|
||||||
(with-temp-buffer
|
;; Save and restore point across with-temp-buffer, since
|
||||||
(insert string)
|
;; shr-pixel-column uses save-window-excursion, which can reset
|
||||||
(shr-pixel-column))))
|
;; point to 1.
|
||||||
|
(let ((pt (point)))
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert string)
|
||||||
|
(shr-pixel-column))
|
||||||
|
(goto-char pt))))
|
||||||
|
|
||||||
(defsubst shr--translate-insertion-chars ()
|
(defsubst shr--translate-insertion-chars ()
|
||||||
;; Remove soft hyphens.
|
;; Remove soft hyphens.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue