diff gnus-init.el @ 23:5738cc494f7f

trying to clean up Paul vs. Maritain for Cirrus
author ht
date Sat, 07 Oct 2023 10:11:27 +0100
parents 7b2c4ed36302
children 0e5b39d2f8bb
line wrap: on
line diff
--- a/gnus-init.el	Mon Nov 30 16:26:58 2020 +0000
+++ b/gnus-init.el	Sat Oct 07 10:11:27 2023 +0100
@@ -170,3 +170,32 @@
 
 (add-hook 'nnml-prepare-save-mail-hook (function ht-gnus-note-save-to-group))
 
+(require 'gnus-art)
+
+(nconc gnus-treatment-function-alist
+       '((gnus-treat-strip-uoe-warning  gnus-article-strip-uoe-warning)))
+
+(defun gnus-article-strip-uoe-warning (&optional interactive &rest args)
+  "redirect for stripping"
+  (interactive (list t))
+  (save-excursion
+    (set-buffer gnus-article-buffer)
+    (if interactive
+	(call-interactively 'article-strip-uoe-warning)
+      (apply 'article-strip-uoe-warning args))))
+
+(defun article-strip-uoe-warning ()
+  "strip the stupid uoe warning"
+  (interactive)
+  (save-excursion
+    (article-goto-body)
+    (let ((case-fold-search t))
+      (when
+	  (looking-at "This email was sent to you by someone outside the University.")
+	(gnus-delete-line))
+      (when
+	  (looking-at "You should only click on links or attachments if you are certain that the email is genuine and the content is safe.")
+	(gnus-delete-line))
+      )))
+
+(setq gnus-treat-strip-uoe-warning t)