]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't insert nil faces in shr
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 2 Feb 2016 04:16:34 +0000 (05:16 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 2 Feb 2016 04:16:34 +0000 (05:16 +0100)
* shr.el (shr-insert-table): Don't add nil faces, because that
will show up in *Messages* as "Invalid face reference: nil [32
times]".

lisp/net/shr.el

index 41c5f95700ec9616c566282ffa688bb02b84fc79..c600c7453235fc1d33a9a2eca5a07a3de7600e1d 100644 (file)
@@ -1754,17 +1754,18 @@ The preference is a float determined from `shr-prefer-media-type'."
                                 align)))
              (dolist (line lines)
                (end-of-line)
-               (let ((start (point)))
-                 (insert
-                  line
-                  (propertize " "
-                              'display `(space :align-to (,pixel-align))
-                              'face (and (> (length line) 0)
-                                         (shr-face-background
-                                          (get-text-property
-                                           (1- (length line)) 'face line)))
-                              'shr-table-indent shr-table-id)
-                  shr-table-vertical-line)
+               (let ((start (point))
+                      (background (and (> (length line) 0)
+                                       (shr-face-background
+                                        (get-text-property
+                                         (1- (length line)) 'face line))))
+                      (space (propertize
+                              " "
+                              'display `(space :align-to (,pixel-align))
+                              'shr-table-indent shr-table-id)))
+                  (when background
+                    (setq space (propertize space 'face background)))
+                 (insert line space shr-table-vertical-line)
                  (shr-colorize-region
                   start (1- (point)) (nth 5 column) (nth 6 column)))
                (forward-line 1))