From: Lars Ingebrigtsen Date: Sun, 14 Jul 2019 12:45:21 +0000 (+0200) Subject: Tweak background colour handling in shr X-Git-Tag: emacs-27.0.90~1918 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8ebcc7b9d44896390741e6aa45904ae6de1723b9;p=emacs.git Tweak background colour handling in shr * lisp/net/shr.el (shr-fill-line): Keep the background colour on the newline and the indentation. --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index b6dbcaa6cfb..5001743474a 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -735,7 +735,7 @@ size, and full-buffer size." (when (= (preceding-char) ?\s) (delete-char -1)) (let ((gap-start (point))) - (insert "\n") + (insert "\n") (shr-indent) (when (and (> (1- gap-start) (point-min)) ;; The link on both sides of the newline are the @@ -746,10 +746,12 @@ size, and full-buffer size." ;; not visually. This makes navigation between links work ;; well, but avoids underscores before the link on the next ;; line when indented. - (let ((props (copy-sequence (text-properties-at (point))))) + (let* ((props (copy-sequence (text-properties-at (point)))) + (face (plist-get props 'face))) ;; We don't want to use the faces on the indentation, because - ;; that's ugly. - (setq props (plist-put props 'face nil)) + ;; that's ugly, but we do want to use the background colour. + (when face + (setq props (plist-put props 'face (shr-face-background face)))) (add-text-properties gap-start (point) props)))) (setq start (point)) (shr-vertical-motion shr-internal-width)