Mercurial > hg > xemacs
annotate gnus-init.el @ 39:f593eacb57b0
needed now
author | Henry S Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Tue, 12 Dec 2023 10:28:33 +0000 |
parents | cb9b76219c55 |
children | eee08de75336 |
rev | line source |
---|---|
6 | 1 ;; gnus customisation |
2 | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
3 (site-caseq (edin |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
4 (require 'mail-from-inf)) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
5 (maritain |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
6 (require 'mail-from-m) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
7 )) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
8 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
9 ;; things based on my-mail-dir, which is set in one of the above |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
10 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
11 (setq gnus-article-save-directory (concat my-mail-dir "/Mail") |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
12 nnml-directory (expand-file-name (concat my-mail-dir "/Mail")) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
13 gnus-message-archive-method |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
14 '(nnfolder "archive" |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
15 ;; the following two are not taking effect, not sure why, answer |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
16 ;; _may_ lie in gnus-setup-news... |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
17 (nnfolder-directory (concat my-mail-dir "/cpy")) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
18 (nnfolder-active-file (concat my-mail-dir "/cpy/active"))) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
19 mail-sources '((file :path "/var/spool/mail/ht"))) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
20 |
6 | 21 (setq gnus-novice-user nil) |
22 | |
23 (setq gnus-message-archive-group | |
24 '((concat "general." (format-time-string | |
25 "%Y-%m" (current-time))))) | |
26 | |
21 | 27 |
28 | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
29 (setq gnus-auto-select-next 'quietly |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
30 gnus-buttonized-mime-types '("multipart/signed") |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
31 gnus-group-line-format "%M%S%p%P%5y:%uH%(%g%)%l %O |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
32 " |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
33 gnus-ignored-headers "^Errors-To:\\|^Precedence:\\|^UNIX-From:" |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
34 gnus-inhibit-mime-unbuttonizing nil |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
35 gnus-mime-display-multipart-related-as-mixed t |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
36 gnus-show-mime t |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
37 gnus-simplify-subject-regexp "^\\(re[:;.]\\| \\|fwd:\\)*" |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
38 gnus-summary-display-arrow nil |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
39 gnus-summary-gather-subject-limit nil |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
40 gnus-summary-ignore-duplicates t |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
41 gnus-summary-line-format "%U%R%5N%I%(%[%4L: %-12,12A%]%) %s\n" |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
42 gnus-summary-make-false-root 'none |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
43 gnus-thread-sort-functions '(gnus-thread-sort-by-number |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
44 gnus-thread-sort-by-simpl-subject) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
45 gnus-use-scoring nil ; not used yet |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
46 message-from-style 'angles |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
47 mm-discouraged-alternatives '("text/html") |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
48 nnmail-expiry-wait 28 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
49 no-select-groups '("nnml+ht:cygwin") |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
50 ) |
6 | 51 |
52 (setq bbdb/news-auto-create-p t) | |
53 | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
54 (setq wsp-cache nil) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
55 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
56 ;;;(setq blacklist-db (open-database "~/.blacklist")) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
57 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
58 (require 'my-news) ; defines db functions |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
59 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
60 (open-white) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
61 (open-ad) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
62 (open-quaker) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
63 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
64 (add-hook 'kill-emacs-hook |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
65 (lambda () |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
66 (if (database-live-p whitelist-db) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
67 (close-database whitelist-db)) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
68 (if (database-live-p quaker-db) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
69 (close-database quaker-db)) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
70 (if (database-live-p adlist-db) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
71 (close-database adlist-db)))) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
72 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
73 (add-hook 'bbdb-complete-name-hooks 'quaker-sig-if-quaker) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
74 (add-hook 'gnus-message-setup-hook 'quaker-sig-if-to-quaker) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
75 |
6 | 76 (setq nnmail-crosspost nil) |
77 (setq nnmail-split-methods 'nnmail-split-fancy) | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
78 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
79 (setq white-domains (list)) |
24 | 80 |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
81 (setq ad-domains (list "planetx.co.uk" "substack.com")) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
82 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
83 (defvar ht-compiled-split nil) |
24 | 84 |
85 (defun set-ht-compiled-split () | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
86 "update the mail splitting rules" |
24 | 87 (interactive) |
88 (set-nnmail-split-fancy)) | |
89 | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
90 (setq gnus-show-mime t) ; stale |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
91 (setq mml1991-use 'pgg |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
92 mml2015-use 'pgg |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
93 mm-verify-option 'always) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
94 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
95 (require 'mm-decode) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
96 (setq mm-automatic-display (remove "text/html" mm-automatic-display)) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
97 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
98 (custom-set-faces) |
6 | 99 |
100 (defun ht-gnus-summary-delete-forward () | |
101 "REAL delete for nnmail gnus" | |
102 (interactive) | |
103 (gnus-summary-delete-article) | |
104 (gnus-summary-next-unread-article)) | |
105 | |
21 | 106 (add-hook 'kill-emacs-hook |
107 (lambda () | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
108 (if (database-live-p whitelist-db) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
109 (close-database whitelist-db)) |
21 | 110 (if (database-live-p quaker-db) |
111 (close-database quaker-db)) | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
112 (if (database-live-p adlist-db) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
113 (close-database adlist-db)) |
21 | 114 )) |
115 | |
116 (add-hook 'bbdb-complete-name-hooks 'quaker-sig-if-quaker) | |
117 | |
6 | 118 (custom-set-variables |
119 '(gnus-treat-display-picons nil)) | |
120 (custom-set-faces) | |
121 | |
122 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode) | |
123 | |
124 (add-hook 'gnus-summary-mode-hook 'gnus-summary-mode-fun1) | |
125 | |
21 | 126 (add-hook 'message-mode-hook 'message-mode-fun1) |
127 | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
128 (add-hook 'message-sent-hook (function whiten-recip)) |
21 | 129 |
6 | 130 (defun ht-gnus-pers-refresh (n) |
131 (interactive "p") | |
132 (let ((gn (concat "nnml+ht:pers-" | |
133 (format-time-string "%Y-%m" (current-time))))) | |
134 (gnus-group-goto-group gn) | |
135 (gnus-group-get-new-news-this-group n) | |
136 (gnus-group-goto-group gn) | |
137 (gnus-group-read-group)) | |
138 ) | |
139 | |
140 (add-hook 'gnus-group-mode-hook 'gnus-group-mode-fun1) | |
141 | |
142 | |
143 (defun gnus-regen-group () | |
144 (nnml-generate-nov-databases-1 (concat | |
145 (expand-file-name nnml-directory) | |
146 "/" | |
147 (substring (gnus-group-group-name) 8)) | |
148 nil t) | |
149 ) | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
150 (require 'mailcrypt) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
151 (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
152 (add-hook 'message-mode-hook 'mc-install-write-mode) |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
153 (add-hook 'news-reply-mode-hook 'mc-install-write-mode) |
6 | 154 |
155 (defun gnus-user-format-function-t (header) | |
156 "display the to field (for archive messages)" | |
157 (let ((n (mail-header-number header))) | |
158 (with-current-buffer nntp-server-buffer | |
159 (save-excursion | |
160 (save-restriction | |
161 (let ((inhibit-point-motion-hooks t)) | |
162 (goto-char (point-min)) | |
163 (let ((beg (search-forward (format " %d Article retrieved." n))) | |
164 (end (search-forward "\n.\n"))) | |
165 (narrow-to-region beg end) | |
166 (goto-char beg) | |
167 (message-fetch-field "To")))))))) | |
168 | |
169 (make-variable-buffer-local 'gnus-extra-headers) | |
170 (make-variable-buffer-local 'nnmail-extra-headers) | |
171 (add-hook 'gnus-parse-headers-hook | |
172 '(lambda () | |
173 (gnus-summary-set-local-parameters gnus-newsgroup-name))) | |
21 | 174 |
175 (add-hook 'gnus-get-new-news-hook (lambda () (setq ht-gnus-just-read nil))) | |
176 | |
177 (add-hook 'gnus-after-getting-new-news-hook | |
178 (lambda () (message "%s" ht-gnus-just-read))) | |
179 | |
180 (defvar ht-gnus-just-read nil) | |
181 | |
182 (defun ht-gnus-note-save-to-group () | |
183 (let ((g (caar group-art))) | |
184 (if (not (member g ht-gnus-just-read)) | |
185 (setq ht-gnus-just-read (cons g ht-gnus-just-read))))) | |
186 | |
187 (add-hook 'nnml-prepare-save-mail-hook (function ht-gnus-note-save-to-group)) | |
188 | |
23 | 189 (require 'gnus-art) |
190 | |
191 (nconc gnus-treatment-function-alist | |
192 '((gnus-treat-strip-uoe-warning gnus-article-strip-uoe-warning))) | |
193 | |
194 (defun gnus-article-strip-uoe-warning (&optional interactive &rest args) | |
195 "redirect for stripping" | |
196 (interactive (list t)) | |
197 (save-excursion | |
198 (set-buffer gnus-article-buffer) | |
199 (if interactive | |
200 (call-interactively 'article-strip-uoe-warning) | |
201 (apply 'article-strip-uoe-warning args)))) | |
202 | |
203 (defun article-strip-uoe-warning () | |
204 "strip the stupid uoe warning" | |
205 (interactive) | |
206 (save-excursion | |
207 (article-goto-body) | |
208 (let ((case-fold-search t)) | |
209 (when | |
210 (looking-at "This email was sent to you by someone outside the University.") | |
211 (gnus-delete-line)) | |
212 (when | |
213 (looking-at "You should only click on links or attachments if you are certain that the email is genuine and the content is safe.") | |
214 (gnus-delete-line)) | |
215 ))) | |
216 | |
217 (setq gnus-treat-strip-uoe-warning t) | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
218 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
219 (provide 'gnus-init) |