shr: fix error when face is a face symbol
authorJulien Danjou <julien@danjou.info>
Tue, 10 May 2011 12:30:45 +0000 (14:30 +0200)
committerJulien Danjou <julien@danjou.info>
Tue, 10 May 2011 12:32:04 +0000 (14:32 +0200)
Signed-off-by: Julien Danjou <julien@danjou.info>
lisp/ChangeLog
lisp/shr.el

index b9740bb..8e5177b 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-10  Julien Danjou  <julien@danjou.info>
+
+       * shr.el (shr-put-color-1): Do not bug out when old-props is a face
+       symbol and not a list.
+
 2011-05-10  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-article-mode): Move binding of
index da27edc..bf5b06c 100644 (file)
@@ -716,7 +716,8 @@ ones, in case fg and bg are nil."
 
 (defun shr-put-color-1 (start end type color)
   (let* ((old-props (get-text-property start 'face))
-        (do-put (not (memq type old-props)))
+        (do-put (and (listp old-props)
+                      (not (memq type old-props))))
         change)
     (while (< start end)
       (setq change (next-single-property-change start 'face nil end))
@@ -724,7 +725,8 @@ ones, in case fg and bg are nil."
        (put-text-property start change 'face
                           (nconc (list type color) old-props)))
       (setq old-props (get-text-property change 'face))
-      (setq do-put (not (memq type old-props)))
+      (setq do-put (and (listp old-props)
+                        (not (memq type old-props))))
       (setq start change))
     (when (and do-put
               (> end start))