]> git.eshelyaron.com Git - emacs.git/commitdiff
(shr-fill-line): Preserve background colours when indenting/folding.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 11 Feb 2015 04:34:07 +0000 (15:34 +1100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 11 Feb 2015 04:34:07 +0000 (15:34 +1100)
lisp/ChangeLog
lisp/net/shr.el

index 7274c9da8f2718e14a1d8bbba32a1f18f70f9c34..7ec017c94ec6965009fe7f9d99fdfb00fe94e782 100644 (file)
@@ -2,6 +2,7 @@
 
        * net/shr.el (shr-insert): Make sure the space inserted has the
        right font (for width).
+       (shr-fill-line): Preserve background colours when indenting/folding.
 
 2015-02-10  Lars Ingebrigtsen  <larsi@gnus.org>
 
index a4320853fd13c6bb52d267b8ca8b851a5e64e8c8..7a93c3a043c0d57d784fe4ef76abc57deaa227e2 100644 (file)
@@ -550,7 +550,12 @@ size, and full-buffer size."
                       (point) 'shr-continuation-indentation))
        start)
     (put-text-property (point) (1+ (point)) 'shr-indentation nil)
-    (shr-indent)
+    (let ((face (get-text-property (point) 'face))
+         (background-start (point)))
+      (shr-indent)
+      (when face
+       (put-text-property background-start (point) 'face
+                          `,(shr-face-background face))))
     (setq start (point))
     (setq shr-indentation (or continuation shr-indentation))
     (shr-vertical-motion shr-internal-width)
@@ -570,8 +575,13 @@ size, and full-buffer size."
       ;; Success; continue.
       (when (= (preceding-char) ?\s)
        (delete-char -1))
-      (insert "\n")
-      (shr-indent)
+      (let ((face (get-text-property (point) 'face))
+           (background-start (point)))
+       (insert "\n")
+       (shr-indent)
+       (when face
+         (put-text-property background-start (point) 'face
+                            `,(shr-face-background face))))
       (setq start (point))
       (shr-vertical-motion shr-internal-width)
       (when (looking-at " $")