Make eww use `add-face-text-property', too.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 17 Jun 2013 10:07:08 +0000 (12:07 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 17 Jun 2013 10:22:13 +0000 (12:22 +0200)
(shr-make-overlay): Obsolete function.

* eww.el (eww-put-color): Removed.
(eww-colorize-region): Use `add-face-text-property'.

lisp/ChangeLog
lisp/eww.el
lisp/shr.el

index 68879f3..cb643db 100644 (file)
@@ -1,7 +1,11 @@
 2013-06-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * eww.el (eww-put-color): Removed.
+       (eww-colorize-region): Use `add-face-text-property'.
+
        * shr.el (shr-add-font): Append face data, so that we get the correct
        presedence: The innermost value (which is applied first) wins.
+       (shr-make-overlay): Obsolete function.
 
        * mm-decode.el (mm-convert-shr-links): New function to convert
        new-style shr URL links into widgets.
index 6460ee7..fc0e413 100644 (file)
     (let ((new-colors (shr-color-check fg bg)))
       (when new-colors
        (when fg
-         (eww-put-color start end :foreground (cadr new-colors)))
+         (add-face-text-property start end
+                                 (list :foreground (cadr new-colors))))
        (when bg
-         (eww-put-color start end :background (car new-colors)))))))
-
-(defun eww-put-color (start end type color)
-  (shr-put-color-1 start end type color))
+         (add-face-text-property start end
+                                 (list :background (car new-colors))))))))
 
 (defun eww-display-raw (charset)
   (let ((data (buffer-substring (point) (point-max))))
index ff8c918..e7169c5 100644 (file)
@@ -609,11 +609,6 @@ size, and full-buffer size."
     (dolist (type types)
       (shr-add-font (or shr-start (point)) (point) type))))
 
-(defun shr-make-overlay (beg end &optional buffer front-advance rear-advance)
-  (let ((overlay (make-overlay beg end buffer front-advance rear-advance)))
-    (overlay-put overlay 'evaporate t)
-    overlay))
-
 ;; Add face to the region, but avoid putting the font properties on
 ;; blank text at the start of the line, and the newline at the end, to
 ;; avoid ugliness.