aboutsummaryrefslogtreecommitdiffstats
path: root/oni-shr.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2019-02-27 23:15:58 -0800
committerGravatar Tom Willemse2019-02-27 23:15:58 -0800
commitba7e1b93084fd3f7a329ddbc92650bedaab41036 (patch)
tree38ba5774c5d2c0ddac78855e3ae9f3c60b1d2d35 /oni-shr.el
parent89fd0328690594534eda79a98bafde59dddab6e1 (diff)
downloademacs-config-ba7e1b93084fd3f7a329ddbc92650bedaab41036.tar.gz
emacs-config-ba7e1b93084fd3f7a329ddbc92650bedaab41036.zip
Add oni-shr
Diffstat (limited to 'oni-shr.el')
-rw-r--r--oni-shr.el42
1 files changed, 42 insertions, 0 deletions
diff --git a/oni-shr.el b/oni-shr.el
new file mode 100644
index 0000000..2184f5f
--- /dev/null
+++ b/oni-shr.el
@@ -0,0 +1,42 @@
+;;; oni-shr.el --- Shr configuration -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2019 Tom Willemse
+
+;; Author: Tom Willemse <tom@ryuslash.org>
+;; Keywords: local
+;; Version: 20190227231421
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Shr configuration.
+
+;;; Code:
+
+(require 'shr)
+
+(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))
+
+(advice-add #'shr-colorize-region
+ :filter-args #'oni-shr--colorize-remove-last-arg)
+
+;;;###autoload(with-eval-after-load 'shr (require 'oni-shr))
+
+(provide 'oni-shr)
+;;; oni-shr.el ends here