From: Yoni Rabkin <yoni@rabkins.net>
To: emacs-devel@gnu.org
Subject: Re: Colour selection in shr
Date: Mon, 03 Nov 2014 21:10:11 -0500 [thread overview]
Message-ID: <87lhnryav0.fsf@rabkins.net> (raw)
In-Reply-To: <m3zjc8ezwr.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Mon, 03 Nov 2014 22:29:24 +0100")
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Yoni Rabkin <yoni@rabkins.net> writes:
>
>> A defcustom in shr.el which stops shr from coloring stuff won't make eww
>> stop coloring everything.
>
> Why not? eww can look at shr variables just as much as shr can.
>
>> To repeat: eww.el:eww-colorize-region is eww's own private copy of
>> shr.el:shr-colorize-region.
>
> Looks like a something left over for hysterical raisins. I've now
> removed the eww version of the function.
In which case, can we use something like this?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-inhibit-coloration.patch --]
[-- Type: text/x-diff, Size: 1491 bytes --]
From 7b69e65059c91d93ebb82d22b8d082ad35522cb7 Mon Sep 17 00:00:00 2001
From: Yoni Rabkin <yrk@gnu.org>
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 <monnier@iro.umontreal.ca>
* 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
[-- Attachment #3: Type: text/plain, Size: 56 bytes --]
--
"Cut your own wood and it will warm you twice"
next prev parent reply other threads:[~2014-11-04 2:10 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 0:41 "Readability" feature in eww Lars Magne Ingebrigtsen
2014-11-03 2:30 ` Yoni Rabkin
2014-11-03 10:32 ` Colour selection in shr (was: "Readability" feature in eww) Lars Magne Ingebrigtsen
2014-11-03 13:30 ` Colour selection in shr Yoni Rabkin
2014-11-03 17:26 ` Lars Magne Ingebrigtsen
2014-11-03 17:36 ` Eli Zaretskii
2014-11-03 18:20 ` Achim Gratz
2014-11-03 19:00 ` Eli Zaretskii
2014-11-03 19:23 ` Lars Magne Ingebrigtsen
2014-11-03 19:36 ` Eli Zaretskii
2014-11-03 19:42 ` Lars Magne Ingebrigtsen
2014-11-03 19:54 ` Eli Zaretskii
2014-11-03 20:34 ` Lars Magne Ingebrigtsen
2014-11-03 20:43 ` Eli Zaretskii
2014-11-03 19:55 ` Yoni Rabkin
2014-11-03 21:10 ` Lars Magne Ingebrigtsen
2014-11-03 21:21 ` Yoni Rabkin
2014-11-03 21:29 ` Lars Magne Ingebrigtsen
2014-11-04 2:10 ` Yoni Rabkin [this message]
2014-11-04 15:40 ` Stefan Monnier
2014-11-04 15:53 ` Lars Magne Ingebrigtsen
2014-11-04 18:18 ` Stefan Monnier
2014-11-05 0:15 ` Lars Magne Ingebrigtsen
2014-11-05 0:53 ` Yoni Rabkin
2014-11-05 2:03 ` Stefan Monnier
2014-11-05 11:40 ` Wolfgang Jenkner
2014-11-03 20:11 ` Stefan Monnier
2014-11-03 20:36 ` Lars Magne Ingebrigtsen
2014-11-13 20:00 ` Yoni Rabkin
2014-11-13 20:06 ` Lars Magne Ingebrigtsen
2014-11-03 9:37 ` "Readability" feature in eww Rüdiger Sonderfeld
2014-11-03 11:15 ` Rasmus
2014-11-04 15:51 ` Lars Magne Ingebrigtsen
2014-11-03 11:10 ` Rasmus
2014-11-03 11:22 ` Lars Magne Ingebrigtsen
2014-11-03 12:28 ` Rasmus
2014-11-03 12:11 ` Óscar Fuentes
2014-11-03 16:25 ` raman
2014-11-03 21:37 ` David Engster
2014-11-03 22:51 ` Lars Magne Ingebrigtsen
2014-11-04 7:44 ` David Engster
2014-11-04 15:49 ` Lars Magne Ingebrigtsen
2014-11-04 18:00 ` David Engster
2014-11-05 2:04 ` raman
2014-11-05 2:57 ` Yuri Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhnryav0.fsf@rabkins.net \
--to=yoni@rabkins.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.