From 459ab71cf9686e4027c1bd2a95c3174ed7aa7e79 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Thu, 22 Aug 2024 09:24:41 +0200 Subject: [PATCH] ; Attempt to unbreak 'shr-indent' --- lisp/net/shr.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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)))))) -- 2.39.5