summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-15 12:30:53 +0100
committerjao <jao@gnu.org>2022-08-15 12:30:53 +0100
commit6d9db1481189363769ccaf206377378f3d8aaaa3 (patch)
treef2403d453568ec461771d0026014ff2329c1cd73 /custom
parent7fec9f92ba107cddc179193137b151f46573fa3d (diff)
downloadelibs-6d9db1481189363769ccaf206377378f3d8aaaa3.tar.gz
elibs-6d9db1481189363769ccaf206377378f3d8aaaa3.tar.bz2
gnus: cleaning From HTML also in summary buffer
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-gnus.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 47883c3..2256603 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -1,6 +1,5 @@
;; gnus configuration -*- lexical-binding: t -*-
-
;;; Feature switching vars
(defvar jao-gnus-use-local-imap nil)
(defvar jao-gnus-use-leafnode nil)
@@ -489,12 +488,18 @@
"The Guardian: "
"Aeon | a world of ideas: "
": <author>"))
- "\\|unofficial mirror of [^:]+: "))
+ "\\|[gq].+ updates on arXiv.org: "))
(defun gnus-user-format-function-f (headers)
(let* ((from (gnus-header-from headers))
- (from (gnus-summary-extract-address-component from)))
- (replace-regexp-in-string jao-gnus--news-rx "" from)))
+ (from (gnus-summary-extract-address-component from))
+ (from (replace-regexp-in-string jao-gnus--news-rx "" from)))
+ (if (string-prefix-p "<a " from)
+ (with-temp-buffer
+ (insert from)
+ (let ((shr-width 100000)) (shr-render-buffer (current-buffer)))
+ (buffer-string))
+ from)))
(setq gnus-user-date-format-alist
'(((gnus-seconds-today) . "%H:%M")
@@ -660,20 +665,21 @@
(defvar jao-gnus--from-rx
(concat "From: \\\"?\\( " jao-gnus--news-rx "\\)"))
-(defun jao-gnus-remove-anchors ()
+(defun jao-gnus-format-from ()
(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)
+ (cond ((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))))))))))
+ (shr-render-region begin (1- (point)))
+ (replace-string-in-region "\"" "" (- begin 1))))))
+ ((re-search-forward jao-gnus--from-rx nil t)
+ (replace-match "" nil nil nil 1)))))
-(add-hook 'gnus-part-display-hook 'jao-gnus-remove-anchors)
+(add-hook 'gnus-part-display-hook 'jao-gnus-format-from)
;;;; follow links and enclosures
(defun jao-gnus-follow-link (&optional external)