diff gnus-init.el @ 32:cb9b76219c55

attempt to merge mail read and send from all over
author Henry S Thompson <ht@inf.ed.ac.uk>
date Sun, 08 Oct 2023 16:36:27 +0100
parents 0e5b39d2f8bb
children eee08de75336
line wrap: on
line diff
--- a/gnus-init.el	Sat Oct 07 12:43:14 2023 +0100
+++ b/gnus-init.el	Sun Oct 08 16:36:27 2023 +0100
@@ -1,6 +1,23 @@
-;; Last edited: Fri Aug 20 14:49:23 1999
 ;; gnus customisation
 
+(site-caseq (edin
+	     (require 'mail-from-inf))
+	    (maritain
+	     (require 'mail-from-m)
+))
+
+;; things based on my-mail-dir, which is set in one of the above
+
+(setq gnus-article-save-directory (concat my-mail-dir "/Mail")
+      nnml-directory (expand-file-name (concat my-mail-dir "/Mail"))
+      gnus-message-archive-method
+      '(nnfolder "archive"
+	;; the following two are not taking effect, not sure why, answer
+	;; _may_ lie in gnus-setup-news...
+	(nnfolder-directory (concat my-mail-dir "/cpy"))
+	(nnfolder-active-file (concat my-mail-dir "/cpy/active")))
+      mail-sources '((file :path "/var/spool/mail/ht")))
+
 (setq gnus-novice-user nil)
 
 (setq gnus-message-archive-group
@@ -8,77 +25,77 @@
 			   "%Y-%m" (current-time)))))
 
 
