From 7b69e65059c91d93ebb82d22b8d082ad35522cb7 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 3 Nov 2014 20:59:08 -0500 Subject: [PATCH] Add option to inhibit coloration. --- lisp/ChangeLog | 3 +++ lisp/net/shr.el | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac78e34..9d104ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -9,6 +9,9 @@ * net/shr.el: Ditto. + * net/shr.el: Add option to inhibit color rendering (patch by Yoni + Rabkin yrk@gnu.org). + 2014-11-03 Stefan Monnier * emacs-lisp/edebug.el (edebug-safe-prin1-to-string): Assume that diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 5db0324..ccaba20 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -106,6 +106,12 @@ Alternative suggestions are: :group 'shr :type 'boolean) +(defcustom shr-inhibit-coloration nil + "Non nil means that colors will not be rendered." + :version "24.4" + :group 'shr + :type 'boolean) + (defvar shr-content-function nil "If bound, this should be a function that will return the content. This is used for cid: URLs, and the function is called with the @@ -920,6 +926,7 @@ ones, in case fg and bg are nil." (defun shr-colorize-region (start end fg &optional bg) (when (and (not shr-inhibit-decoration) + (not shr-inhibit-coloration) (or fg bg)) (let ((new-colors (shr-color-check fg bg))) (when new-colors -- 1.7.9.5