comparison 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
comparison
equal deleted inserted replaced
5:8e0e16f4763c 31:129123962e51
1 ;; Last edited: Fri Aug 20 14:49:23 1999
2 ;; gnus customisation
3
4 (setq gnus-novice-user nil)
5
6 (setq gnus-message-archive-group
7 '((concat "general." (format-time-string
8 "%Y-%m" (current-time)))))
9
10
11 (site-caseq (maritain (require 'mail-from-m)))
12
13 (setq
14 ; gnus-article-sort-functions '(gnus-article-sort-by-subject
15 ; see secondary-select-methods in my-news gnus-article-sort-by-number)
16 gnus-auto-select-next 'quietly
17 gnus-buttonized-mime-types '("multipart/signed")
18 gnus-inhibit-mime-unbuttonizing nil
19 gnus-ignored-headers "^Errors-To:\\|^Precedence:\\|^UNIX-From:"
20 gnus-mime-display-multipart-related-as-mixed t
21 gnus-posting-styles `((".*"
22 (signature-file ,mail-signature-file))
23 ("quaker-2023"
24 (signature-file "/home/ht/.quaker-sig")
25 (address "ht@rsof.hst.name"))
26 ("mhmcc-2023"
27 (signature-file "/home/ht/.mhmcc-sig")
28 ("Reply-to" "sesam.emh.management@gmail.com")
29 (name "HST as Convenor SESAM MHMC")
30 (address "mhmcc@rsof.hst.name")
31 ("Bcc" "sesam.emh.management@gmail.com")))
32 gnus-simplify-subject-regexp "^\\(re[:;.]\\| \\|fwd:\\)*"
33 gnus-summary-display-arrow nil
34 gnus-summary-gather-subject-limit nil
35 gnus-summary-line-format "%U%R%5N%I%(%[%4L: %-12,12A%]%) %s\n"
36 gnus-summary-make-false-root 'none
37 gnus-thread-sort-functions '(gnus-thread-sort-by-number
38 gnus-thread-sort-by-simpl-subject)
39 mm-discouraged-alternatives '("text/html")
40 gnus-summary-ignore-duplicates t
41 gnus-use-scoring nil ; not used yet
42 )
43
44 (setq bbdb/news-auto-create-p t)
45
46 (setq nnmail-crosspost nil)
47 (setq nnmail-split-methods 'nnmail-split-fancy)
48 (defun set-nnmail-split-fancy ()
49 (setq nnmail-split-fancy
50 (let ((month (format-time-string "%Y-%m" (current-time))))
51 (cons '|
52 (append '(("Subject" "testing" "jjunk")
53 (to "quaker-\\(l\\|spectrum\\)" "quaker-2022")
54 (to "quaker-b" "quaker-b")
55 (to "[cC]ygwin" "cygwin")
56 (from "noreply@mrooms.net" "nayler")
57 (to "ht@rsof.hst.name" "quaker-2023")
58 (to "Wardenship@lists.quaker.eu.org" "wardens")
59 (to "mhmcc@rsof.hst.name" "mhmcc-2023")
60 ("Envelope-to" "mhmcc@rsof.hst.name"
61 (| (from "mhmcc@rsof.hst.name" junk)
62 "mhmcc-2023"))
63 (to "mfw@rsof.hst.name" "7vt")
64 (to "zphdaily" (concat "pers-" month))
65 (to "inf\\(pg\\|msc\\|teach\\|res\\|staff\\)" "inf-\\1" )
66 )
67 (list (list 'to
68 "ht\\|h\\.?thompson?"
69 (concat "pers-" month))
70 (concat "group-"
71 (format-time-string
72 "%Y-%m" (current-time))
73 "")))))))
74
75 (set-nnmail-split-fancy)
76
77 (defun set-ht-compiled-split ()
78 (interactive)
79 (set-nnmail-split-fancy))
80
81 (setq gnus-show-mime t)
82
83 (defun ht-gnus-summary-delete-forward ()
84 "REAL delete for nnmail gnus"
85 (interactive)
86 (gnus-summary-delete-article)
87 (gnus-summary-next-unread-article))
88
89 (require 'my-news)
90 (open-quaker)
91
92 (add-hook 'kill-emacs-hook
93 (lambda ()
94 ; (if (database-live-p whitelist-db)
95 ; (close-database whitelist-db))
96 (if (database-live-p quaker-db)
97 (close-database quaker-db))
98 ; (if (database-live-p adlist-db)
99 ; (close-database adlist-db))
100 ))
101
102 (add-hook 'bbdb-complete-name-hooks 'quaker-sig-if-quaker)
103 ;(add-hook 'gnus-message-setup-hook 'quaker-sig-if-to-quaker)
104
105 (custom-set-variables
106 '(gnus-treat-display-picons nil))
107 (custom-set-faces)
108
109 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
110
111 (add-hook 'gnus-summary-mode-hook 'gnus-summary-mode-fun1)
112
113 (add-hook 'message-mode-hook 'message-mode-fun1)
114
115 ;; run the first time we make a summary window
116 (defun gnus-summary-mode-fun1 ()
117 "install ht's mods"
118 (define-key gnus-summary-mode-map "D" 'ht-gnus-summary-delete-forward)
119 (define-key gnus-summary-mode-map "\M-h" 'showMPAhtml)
120 (remove-hook 'gnus-summary-mode-hook 'gnus-summary-mode-fun1))
121
122 (defun message-mode-fun1 ()
123 (define-key message-mode-map [(control meta q)] 'add-quaker)
124 (remove-hook 'message-mode-hook 'message-mode-fun1))
125
126 (defun ht-gnus-pers-refresh (n)
127 (interactive "p")
128 (let ((gn (concat "nnml+ht:pers-"
129 (format-time-string "%Y-%m" (current-time)))))
130 (gnus-group-goto-group gn)
131 (gnus-group-get-new-news-this-group n)
132 (gnus-group-goto-group gn)
133 (gnus-group-read-group))
134 )
135
136 (add-hook 'gnus-group-mode-hook 'gnus-group-mode-fun1)
137
138 ;; run the first time we make a group window
139 (defun gnus-group-mode-fun1 ()
140 "install ht's mods"
141 (define-key gnus-group-mode-map "\M-\C-g" 'ht-gnus-pers-refresh)
142 (remove-hook 'gnus-group-mode-hook 'gnus-group-mode-fun1))
143
144 (defun gnus-regen-group ()
145 (nnml-generate-nov-databases-1 (concat
146 (expand-file-name nnml-directory)
147 "/"
148 (substring (gnus-group-group-name) 8))
149 nil t)
150 )
151
152
153 (defun gnus-user-format-function-t (header)
154 "display the to field (for archive messages)"
155 (let ((n (mail-header-number header)))
156 (with-current-buffer nntp-server-buffer
157 (save-excursion
158 (save-restriction
159 (let ((inhibit-point-motion-hooks t))
160 (goto-char (point-min))
161 (let ((beg (search-forward (format " %d Article retrieved." n)))
162 (end (search-forward "\n.\n")))
163 (narrow-to-region beg end)
164 (goto-char beg)
165 (message-fetch-field "To"))))))))
166
167 (make-variable-buffer-local 'gnus-extra-headers)
168 (make-variable-buffer-local 'nnmail-extra-headers)
169 (add-hook 'gnus-parse-headers-hook
170 '(lambda ()
171 (gnus-summary-set-local-parameters gnus-newsgroup-name)))
172
173 (add-hook 'gnus-get-new-news-hook (lambda () (setq ht-gnus-just-read nil)))
174
175 (add-hook 'gnus-after-getting-new-news-hook
176 (lambda () (message "%s" ht-gnus-just-read)))
177
178 (defvar ht-gnus-just-read nil)
179
180 (defun ht-gnus-note-save-to-group ()
181 (let ((g (caar group-art)))
182 (if (not (member g ht-gnus-just-read))
183 (setq ht-gnus-just-read (cons g ht-gnus-just-read)))))
184
185 (add-hook 'nnml-prepare-save-mail-hook (function ht-gnus-note-save-to-group))
186
187 (require 'gnus-art)
188
189 (nconc gnus-treatment-function-alist
190 '((gnus-treat-strip-uoe-warning gnus-article-strip-uoe-warning)))
191
192 (defun gnus-article-strip-uoe-warning (&optional interactive &rest args)
193 "redirect for stripping"
194 (interactive (list t))
195 (save-excursion
196 (set-buffer gnus-article-buffer)
197 (if interactive
198 (call-interactively 'article-strip-uoe-warning)
199 (apply 'article-strip-uoe-warning args))))
200
201 (defun article-strip-uoe-warning ()
202 "strip the stupid uoe warning"
203 (interactive)
204 (save-excursion
205 (article-goto-body)
206 (let ((case-fold-search t))
207 (when
208 (looking-at "This email was sent to you by someone outside the University.")
209 (gnus-delete-line))
210 (when
211 (looking-at "You should only click on links or attachments if you are certain that the email is genuine and the content is safe.")
212 (gnus-delete-line))
213 )))
214
215 (setq gnus-treat-strip-uoe-warning t)