+2002-04-17 Kai Gro\e,A_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+ From Ted Zlatanov <teodor.zlatanov@divine.com>.
+
+ * spam.el (spam-whitelist, spam-blacklist, spam-enter-whitelist):
+ Improve docstring.
+ (spam-enter-blacklist): New command.
+
+ * gnus-sum.el (gnus-spam-mark): New mark.
+ (gnus-auto-expirable-marks): Add gnus-spam-mark.
+ (gnus-summary-make-tool-bar): Correct conditional.
+ (gnus-summary-limit-to-unread): Add gnus-spam-mark.
+ (gnus-summary-mark-as-spam): New command.
+
2002-04-13 Josh Huber <huber@alum.wpi.edu>
* mml-sec.el (mml-secure-message): changed to support arbritrary
:group 'gnus-summary-marks
:type 'character)
+(defcustom gnus-spam-mark ?H
+ "*Mark used for spam articles."
+ :group 'gnus-summary-marks
+ :type 'character)
+
(defcustom gnus-souped-mark ?F
"*Mark used for souped articles."
:group 'gnus-summary-marks
:type 'boolean)
(defcustom gnus-auto-expirable-marks
- (list gnus-killed-mark gnus-del-mark gnus-catchup-mark
+ (list gnus-spam-mark gnus-killed-mark gnus-del-mark gnus-catchup-mark
gnus-low-score-mark gnus-ancient-mark gnus-read-mark
gnus-souped-mark gnus-duplicate-mark)
"*The list of marks converted into expiration if a group is auto-expirable."
(defvar gnus-summary-tool-bar-map nil)
;; Emacs 21 tool bar. Should be no-op otherwise.
-;; NB: A new function tool-bar-local-item-from-menu is added in Emacs
-;; 21.2.50+. Considering many users use Emacs 21, use
-;; tool-bar-add-item-from-menu here.
(defun gnus-summary-make-tool-bar ()
- (if (and
- (condition-case nil (require 'tool-bar) (error nil))
- (fboundp 'tool-bar-add-item-from-menu)
- (default-value 'tool-bar-mode)
- (not gnus-summary-tool-bar-map))
+ (if (and (fboundp 'tool-bar-add-item-from-menu)
+ (default-value 'tool-bar-mode)
+ (not gnus-summary-tool-bar-map))
(setq gnus-summary-tool-bar-map
(let ((tool-bar-map (make-sparse-keymap))
(load-path (mm-image-load-path)))
;; Concat all the marks that say that an article is read and have
;; those removed.
(list gnus-del-mark gnus-read-mark gnus-ancient-mark
- gnus-killed-mark gnus-kill-file-mark
+ gnus-killed-mark gnus-spam-mark gnus-kill-file-mark
gnus-low-score-mark gnus-expirable-mark
gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark
gnus-duplicate-mark gnus-souped-mark)
(interactive "p")
(gnus-summary-mark-forward n gnus-expirable-mark))
+(defun gnus-summary-mark-as-spam (n)
+ "Mark N articles forward as spam.
+If N is negative, mark backward instead. The difference between N and
+the actual number of articles marked is returned."
+ (interactive "p")
+ (gnus-summary-mark-forward n gnus-spam-mark))
+
(defun gnus-summary-mark-article-as-replied (article)
"Mark ARTICLE as replied to and update the summary line.
ARTICLE can also be a list of articles."
"When spam files are kept.")
(defvar spam-whitelist (expand-file-name "whitelist" spam-directory)
- "The location of the whitelist.")
+ "The location of the whitelist.
+The file format is one regular expression per line.
+The regular expression is matched against the address.")
(defvar spam-blacklist (expand-file-name "blacklist" spam-directory)
- "The location of the whitelist.")
+ "The location of the blacklist.
+The file format is one regular expression per line.
+The regular expression is matched against the address.")
(defvar spam-whitelist-cache nil)
(defvar spam-blacklist-cache nil)
(defun spam-enter-whitelist (address &optional blacklist)
- "Enter ADDRESS into the whitelist."
+ "Enter ADDRESS into the whitelist.
+Optional arg BLACKLIST, if non-nil, means to enter in the blacklist instead."
(interactive "sAddress: ")
(let ((file (if blacklist spam-blacklist spam-whitelist)))
(unless (file-exists-p (file-name-directory file))
(insert address "\n")
(save-buffer))))
+(defun spam-enter-blacklist (address)
+ "Enter ADDRESS into the blacklist."
+ (interactive "sAddress: ")
+ (spam-enter-whitelist address t))
+
(defun spam-parse-whitelist (&optional blacklist)
(let ((file (if blacklist spam-blacklist spam-whitelist))
contents address)