summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-07-02 00:56:33 +0100
committerjao <jao@gnu.org>2022-07-18 02:40:12 +0100
commit1fac3e95c3c7b83018130af8eaf0060f69961548 (patch)
treea812d55de893fe91a6c3cbbf8df8a20f3a3ab4a4
parentfa039163ec824f1678965588ebee8fe25ed362f8 (diff)
downloadelibs-1fac3e95c3c7b83018130af8eaf0060f69961548.tar.gz
elibs-1fac3e95c3c7b83018130af8eaf0060f69961548.tar.bz2
attic
-rw-r--r--attic/misc.el26
-rw-r--r--custom/jao-custom-gnus.el37
2 files changed, 34 insertions, 29 deletions
diff --git a/attic/misc.el b/attic/misc.el
index e394490..038072b 100644
--- a/attic/misc.el
+++ b/attic/misc.el
@@ -122,6 +122,12 @@
(message "%s = %s" v
(format-time-string "%Y-%m-%d %H:%M:%S"
(seconds-to-time (/ v 1000.0))))))
+;;; twtxt
+(use-package twtxt
+ :ensure t
+ :init (setq twtxt-file (expand-file-name "~/doc/jao.io/twtxt")
+ twtxt-following
+ '(("yarn" "https://twtxt.net/user/news/twtxt.txt"))))
;;; gnus bits
(jao-transient-major-mode gnus-group
@@ -163,3 +169,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 ()