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