summaryrefslogtreecommitdiffhomepage
path: root/attic
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 /attic
parentfa039163ec824f1678965588ebee8fe25ed362f8 (diff)
downloadelibs-1fac3e95c3c7b83018130af8eaf0060f69961548.tar.gz
elibs-1fac3e95c3c7b83018130af8eaf0060f69961548.tar.bz2
attic
Diffstat (limited to 'attic')
-rw-r--r--attic/misc.el26
1 files changed, 26 insertions, 0 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)