-(site-caseq (maritain (require 'mail-from-m)))
 
-(setq
-;	gnus-article-sort-functions '(gnus-article-sort-by-subject
-; see secondary-select-methods in my-news gnus-article-sort-by-number)
-	gnus-auto-select-next 'quietly
-	gnus-buttonized-mime-types '("multipart/signed")
-	gnus-inhibit-mime-unbuttonizing nil
-	gnus-ignored-headers "^Errors-To:\\|^Precedence:\\|^UNIX-From:"
-	gnus-mime-display-multipart-related-as-mixed t
-	gnus-posting-styles `((".*"
-			       (signature-file ,mail-signature-file))
-			      ("quaker-2023"
-			       (signature-file "/home/ht/.quaker-sig")
-			       (address "ht@rsof.hst.name"))
-			      ("mhmcc-2023"
-			       (signature-file "/home/ht/.mhmcc-sig")
-			       ("Reply-to" "sesam.emh.management@gmail.com")
-			       (name "HST as Convenor SESAM MHMC")
-			       (address "mhmcc@rsof.hst.name")
-			       ("Bcc" "sesam.emh.management@gmail.com")))
-	gnus-simplify-subject-regexp "^\\(re[:;.]\\| \\|fwd:\\)*"
-	gnus-summary-display-arrow nil
-	gnus-summary-gather-subject-limit nil
-	gnus-summary-line-format "%U%R%5N%I%(%[%4L: %-12,12A%]%) %s\n"
-	gnus-summary-make-false-root 'none
-	gnus-thread-sort-functions '(gnus-thread-sort-by-number
-				     gnus-thread-sort-by-simpl-subject)
-	mm-discouraged-alternatives '("text/html")
- 	gnus-summary-ignore-duplicates t
- 	gnus-use-scoring nil		; not used yet
-	)
+(setq gnus-auto-select-next 'quietly
+      gnus-buttonized-mime-types '("multipart/signed")
+      gnus-group-line-format "%M%S%p%P%5y:%uH%(%g%)%l %O
+"
+      gnus-ignored-headers "^Errors-To:\\|^Precedence:\\|^UNIX-From:"
+      gnus-inhibit-mime-unbuttonizing nil
+      gnus-mime-display-multipart-related-as-mixed t
+      gnus-show-mime t
+      gnus-simplify-subject-regexp "^\\(re[:;.]\\| \\|fwd:\\)*"
+      gnus-summary-display-arrow nil
+      gnus-summary-gather-subject-limit nil
+      gnus-summary-ignore-duplicates t
+      gnus-summary-line-format "%U%R%5N%I%(%[%4L: %-12,12A%]%) %s\n"
+      gnus-summary-make-false-root 'none
+      gnus-thread-sort-functions '(gnus-thread-sort-by-number
+				   gnus-thread-sort-by-simpl-subject)
+      gnus-use-scoring nil	; not used yet
+      message-from-style 'angles
+      mm-discouraged-alternatives '("text/html")
+      nnmail-expiry-wait 28
+      no-select-groups '("nnml+ht:cygwin")
+     )
 
 (setq bbdb/news-auto-create-p t)
 
+(setq wsp-cache nil)
+
+;;;(setq blacklist-db (open-database "~/.blacklist"))
+
+(require 'my-news) ; defines db functions
+
+(open-white)
+(open-ad)
+(open-quaker)
+
+(add-hook 'kill-emacs-hook
+	  (lambda ()
+	    (if (database-live-p whitelist-db)
+		(close-database whitelist-db))
+	    (if (database-live-p quaker-db)
+		(close-database quaker-db))
+	    (if (database-live-p adlist-db)
+		(close-database adlist-db))))
+
+(add-hook 'bbdb-complete-name-hooks 'quaker-sig-if-quaker)
+(add-hook 'gnus-message-setup-hook 'quaker-sig-if-to-quaker)
+
 (setq nnmail-crosspost nil)
 (setq nnmail-split-methods 'nnmail-split-fancy)
-(defun set-nnmail-split-fancy ()
-  (setq nnmail-split-fancy
-      (let ((month (format-time-string "%Y-%m" (current-time))))
-      (cons '|
-	    (append '(("Subject" "testing" "jjunk")
-		      (to "quaker-\\(l\\|spectrum\\)" "quaker-2022")
-		      (to "quaker-b" "quaker-b")
-		      (to "[cC]ygwin" "cygwin")
-		      (from "noreply@mrooms.net" "nayler")
-		      (to "ht@rsof.hst.name" "quaker-2023")
-		      (to "Wardenship@lists.quaker.eu.org" "wardens")
-		      (to "mhmcc@rsof.hst.name" "mhmcc-2023")
-		      ("Envelope-to" "mhmcc@rsof.hst.name"
-		       (| (from "mhmcc@rsof.hst.name" junk)
-			  "mhmcc-2023"))
-		      (to "mfw@rsof.hst.name" "7vt")
-		      (to "zphdaily" (concat "pers-" month))
-		      (to "inf\\(pg\\|msc\\|teach\\|res\\|staff\\)" "inf-\\1" )
-		      )
-		    (list (list 'to
-				"ht\\|h\\.?thompson?"
-				(concat "pers-" month))
-			  (concat "group-"
-				  (format-time-string
-				   "%Y-%m" (current-time))
-				  "")))))))
+
+(setq white-domains (list))
 
-(set-nnmail-split-fancy)
+(setq ad-domains (list "planetx.co.uk" "substack.com"))
+
+(defvar ht-compiled-split nil)
 
 (defun set-ht-compiled-split ()
+  "update the mail splitting rules"
   (interactive)
   (set-nnmail-split-fancy))
 
-(setq gnus-show-mime t)
+(setq gnus-show-mime t) ; stale
+(setq mml1991-use 'pgg
+      mml2015-use 'pgg
+      mm-verify-option 'always)
+
+(require 'mm-decode)
+(setq mm-automatic-display (remove "text/html" mm-automatic-display))
+
+(custom-set-faces)
 
 (defun ht-gnus-summary-delete-forward ()
   "REAL delete for nnmail gnus"  
@@ -86,21 +103,17 @@
   (gnus-summary-delete-article)
   (gnus-summary-next-unread-article))
 
-(require 'my-news)
-(open-quaker)
-
 (add-hook 'kill-emacs-hook
 	  (lambda ()
-; 	    (if (database-live-p whitelist-db)
-; 		(close-database whitelist-db))
+ 	    (if (database-live-p whitelist-db)
+ 		(close-database whitelist-db))
  	    (if (database-live-p quaker-db)
  		(close-database quaker-db))
-;	    (if (database-live-p adlist-db)
-;		(close-database adlist-db))
+	    (if (database-live-p adlist-db)
+		(close-database adlist-db))
 	    ))
 
 (add-hook 'bbdb-complete-name-hooks 'quaker-sig-if-quaker)
-;(add-hook 'gnus-message-setup-hook 'quaker-sig-if-to-quaker)
 
 (custom-set-variables
  '(gnus-treat-display-picons nil))
@@ -112,16 +125,7 @@
  
 (add-hook 'message-mode-hook 'message-mode-fun1)
 
-;; run the first time we make a summary window
-(defun gnus-summary-mode-fun1 ()
-  "install ht's mods"
-  (define-key gnus-summary-mode-map "D" 'ht-gnus-summary-delete-forward)
-  (define-key gnus-summary-mode-map "\M-h" 'showMPAhtml)
-  (remove-hook 'gnus-summary-mode-hook 'gnus-summary-mode-fun1))
-
-(defun message-mode-fun1 ()
-  (define-key message-mode-map [(control meta q)] 'add-quaker)
-  (remove-hook 'message-mode-hook 'message-mode-fun1))
+(add-hook 'message-sent-hook (function whiten-recip))
 
 (defun ht-gnus-pers-refresh (n)
   (interactive "p")
@@ -135,11 +139,6 @@
 
 (add-hook 'gnus-group-mode-hook 'gnus-group-mode-fun1)
  
-;; run the first time we make a group window
-(defun gnus-group-mode-fun1 ()
-  "install ht's mods"
-  (define-key gnus-group-mode-map "\M-\C-g" 'ht-gnus-pers-refresh)
-  (remove-hook 'gnus-group-mode-hook 'gnus-group-mode-fun1))
 
 (defun gnus-regen-group ()
   (nnml-generate-nov-databases-1 (concat
@@ -148,7 +147,10 @@
 				  (substring (gnus-group-group-name) 8))
 				 nil t)
   )
-
+(require 'mailcrypt)
+(add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
+(add-hook 'message-mode-hook 'mc-install-write-mode)
+(add-hook 'news-reply-mode-hook 'mc-install-write-mode)
 
 (defun gnus-user-format-function-t (header)
   "display the to field (for archive messages)"
@@ -213,3 +215,5 @@
       )))
 
 (setq gnus-treat-strip-uoe-warning t)
+
+(provide 'gnus-init)