aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2014-11-03 22:27:24 +0100
committerLars Magne Ingebrigtsen2014-11-03 22:27:24 +0100
commit303fd9411f21d19604306ecdbd89941bf4923201 (patch)
treeb0f706695cc94c6dad601896c6a80c94339775c0
parenta3e8e5089f2b61c9ff3f23ef001deb2412e013ba (diff)
downloademacs-303fd9411f21d19604306ecdbd89941bf4923201.tar.gz
emacs-303fd9411f21d19604306ecdbd89941bf4923201.zip
Remove `eww-colorize-region'
(eww-colorize-region): Remove duplicate function. (eww-tag-body): Use `shr-colorize-region'.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/net/eww.el15
2 files changed, 3 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 292062a4680..a94725c0b56 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,8 @@
4 (eww-display-pdf): New function. 4 (eww-display-pdf): New function.
5 (eww-render): Display PDFs with `doc-view'. 5 (eww-render): Display PDFs with `doc-view'.
6 (url-queue): Require `url-queue' to avoid compilation warning. 6 (url-queue): Require `url-queue' to avoid compilation warning.
7 (eww-colorize-region): Remove duplicate function.
8 (eww-tag-body): Use `shr-colorize-region'.
7 9
82014-11-03 Yoni Rabkin <yrk@gnu.org> 102014-11-03 Yoni Rabkin <yrk@gnu.org>
9 11
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 1ff26bc50a1..705d79cdb77 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -370,20 +370,7 @@ word(s) will be searched for via `eww-search-prefix'."
370 (shr-stylesheet (list (cons 'color fgcolor) 370 (shr-stylesheet (list (cons 'color fgcolor)
371 (cons 'background-color bgcolor)))) 371 (cons 'background-color bgcolor))))
372 (shr-generic cont) 372 (shr-generic cont)
373 (eww-colorize-region start (point) fgcolor bgcolor))) 373 (shr-colorize-region start (point) fgcolor bgcolor)))
374
375(defun eww-colorize-region (start end fg &optional bg)
376 (when (or fg bg)
377 (let ((new-colors (shr-color-check fg bg)))
378 (when new-colors
379 (when fg
380 (add-face-text-property start end
381 (list :foreground (cadr new-colors))
382 t))
383 (when bg
384 (add-face-text-property start end
385 (list :background (car new-colors))
386 t))))))
387 374
388(defun eww-display-raw () 375(defun eww-display-raw ()
389 (let ((data (buffer-substring (point) (point-max)))) 376 (let ((data (buffer-substring (point) (point-max))))