From: Eshel Yaron Date: Thu, 22 Aug 2024 07:24:41 +0000 (+0200) Subject: ; Attempt to unbreak 'shr-indent' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=459ab71cf9686e4027c1bd2a95c3174ed7aa7e79;p=emacs.git ; Attempt to unbreak 'shr-indent' --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index b9ac9f0c8c0..d80d6b370f6 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1057,10 +1057,12 @@ When `shr-fill-text' is nil, only indent." ;; of the current face, like (N . width). That way, the ;; indentation is calculated correctly when using ;; `text-scale-adjust'. - `(space :width (,(if-let ((font (font-at (1- (point)))) - (info (query-font font))) - (/ (float shr-indentation) (aref info 7)) - shr-indentation) + `(space :width (,(/ (float shr-indentation) + (if-let (((eq (window-buffer) (current-buffer))) + (font (font-at (1- (point)))) + (info (query-font font))) + (aref info 7) + (string-pixel-width " "))) . width)))) (put-text-property start (+ (point) prefix) 'shr-prefix-length (+ prefix (- (point) start))))))