Mercurial > hg > xemacs
diff gnus-init.el @ 31:129123962e51
trying to merge lib/emacs and xemacs
author | Henry S Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Sat, 07 Oct 2023 12:43:14 +0100 |
parents | 0e5b39d2f8bb |
children | cb9b76219c55 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnus-init.el Sat Oct 07 12:43:14 2023 +0100 @@ -0,0 +1,215 @@ +;; 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)) + ("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 bbdb/news-auto-create-p t) + +(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)) + ""))))))) + +(set-nnmail-split-fancy) + +(defun set-ht-compiled-split () + (interactive) + (set-nnmail-split-fancy)) + +(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)) + +(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)