From: Lars Magne Ingebrigtsen Date: Mon, 17 Jun 2013 10:07:08 +0000 (+0200) Subject: Make eww use `add-face-text-property', too. X-Git-Url: https://cgit.sxemacs.org/?a=commitdiff_plain;h=b4e3caa6187781b601cb64618da784c4244a812d;hp=c51a478e5206246505408b920b26fd998cd2bb7c;p=gnus Make eww use `add-face-text-property', too. (shr-make-overlay): Obsolete function. * eww.el (eww-put-color): Removed. (eww-colorize-region): Use `add-face-text-property'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 68879f37a..cb643dbee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,11 @@ 2013-06-17 Lars Magne Ingebrigtsen + * 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. diff --git a/lisp/eww.el b/lisp/eww.el index 6460ee796..fc0e41324 100644 --- a/lisp/eww.el +++ b/lisp/eww.el @@ -172,12 +172,11 @@ (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)))) diff --git a/lisp/shr.el b/lisp/shr.el index ff8c918b7..e7169c5a7 100644 --- a/lisp/shr.el +++ b/lisp/shr.el @@ -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.