summaryrefslogtreecommitdiffstats
path: root/shr-dont-colorize.post
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-01-02 03:40:45 +0100
committerGravatar Tom Willemse2015-01-02 03:40:45 +0100
commitbada4ecc1a09a3e4a98ae3449f6e6e7e6de19fef (patch)
tree4d342203736f3d4e739c5650aa58021cf572b381 /shr-dont-colorize.post
downloadblog-bada4ecc1a09a3e4a98ae3449f6e6e7e6de19fef.tar.gz
blog-bada4ecc1a09a3e4a98ae3449f6e6e7e6de19fef.zip
Initial commit
Diffstat (limited to 'shr-dont-colorize.post')
-rw-r--r--shr-dont-colorize.post30
1 files changed, 30 insertions, 0 deletions
diff --git a/shr-dont-colorize.post b/shr-dont-colorize.post
new file mode 100644
index 0000000..044a29a
--- /dev/null
+++ b/shr-dont-colorize.post
@@ -0,0 +1,30 @@
+;;;;;
+title: Stop shr from using background color
+tags: emacs, elisp, config
+date: 2014-04-03 22:11
+format: md
+;;;;;
+
+Here's just one more example why Emacs is so awesome
+
+Reading mail in Gnus is very nice, but shr has become a little too
+good at its job. Add to this the many occasions when a background is
+specified without specifying a foreground, plus a color theme that
+is the inverse of what is usually expected, and you can get
+hard-to-read HTML messages, gray foreground and gray background.
+
+I've looked at the other possible renderers, but they don't look
+very nice compared to shr. So just remove its ability to add
+background colors.
+
+```emacs-lisp
+(defun oni:shr-colorize-remove-last-arg (args)
+ "If ARGS has more than 3 items, remove the last one."
+ (if (> (length args) 3)
+ (butlast args)
+ args))
+
+(with-eval-after-load 'shr
+ (advice-add #'shr-colorize-region :filter-args
+ #'oni:shr-colorize-remove-last-arg))
+```