diff gnus-init.el @ 21:7b2c4ed36302

for new maritain
author ht
date Mon, 30 Nov 2020 16:00:15 +0000
parents 6d36ba671237
children 5738cc494f7f
line wrap: on
line diff
--- a/gnus-init.el	Mon Nov 30 15:42:47 2020 +0000
+++ b/gnus-init.el	Mon Nov 30 16:00:15 2020 +0000
@@ -7,15 +7,33 @@
       '((concat "general." (format-time-string
 			   "%Y-%m" (current-time)))))
 
-(setq 	gnus-summary-ignore-duplicates t
+
+(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-your-organization "HCRC, University of Edinburgh"
-	gnus-summary-line-format "%U%R%z%I%4N%(%[%4L: %-20,20n%]%) %s\n"
+	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))
+			      ((header "To" ".*@rsof.hst.name")
+			       (signature-file "/home/ht/.quaker-sig")
+			       (address "ht@rsof.hst.name")))
+	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-ignored-headers
-	      "^Errors-To:\\|^Precedence:\\|^UNIX-From:"
-	gnus-posting-styles `((".*"
-			       (signature-file ,mail-signature-file))))
+ 	gnus-summary-ignore-duplicates t
+ 	gnus-use-scoring nil		; not used yet
+	)
 
 (setq bbdb/news-auto-create-p t)
 
@@ -24,7 +42,7 @@
 (setq nnmail-split-fancy
       (let ((month (format-time-string "%Y-%m" (current-time))))
       (cons '|
-	    (append '(("Subject" "testing" junk)
+	    (append '(("Subject" "testing" "jjunk")
 		      (to "quaker-\\(l\\|spectrum\\)" "quaker")
 		      (to "quaker-b" "quaker-b")
 		      (to "w3c-xml-schema-\\([a-z]+\\)" "xml-schema-\\1")
@@ -33,6 +51,9 @@
 		      (to "w3c-\\(xsl-wg\\|format\\|i18n-ig\\)" "xsl")
 		      (to "[cC]ygwin" "cygwin")
 		      (to "ding" "gnus")
+		      (from "noreply@mrooms.net" "nayler")
+		      (to "ht@rsof.hst.name" "quaker")
+		      (to "mfw@rsof.hst.name" "7vt")
 		      (to "zphdaily" (concat "pers-" month))
 		      (to "inf\\(pg\\|msc\\|teach\\|res\\|staff\\)" "inf-\\1" )
 		      )
@@ -52,6 +73,21 @@
   (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 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)
+
 (custom-set-variables
  '(gnus-treat-display-picons nil))
 (custom-set-faces)
@@ -60,12 +96,19 @@
 
 (add-hook 'gnus-summary-mode-hook 'gnus-summary-mode-fun1)
  
+(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))
+
 (defun ht-gnus-pers-refresh (n)
   (interactive "p")
   (let ((gn (concat "nnml+ht:pers-"
@@ -112,3 +155,18 @@
 (add-hook 'gnus-parse-headers-hook
           '(lambda ()
              (gnus-summary-set-local-parameters gnus-newsgroup-name)))
+
+(add-hook 'gnus-get-new-news-hook (lambda () (setq ht-gnus-just-read nil)))
+
+(add-hook 'gnus-after-getting-new-news-hook
+          (lambda () (message "%s" ht-gnus-just-read)))
+
+(defvar ht-gnus-just-read nil)
+
+(defun ht-gnus-note-save-to-group ()
+  (let ((g (caar group-art)))
+    (if (not (member g ht-gnus-just-read))
+	(setq ht-gnus-just-read (cons g ht-gnus-just-read)))))
+
+(add-hook 'nnml-prepare-save-mail-hook (function ht-gnus-note-save-to-group))
+