annotate emacs/gnus-init.el @ 3:870e13483642

sum outputs from multiple uniq -c, maybe?
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 25 May 2021 14:00:47 -0400
parents f005daf4488a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 ;; Last edited: Fri Aug 20 14:49:23 1999
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2 ;; gnus customisation
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
3 (setq mm-inline-large-images t) ;prevent crash in mm-image-fit-p ???
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4 (setq gnus-novice-user nil)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5 (setq gnus-message-archive-group
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
6 '((concat "general." (format-time-string
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
7 "%Y-%m" (current-time)))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
8
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
9 (setq gnus-summary-ignore-duplicates t
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
10 gnus-auto-select-next 'quietly
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
11 gnus-summary-display-arrow nil
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
12 gnus-your-organization "HCRC, University of Edinburgh"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
13 gnus-ignored-headers
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
14 "^Errors-To:\\|^Precedence:\\|^UNIX-From:"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
15 mm-discouraged-alternatives '("text/html")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
16 nnmail-expiry-wait 28
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
17 nnmail-spool-file
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
18 '((file)(file :path "/home/ht/mbox")))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
19
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
20 (setq bbdb/news-auto-create-p t)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
21
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
22 (defconst hash-file "/home/ht/.whitelist")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
23
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
24 (defvar white-hash (make-hash-table :test (function equal)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
25
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
26 (with-current-buffer (get-buffer-create " *Whitelist")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
27 (insert-file-contents hash-file)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
28 (goto-char (point-min))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
29 (while (not (eobp))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
30 (puthash (buffer-substring (point) (progn
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
31 (end-of-line)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
32 (point)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
33 t
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
34 white-hash)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
35 (forward-line)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
36
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
37 (defun get-from-addr ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
38 (gnus-extract-address-components
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
39 (gnus-fetch-field "From")))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
40
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
41 (defun get-current-from-addr ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
42 (with-current-buffer gnus-article-buffer
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
43 (get-from-addr)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
44
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
45 (defun white-list (list)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
46 (if (or (gethash (cadr (get-from-addr))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
47 white-hash)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
48 (let ((subj (gnus-fetch-field "Subject")))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
49 (and subj
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
50 (string-match "\\[\\([^]]*\\)\\]" subj)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
51 (member (match-string 1 subj) white-lists))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
52 list))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
53
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
54 (defun add-white ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
55 (interactive)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
56 (gnus-summary-goto-article (gnus-summary-article-number))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
57 (do-add-white (cadr (get-current-from-addr))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
58
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
59 (defun do-add-white (addr)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
60 (puthash addr t white-hash)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
61 (with-current-buffer (get-buffer " *Whitelist")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
62 (let ((max (point-max)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
63 (goto-char max)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
64 (insert addr)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
65 (insert "\n")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
66 (write-region max (point) hash-file t))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
67
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
68 (defun bogoNote (group)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
69 (shell-command-on-region (point-min) (point-max)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
70 "/home/ht/bin/makeBogo")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
71 'delete)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
72
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
73
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
74 (defun whiten-recip ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
75 ;;; a hook for outgoing mail
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
76 (let ((recips (message-options-get 'message-recipients)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
77 (mapcar (function new-white)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
78 (split-string recips ",[ \f\t\n\r\v]+" t))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
79
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
80 (add-hook 'message-sent-hook (function whiten-recip))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
81
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
82 (defun new-white (addr)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
83 (if (gethash addr white-hash)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
84 nil
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
85 (do-add-white addr)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
86
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
87 (setq wsp-cache nil)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
88
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
89 (defun split-on-whole-field (field pat list)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
90 (goto-char (point-max))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
91 (let ((hit (assq pat wsp-cache))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
92 rpat)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
93 (if hit
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
94 (setq rpat (cdr hit))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
95 (setq rpat
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
96 (concat "^"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
97 field
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
98 ":\\s-*"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
99 (if (stringp pat)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
100 pat
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
101 (cdr (assq pat
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
102 nnmail-split-abbrev-alist)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
103 "$"))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
104 (setq wsp-cache (cons (cons pat rpat) wsp-cache)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
105 (if (re-search-backward rpat nil t)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
106 list)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
107
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
108 (setq nnmail-crosspost nil)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
109 (setq nnmail-split-methods 'nnmail-split-fancy)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
110
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
111 (setq ht-lists
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
112 '(("Subject" "Cron <mt> /home/mt/bin/heartbeat" "heartbeat")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
113 ("Subject" "Cron <mt[@]markup> /home/mt/bin/heartbeat" "heartbeat")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
114 (to "xml-dev" "xml")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
115 (to "markup@markup[a-zA-Z]*" "markup")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
116 (to "general@developer.marklogic.com" "marklogic")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
117 (to "betterform-users@lists.sourceforge.net" "betterform")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
118 (to "betterform-developer@lists.sourceforge.net" "betterform")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
119 (to "mrbs-[a-zA-Z]*@lists.sourceforge.net" "mrbs")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
120 (to "selenium-users" "selenium")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
121 (to "sqlobject-discuss" "sqlobject")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
122 (to "exist-open@lists.sourceforge.net" "exist")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
123 (to "exim-users@exim.org" "exim")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
124 (to "exist-development@lists.sourceforge.net" "exist")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
125 (to "xsltforms-support@lists.sourceforge.net" "xsltforms")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
126 (to "mtt" "mtt")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
127 (to "ding" "gnus")))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
128
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
129 (setq white-lists '("selenium-users" "Betterform-users" "Exist-development" "Exist-open"))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
130
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
131 (defvar ht-compiled-split nil)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
132
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
133 (defun set-ht-compiled-split ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
134 "update the mail splitting rules"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
135 (interactive)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
136 (setq ht-compiled-split
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
137 (let* ((month
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
138 (format-time-string "%Y-%m" (current-time)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
139 (now-group (concat "group-" month))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
140 (now-pers (concat "pers-" month)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
141 `(|
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
142 (: split-on-whole-field "Subject" "testing" 'junk)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
143 ,@ht-lists
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
144 (to "ht\\|henry\\|\\(h\\.?\\)?thompson?" ,now-pers)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
145 (to "xml-dev" "xml")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
146 ,now-group
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
147 ))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
148
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
149 (set-ht-compiled-split)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
150
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
151 (setq nnmail-split-fancy
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
152 '(!
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
153 (lambda (sres)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
154 (if (or (equal (car sres) "notSPAM")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
155 (equal (car sres) "waSPAM"))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
156 ;; documentation is wrong, no recursion,
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
157 ;; so we do it ourselves :-(
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
158 (nnmail-split-it ht-compiled-split)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
159 sres))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
160 (| (to "ht@hppllc.org" "llc")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
161 ("X-Bogosity" "\\(Yes\\|Unsure\\).*"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
162 (| (: white-list "waSPAM")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
163 ("X-Spam-Score" "0" "boSPAM")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
164 ("X-Bogosity" "Unsure.*" "mSPAM")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
165 "bfSPAM"))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
166 (: split-on-whole-field "X-Spam-Level" "\\*\\*\\*\\*.*"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
167 '(| (: white-list "waSPAM")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
168 "saSPAM"))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
169 ("X-Spam-Status" "Yes.*"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
170 (| (: white-list "waSPAM")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
171 "saSPAM"))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
172 "notSPAM")))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
173
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
174 (defun ht-gnus-summary-delete-forward ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
175 "REAL delete for nnmail gnus"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
176 (interactive)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
177 (gnus-summary-delete-article)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
178 (gnus-summary-next-unread-article))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
179
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
180 (require 'my-news)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
181 (setq gnus-show-mime t) ; stale
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
182
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
183 ;; try to ignore list name in subject for sorting
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
184 (setq message-subject-re-regexp "^[ ]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ ]*\\)*\\(\\[[^]]*\\]\\)?[ ]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ ]*\\)*")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
185
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
186 (custom-set-variables
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
187 '(gnus-treat-display-picons nil))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
188 (custom-set-faces)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
189
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
190 (require 'mm-decode)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
191 (setq mm-automatic-display (remove "text/html" mm-automatic-display))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
192
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
193 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
194
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
195 (add-hook 'gnus-summary-mode-hook 'gnus-summary-mode-fun1)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
196
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
197 ;; run the first time we make a summary window
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
198 (defun gnus-summary-mode-fun1 ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
199 "install ht's mods"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
200 (define-key gnus-summary-mode-map "D" 'ht-gnus-summary-delete-forward)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
201 (define-key gnus-summary-mode-map "\M-d" 'gnus-edit-and-move-to-diary)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
202 (define-key gnus-summary-mode-map "\M-e" 'gnus-extract-attachment)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
203 (define-key gnus-summary-mode-map "\M-w" 'add-white)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
204 (define-key gnus-summary-mode-map "\M-h" 'showMPAhtml)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
205 (define-key gnus-summary-mode-map "~" 'mark-and-mark)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
206 (remove-hook 'gnus-summary-mode-hook 'gnus-summary-mode-fun1))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
207
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
208 (defun ht-gnus-pers-refresh (n)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
209 (interactive "p")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
210 (let ((gn (concat "nnml+ht:pers-"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
211 (format-time-string "%Y-%m" (current-time)))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
212 (gnus-group-goto-group gn)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
213 (gnus-group-get-new-news-this-group n)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
214 (gnus-group-goto-group gn)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
215 (gnus-group-read-group))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
216 )
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
217
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
218 (add-hook 'gnus-group-mode-hook 'gnus-group-mode-fun1)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
219
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
220 ;; run the first time we make a group window
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
221 (defun gnus-group-mode-fun1 ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
222 "install ht's mods"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
223 (define-key gnus-group-mode-map "\M-\C-g" 'ht-gnus-pers-refresh)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
224 (remove-hook 'gnus-group-mode-hook 'gnus-group-mode-fun1))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
225
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
226 (defun gnus-user-format-function-t (header)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
227 "display the to field (for archive messages)"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
228 (let ((n (mail-header-number header)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
229 (with-current-buffer nntp-server-buffer
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
230 (save-excursion
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
231 (save-restriction
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
232 (let ((inhibit-point-motion-hooks t))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
233 (goto-char (point-min))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
234 (let ((beg (search-forward (format " %d Article retrieved." n)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
235 (end (search-forward "\n.\n")))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
236 (narrow-to-region beg end)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
237 (goto-char beg)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
238 (message-fetch-field "To"))))))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
239
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
240 (defun showMPAhtml ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
241 "Show the text/html parts of an multipart/alternative message using lynx"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
242 (interactive)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
243 (gnus-summary-select-article)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
244 (with-current-buffer gnus-original-article-buffer
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
245 (shell-command-on-region (point-min) (point-max) "/home/ht/bin/showMPA.sh")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
246 )
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
247 )
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
248
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
249 (defun gnus-extract-attachment ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
250 "extract attachments from a multi-part mime message"
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
251 (interactive)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
252 (let ((sm gnus-show-mime))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
253 (if sm
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
254 (progn (setq gnus-show-mime nil)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
255 (gnus-summary-select-article t 'force))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
256 )
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
257 (gnus-article-show-all-headers)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
258 (with-current-buffer gnus-article-buffer
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
259 (save-excursion
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
260 (save-restriction
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
261 (mime/viewer-mode)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
262 (delete-other-windows)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
263 (let ((pt 0))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
264 (while (progn
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
265 (mime-viewer/next-content)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
266 (and
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
267 (equal "*Preview-*Article**" (buffer-name (current-buffer)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
268 (not (= pt (point)))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
269 (setq pt (point))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
270 (if (looking-at "^\\[[0-9]* \\([^ ]+ \\)+<")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
271 (mime-viewer/extract-content)))))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
272 (kill-buffer "*Preview-*Article**")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
273 (setq gnus-show-mime sm)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
274 ))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
275
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
276 (make-variable-buffer-local 'gnus-extra-headers)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
277 (make-variable-buffer-local 'nnmail-extra-headers)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
278 (add-hook 'gnus-parse-headers-hook
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
279 '(lambda ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
280 (gnus-summary-set-local-parameters gnus-newsgroup-name)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
281
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
282 (defun del-dups ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
283 (interactive)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
284 (gnus-summary-sort-by-subject)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
285 (gnus-summary-clear-mark-forward 1)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
286 (goto-char (point-min))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
287 (let ((pos))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
288 (while (setq pos (search-forward "] " nil t))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
289 (end-of-line)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
290 (let ((subj (buffer-substring pos (point))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
291 (unless (equal subj "")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
292 (let ((target (if (< (length subj) 26)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
293 (concat "] " subj "\n")
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
294 (concat "] " (substring subj 0 25))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
295 (done 0)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
296 (case-fold-search nil))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
297 (while (and (= done 0)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
298 (search-forward target nil t))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
299 (forward-char -3)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
300 (setq done (gnus-summary-mark-as-read-forward 1))))))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
301 (gnus-summary-limit-to-unread)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
302 (gnus-summary-sort-by-original))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
303
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
304 (add-hook 'gnus-get-new-news-hook (lambda () (setq ht-gnus-just-read nil)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
305
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
306 (add-hook 'gnus-after-getting-new-news-hook
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
307 (lambda () (message "%s" ht-gnus-just-read)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
308
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
309 (defvar ht-gnus-just-read nil)
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
310
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
311 (defun ht-gnus-note-save-to-group ()
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
312 (let ((g (caar group-art)))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
313 (if (not (member g ht-gnus-just-read))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
314 (setq ht-gnus-just-read (cons g ht-gnus-just-read)))))
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
315
f005daf4488a local changes since 2007
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
316 (add-hook 'nnml-prepare-save-mail-hook (function ht-gnus-note-save-to-group))