From 195a366fe64d38f6b6332e80fc5dec8469b89982 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 2 Jul 2022 00:56:33 +0100 Subject: attic --- attic/misc.el | 20 ++++++++++++++++++++ custom/jao-custom-gnus.el | 37 ++++++++----------------------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/attic/misc.el b/attic/misc.el index e394490..76a2220 100644 --- a/attic/misc.el +++ b/attic/misc.el @@ -163,3 +163,23 @@ (with-eval-after-load "jao-afio" (add-hook 'jao-afio-switch-hook #'jao-gnus--first-group)) + +;;;; remove HTML from From contents (arxiv with r2e) +(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) diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index 48159ac..43e6142 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -145,7 +145,7 @@ gdirs " OR ") ")"))) (q (concat "mime:message " dirsq " (" qstring ")"))) - (message "query is: %s" q) + ;; (message "query is: %s" q) `("-b" "-t" "-q" ,q))) ) @@ -368,9 +368,10 @@ ;; (setq gnus-group-line-format " %m%S%p%P:%~(pad-right 35)c %3y %B\n") (setq gnus-group-line-format " %m%S%p%3y%P%* %~(pad-right 30)C %B\n") ;; (setq gnus-group-line-format " %m%S%p%3y%P%* %~(pad-right 30)G %B\n") -(setq gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n") -(setq gnus-group-uncollapsed-levels 2) -(setq gnus-auto-select-subject 'unread) + +(setq gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n" + gnus-group-uncollapsed-levels 2 + gnus-auto-select-subject 'unread) (setq-default gnus-large-newsgroup 2000) (add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp) @@ -416,9 +417,8 @@ ;;; Summary buffer ;;;; configuration -(setq gnus-face-1 'jao-gnus-face-tree) - -(setq gnus-show-threads t +(setq gnus-face-1 'jao-gnus-face-tree + gnus-show-threads t gnus-thread-hide-subtree t gnus-summary-make-false-root 'adopt gnus-summary-gather-subject-limit 120 @@ -609,33 +609,12 @@ gnus-visible-headers "\\|^List-[iI][Dd]:\\|^X-Newsreader:\\|^X-Mailer:\\|User-Agent:\\|X-User-Agent:"))) -;;;; HTML email (washing, images) +;;;; html and images (setq gnus-button-url 'browse-url-generic gnus-inhibit-images t mm-discouraged-alternatives nil ;; '("text/html" "text/richtext") mm-inline-large-images 'resize) -;; 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)) - (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 nil) (defun jao-gnus--init-images () -- cgit v1.2.3