summaryrefslogtreecommitdiffhomepage
path: root/custom/jao-custom-gnus.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-07-18 02:40:59 +0100
committerjao <jao@gnu.org>2022-07-18 02:40:59 +0100
commit92e93932aba504c5703f2e0a68c1e8c753be8324 (patch)
tree8d4f8c35d69580c72822a04d2391749763fbac73 /custom/jao-custom-gnus.el
parent04e10db7793afb1751f07f2b0bd0cba9b8e2fea7 (diff)
downloadelibs-92e93932aba504c5703f2e0a68c1e8c753be8324.tar.gz
elibs-92e93932aba504c5703f2e0a68c1e8c753be8324.tar.bz2
gnus: "from:" html washing back
Diffstat (limited to 'custom/jao-custom-gnus.el')
-rw-r--r--custom/jao-custom-gnus.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 31dc806..cc8de92 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -639,6 +639,26 @@
(gnus-article-show-images)
(gnus-article-remove-images)))))
+;;;; remove html in From:
+(require 'shr)
+(defvar jao-gnus--from-rx
+ (concat "From: \\\"?\\( " jao-gnus--news-rx "\\)"))
+
+(defun jao-gnus-remove-anchors ()
+ (save-excursion
+ (goto-char (point-min))
+ (cond ((re-search-forward jao-gnus--from-rx nil t)
+ (replace-match "" nil nil nil 1))
+ ((re-search-forward "[gq].+ updates on arXiv.org: " nil t)
+ (replace-match "")
+ (let ((begin (point)))
+ (when (re-search-forward "^\\(To\\|Subject\\):" nil t)
+ (beginning-of-line)
+ (let ((shr-width 10000))
+ (shr-render-region begin (1- (point))))))))))
+
+(add-hook 'gnus-part-display-hook 'jao-gnus-remove-anchors)
+
;;;; follow links and enclosures
(defun jao-gnus-follow-link (&optional external)
(interactive "P")