view gnus-init.el @ 22:6097ab2da4ce

for new maritain
author ht
date Mon, 30 Nov 2020 16:26:58 +0000
parents 7b2c4ed36302
children 5738cc494f7f
line wrap: on
line source

;; Last edited: Fri Aug 20 14:49:23 1999
;; gnus customisation

(setq gnus-novice-user nil)

(setq gnus-message-archive-group
      '((concat "general." (format-time-string
			   "%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))
			      ((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-summary-ignore-duplicates t
 	gnus-use-scoring nil		; not used yet
	)

(setq bbdb/news-auto-create-p t)

(setq nnmail-crosspost nil)
(setq nnmail-split-methods '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")
		      (to "quaker-b" "quaker-b")
		      (to "w3c-xml-schema-\\([a-z]+\\)" "xml-schema-\\1")
		      (to "w3c-xml-\\([a-z]+\\)" "xml-\\1" )
		      (to "w3c-archive" "refinement")
		      (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" )
		      )
		    (list (list 'to
				"ht\\|h\\.?thompson?"
				(concat "pers-" month))
			  (concat "group-"
				  (format-time-string
				   "%Y-%m" (current-time))
				  ""))))))
(setq gnus-show-mime t)

(defun ht-gnus-summary-delete-forward ()
  "REAL delete for nnmail gnus"  
  (interactive)
  (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 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)

(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)

(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-"
				 (format-time-string "%Y-%m" (current-time)))))
    (gnus-group-goto-group gn)
    (gnus-group-get-new-news-this-group n)
    (gnus-group-goto-group gn)
    (gnus-group-read-group))
  )

(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
				  (expand-file-name nnml-directory)
				  "/"
				  (substring (gnus-group-group-name) 8))
				 nil t)
  )


(defun gnus-user-format-function-t (header)
  "display the to field (for archive messages)"
  (let ((n (mail-header-number header)))
    (with-current-buffer nntp-server-buffer
      (save-excursion
        (save-restriction
          (let ((inhibit-point-motion-hooks t))
            (goto-char (point-min))
            (let ((beg (search-forward (format " %d Article retrieved." n)))
                  (end (search-forward "\n.\n")))
              (narrow-to-region beg end)
              (goto-char beg)
              (message-fetch-field "To"))))))))

(make-variable-buffer-local 'gnus-extra-headers)
(make-variable-buffer-local 'nnmail-extra-headers)
(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))