summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-03-09 20:40:18 +0000
committerjao <jao@gnu.org>2022-03-09 20:40:18 +0000
commit6079222add3c45418a899d50cdd1f06eeeb28d43 (patch)
tree11609feeb59b28c21e7b75b7607b2ee1ef917a62
parent7d69f1c5f899f4f43a5e1318a6d238717ec75578 (diff)
downloadelibs-6079222add3c45418a899d50cdd1f06eeeb28d43.tar.gz
elibs-6079222add3c45418a899d50cdd1f06eeeb28d43.tar.bz2
gnus address cleaning also in article buffer
-rw-r--r--gnus.org29
1 files changed, 17 insertions, 12 deletions
diff --git a/gnus.org b/gnus.org
index aee07d4..a907ccf 100644
--- a/gnus.org
+++ b/gnus.org
@@ -493,10 +493,11 @@
" "))))
(defconst jao-gnus--news-rx
- (regexp-opt '("ElDiaro.es "
- "ElDiario.es - ElDiario.es: "
- "The Guardian: "
- "Aeon | a world of ideas: ")))
+ (concat (regexp-opt '("ElDiaro.es "
+ "ElDiario.es - ElDiario.es: "
+ "The Guardian: "
+ "Aeon | a world of ideas: "))
+ "\\|unofficial mirror of [^:]+: "))
(defun gnus-user-format-function-f (headers)
(let* ((from (gnus-header-from headers))
@@ -644,18 +645,22 @@
mm-discouraged-alternatives nil ;; '("text/html" "text/richtext")
mm-inline-large-images 'resize)
- ;; no html in From: (washing articles from arxiv feeds)
+ ;; no html in From: (washing articles from arxiv feeds) and cleaning up
+ ;; addresses
(require 'shr)
+ (defvar jao-gnus--from-rx (concat "From: \\\"?\\( " jao-gnus--news-rx "\\)"))
(defun jao-gnus-remove-anchors ()
(save-excursion
(goto-char (point-min))
- (when (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)))))))))
+ (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)
(defvar-local jao-gnus--images-p nil)