emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 8ebcc7b: Tweak background colour handling in shr


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 8ebcc7b: Tweak background colour handling in shr
Date: Sun, 14 Jul 2019 08:45:30 -0400 (EDT)

branch: master
commit 8ebcc7b9d44896390741e6aa45904ae6de1723b9
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Tweak background colour handling in shr
    
    * lisp/net/shr.el (shr-fill-line): Keep the background colour on
    the newline and the indentation.
---
 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 b6dbcaa..5001743 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]