aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-07-14 14:45:21 +0200
committerLars Ingebrigtsen2019-07-14 14:45:21 +0200
commit8ebcc7b9d44896390741e6aa45904ae6de1723b9 (patch)
tree5f9a0a8c025161e52bcef3fca9d3f6d86c303a3f
parentd3256dc78a464117c4fef98b572611370482763a (diff)
downloademacs-8ebcc7b9d44896390741e6aa45904ae6de1723b9.tar.gz
emacs-8ebcc7b9d44896390741e6aa45904ae6de1723b9.zip
Tweak background colour handling in shr
* lisp/net/shr.el (shr-fill-line): Keep the background colour on the newline and the indentation.
-rw-r--r--lisp/net/shr.el10
1 files changed, 6 insertions, 4 deletions
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."
735 (when (= (preceding-char) ?\s) 735 (when (= (preceding-char) ?\s)
736 (delete-char -1)) 736 (delete-char -1))
737 (let ((gap-start (point))) 737 (let ((gap-start (point)))
738 (insert "\n") 738 (insert "\n")
739 (shr-indent) 739 (shr-indent)
740 (when (and (> (1- gap-start) (point-min)) 740 (when (and (> (1- gap-start) (point-min))
741 ;; The link on both sides of the newline are the 741 ;; The link on both sides of the newline are the
@@ -746,10 +746,12 @@ size, and full-buffer size."
746 ;; not visually. This makes navigation between links work 746 ;; not visually. This makes navigation between links work
747 ;; well, but avoids underscores before the link on the next 747 ;; well, but avoids underscores before the link on the next
748 ;; line when indented. 748 ;; line when indented.
749 (let ((props (copy-sequence (text-properties-at (point))))) 749 (let* ((props (copy-sequence (text-properties-at (point))))
750 (face (plist-get props 'face)))
750 ;; We don't want to use the faces on the indentation, because 751 ;; We don't want to use the faces on the indentation, because
751 ;; that's ugly. 752 ;; that's ugly, but we do want to use the background colour.
752 (setq props (plist-put props 'face nil)) 753 (when face
754 (setq props (plist-put props 'face (shr-face-background face))))
753 (add-text-properties gap-start (point) props)))) 755 (add-text-properties gap-start (point) props))))
754 (setq start (point)) 756 (setq start (point))
755 (shr-vertical-motion shr-internal-width) 757 (shr-vertical-motion shr-internal-width)