diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 8cc95ea6966..b25b6783066 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1052,15 +1052,15 @@ When `shr-fill-text' is nil, only indent." (insert-char ?\s shr-indentation) (insert ?\s) ;; Set the specified space width in units of the average-width - ;; of the current font, like (N . width). That way, the + ;; of the current face, like (N . width). That way, the ;; indentation is calculated correctly when using ;; `text-scale-adjust'. (let ((avg-space (propertize (buffer-substring (1- (point)) (point)) - 'display '(space :width 1)))) + 'display '(space :width (1 . width))))) (put-text-property (1- (point)) (point) 'display `(space :width (,(/ (float shr-indentation) - (string-pixel-width avg-space (current-buffer))) + (string-pixel-width avg-space)) . width))))) (put-text-property start (+ (point) prefix) 'shr-prefix-length (+ prefix (- (point) start)))))) diff --git a/lisp/visual-wrap.el b/lisp/visual-wrap.el index 1691ba9c500..f2a186ce320 100644 --- a/lisp/visual-wrap.el +++ b/lisp/visual-wrap.el @@ -164,7 +164,7 @@ PREFIX was empty." ;; units of the font's average-width) large enough to fit the ;; first-line prefix. (let ((avg-space (propertize (buffer-substring position (1+ position)) - 'display '(space :width 1)))) + 'display '(space :width (1 . width))))) ;; Remove any `min-width' display specs since we'll replace with ;; our own later in `visual-wrap--apply-to-line' (bug#73882). (add-display-text-property 0 (length prefix) 'min-width nil prefix)