Mercurial > hg > xemacs
annotate gnus-init.el @ 43:eee08de75336
try to do better at where news/mail/init stuff is handled,
works on ecclerig, mostly, but may break maritain
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Sat, 16 Dec 2023 21:10:30 +0000 |
parents | cb9b76219c55 |
children | 40e245d3d1b3 06ccca1d4756 |
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 |
43
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
9 ;; things based on my-mail-dir, or set-ht-compiled-split |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
10 ;; which are defined in one of the above |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
11 |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
12 (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
|
13 |
43
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
14 (setq |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
15 gnus-article-save-directory (expand-file-name (concat my-mail-dir "/Mail")) |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
16 nnml-directory (expand-file-name (concat my-mail-dir "/Mail")) |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
17 gnus-message-archive-method |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
18 '(nnfolder "archive" |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
19 ;; the following two are not taking effect, not sure why, answer |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
20 ;; _may_ lie in gnus-setup-news... |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
21 (nnfolder-directory (concat my-mail-dir "/cpy")) |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
22 (nnfolder-active-file (concat my-mail-dir "/cpy/active"))) |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
23 ) |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
24 |
6 | 25 (setq gnus-novice-user nil) |
26 | |
27 (setq gnus-message-archive-group | |
28 '((concat "general." (format-time-string | |
29 "%Y-%m" (current-time))))) | |
30 | |
21 | 31 |
32 | |
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 (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
|
34 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
|
35 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
|
36 " |
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-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
|
38 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
|
39 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
|
40 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
|
41 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
|
42 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
|
43 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
|
44 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
|
45 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
|
46 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
|
47 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
|
48 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
|
49 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
|
50 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
|
51 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
|
52 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
|
53 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
|
54 ) |
6 | 55 |
56 (setq bbdb/news-auto-create-p t) | |
57 | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
58 (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
|
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 ;;;(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
|
61 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
62 (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
|
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 (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
|
65 (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
|
66 (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
|
67 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
68 (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
|
69 (lambda () |
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 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
|
71 (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
|
72 (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
|
73 (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
|
74 (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
|
75 (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
|
76 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
77 (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
|
78 (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
|
79 |
6 | 80 (setq nnmail-crosspost nil) |
81 (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
|
82 |
43
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
83 (setq white-subjects "\\b\\(phd\\|ilcc\\)\\b") |
eee08de75336
try to do better at where news/mail/init stuff is handled,
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
32
diff
changeset
|
84 |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
85 (setq white-domains (list)) |
24 | 86 |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
87 (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
|
88 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
89 (defvar ht-compiled-split nil) |
24 | 90 |
32
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 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
|
92 (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
|
93 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
|
94 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
|
95 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
96 (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
|
97 (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
|
98 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
99 (custom-set-faces) |
6 | 100 |
101 (defun ht-gnus-summary-delete-forward () | |
102 "REAL delete for nnmail gnus" | |
103 (interactive) | |
104 (gnus-summary-delete-article) | |
105 (gnus-summary-next-unread-article)) | |
106 | |
21 | 107 (add-hook 'kill-emacs-hook |
108 (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
|
109 (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
|
110 (close-database whitelist-db)) |
21 | 111 (if (database-live-p quaker-db) |
112 (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
|
113 (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
|
114 (close-database adlist-db)) |
21 | 115 )) |
116 | |
117 (add-hook 'bbdb-complete-name-hooks 'quaker-sig-if-quaker) | |
118 | |
6 | 119 (custom-set-variables |
120 '(gnus-treat-display-picons nil)) | |
121 (custom-set-faces) | |
122 | |
123 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode) | |
124 | |
125 (add-hook 'gnus-summary-mode-hook 'gnus-summary-mode-fun1) | |
126 | |
21 | 127 (add-hook 'message-mode-hook 'message-mode-fun1) |
128 | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
129 (add-hook 'message-sent-hook (function whiten-recip)) |
21 | 130 |
6 | 131 (defun ht-gnus-pers-refresh (n) |
132 (interactive "p") | |
133 (let ((gn (concat "nnml+ht:pers-" | |
134 (format-time-string "%Y-%m" (current-time))))) | |
135 (gnus-group-goto-group gn) | |
136 (gnus-group-get-new-news-this-group n) | |
137 (gnus-group-goto-group gn) | |
138 (gnus-group-read-group)) | |
139 ) | |
140 | |
141 (add-hook 'gnus-group-mode-hook 'gnus-group-mode-fun1) | |
142 | |
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 ) | |
32
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
151 (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
|
152 (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
|
153 (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
|
154 (add-hook 'news-reply-mode-hook 'mc-install-write-mode) |
6 | 155 |
156 (defun gnus-user-format-function-t (header) | |
157 "display the to field (for archive messages)" | |
158 (let ((n (mail-header-number header))) | |
159 (with-current-buffer nntp-server-buffer | |
160 (save-excursion | |
161 (save-restriction | |
162 (let ((inhibit-point-motion-hooks t)) | |
163 (goto-char (point-min)) | |
164 (let ((beg (search-forward (format " %d Article retrieved." n))) | |
165 (end (search-forward "\n.\n"))) | |
166 (narrow-to-region beg end) | |
167 (goto-char beg) | |
168 (message-fetch-field "To")))))))) | |
169 | |
170 (make-variable-buffer-local 'gnus-extra-headers) | |
171 (make-variable-buffer-local 'nnmail-extra-headers) | |
172 (add-hook 'gnus-parse-headers-hook | |
173 '(lambda () | |
174 (gnus-summary-set-local-parameters gnus-newsgroup-name))) | |
21 | 175 |
176 (add-hook 'gnus-get-new-news-hook (lambda () (setq ht-gnus-just-read nil))) | |
177 | |
178 (add-hook 'gnus-after-getting-new-news-hook | |
179 (lambda () (message "%s" ht-gnus-just-read))) | |
180 | |
181 (defvar ht-gnus-just-read nil) | |
182 | |
183 (defun ht-gnus-note-save-to-group () | |
184 (let ((g (caar group-art))) | |
185 (if (not (member g ht-gnus-just-read)) | |
186 (setq ht-gnus-just-read (cons g ht-gnus-just-read))))) | |
187 | |
188 (add-hook 'nnml-prepare-save-mail-hook (function ht-gnus-note-save-to-group)) | |
189 | |
23 | 190 (require 'gnus-art) |
191 | |
192 (nconc gnus-treatment-function-alist | |
193 '((gnus-treat-strip-uoe-warning gnus-article-strip-uoe-warning))) | |
194 | |
195 (defun gnus-article-strip-uoe-warning (&optional interactive &rest args) | |
196 "redirect for stripping" | |
197 (interactive (list t)) | |
198 (save-excursion | |
199 (set-buffer gnus-article-buffer) | |
200 (if interactive | |
201 (call-interactively 'article-strip-uoe-warning) | |
202 (apply 'article-strip-uoe-warning args)))) | |
203 | |
204 (defun article-strip-uoe-warning () | |
205 "strip the stupid uoe warning" | |
206 (interactive) | |
207 (save-excursion | |
208 (article-goto-body) | |
209 (let ((case-fold-search t)) | |
210 (when | |
211 (looking-at "This email was sent to you by someone outside the University.") | |
212 (gnus-delete-line)) | |
213 (when | |
214 (looking-at "You should only click on links or attachments if you are certain that the email is genuine and the content is safe.") | |
215 (gnus-delete-line)) | |
216 ))) | |
217 | |
218 (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
|
219 |
cb9b76219c55
attempt to merge mail read and send from all over
Henry S Thompson <ht@inf.ed.ac.uk>
parents:
24
diff
changeset
|
220 (provide 'gnus-init) |