From 6e37fbd370988f0ed076a2395fa187e86df6beb7 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 23 Jul 2021 23:00:49 +0100 Subject: gnus: cleaner arxiv From: washing --- gnus.org | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'gnus.org') diff --git a/gnus.org b/gnus.org index d4ccd43..d5349b4 100644 --- a/gnus.org +++ b/gnus.org @@ -512,18 +512,14 @@ " ")))) (defconst jao-gnus--news-rx - (regexp-opt '("ElDiaro.es " "The Guardian: "))) + (regexp-opt '("ElDiaro.es " + "ElDiario.es - ElDiario.es: " + "The Guardian: "))) (defun gnus-user-format-function-f (headers) (let* ((from (gnus-header-from headers)) - (from (gnus-summary-extract-address-component from)) - (shr-width 1000)) - (if nil ;; (string-match-p ".* .+updates on arXiv.org: +\\(.+\\)" from) - (with-temp-buffer - (insert (match-string 1 from)) - (shr-render-buffer (current-buffer)) - (buffer-string)) - (replace-regexp-in-string jao-gnus--news-rx "" from)))) + (from (gnus-summary-extract-address-component from))) + (replace-regexp-in-string jao-gnus--news-rx "" from))) (setq gnus-user-date-format-alist '(((gnus-seconds-today) . "%H:%M") @@ -652,7 +648,7 @@ "\\|^List-[iI][Dd]:\\|^X-Newsreader:\\|^X-Mailer:\\|User-Agent:\\|X-User-Agent:"))) #+end_src *** HTML email - #+BEGIN_SRC emacs-lisp + #+begin_src emacs-lisp (setq gnus-button-url 'browse-url-generic gnus-inhibit-images t mm-discouraged-alternatives nil ;; '("text/html" "text/richtext") @@ -663,15 +659,13 @@ (defun jao-gnus-remove-anchors () (save-excursion (goto-char (point-min)) - (when (re-search-forward " .+updates on arXiv.org: +" nil t) - (replace-match " ") + (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 1000)) - ;; (shr-render-region begin (1- (point))) - (w3m-region begin (point)) - )))))) + (let ((shr-width 10000)) + (shr-render-region begin (1- (point))))))))) (add-hook 'gnus-part-display-hook 'jao-gnus-remove-anchors) @@ -696,7 +690,7 @@ (gnus-article-show-images) (goto-char pos) (w3m-toggle-inline-images)))))) - #+END_SRC + #+end_src *** Follow links and enclosures #+begin_src emacs-lisp (defun jao-gnus-follow-link (&optional external) -- cgit v1.2.3